Skip to content

Commit

Permalink
Makes the pidfile accessible by everyone
Browse files Browse the repository at this point in the history
Creates the pidfile at an accessible location
for every user, this way the manage pidfile
warning is avoided.

Signed-off-by: mcasquer <[email protected]>
  • Loading branch information
mcasquer committed Oct 24, 2024
1 parent bc64a2f commit 0dc6e94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tmt/steps/execute/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions tmt/steps/provision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand Down

0 comments on commit 0dc6e94

Please sign in to comment.