From 0dc6e9435d5e53945d4bacc58250e73c6c6743a5 Mon Sep 17 00:00:00 2001 From: mcasquer Date: Tue, 1 Oct 2024 13:14:52 +0200 Subject: [PATCH] Makes the pidfile accessible by everyone Creates the pidfile at an accessible location for every user, this way the manage pidfile warning is avoided. Signed-off-by: mcasquer --- tmt/steps/execute/internal.py | 2 +- tmt/steps/provision/__init__.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tmt/steps/execute/internal.py b/tmt/steps/execute/internal.py index 7f8332fe20..974c5316ce 100644 --- a/tmt/steps/execute/internal.py +++ b/tmt/steps/execute/internal.py @@ -34,7 +34,7 @@ TEST_PIDFILE_LOCK_FILENAME = f'{TEST_PIDFILE_FILENAME}.lock' #: The default directory for storing test pid file. -TEST_PIDFILE_ROOT = Path('/var/tmp') # noqa: S108 insecure usage of temporary dir +TEST_PIDFILE_ROOT = Path('/var/tmp/pid') # noqa: S108 insecure usage of temporary dir def effective_pidfile_root() -> Path: diff --git a/tmt/steps/provision/__init__.py b/tmt/steps/provision/__init__.py index de43937e18..c7a04d2358 100644 --- a/tmt/steps/provision/__init__.py +++ b/tmt/steps/provision/__init__.py @@ -912,6 +912,9 @@ def setup(self) -> None: Setup the guest after it has been started. It is called after :py:meth:`Guest.start`. """ + from tmt.steps.execute.internal import effective_pidfile_root + pid_directory = effective_pidfile_root() + self.execute(ShellScript(f"mkdir -p {pid_directory} && chmod ugo+rwx {pid_directory}")) # A couple of requiremens for this field: #