From 83819a061d73c9331e38fcca083c442584dabfaa 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..b69c537917 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`. """ + pid_directory = '/var/tmp/pid' # noqa: S108 insecure usage of temporary dir + self.execute(ShellScript(f"mkdir -p {pid_directory}")) + self.execute(ShellScript(f"chmod ugo+rwx {pid_directory}")) # A couple of requiremens for this field: #