-
-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update check in SystemdService.exists and add tests #754
base: main
Are you sure you want to change the base?
Update check in SystemdService.exists and add tests #754
Conversation
603ce09
to
a7fcca2
Compare
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
This functionality from pytest-testinfra is currently broken. See pytest-dev/pytest-testinfra#757 for more details. Once pytest-dev/pytest-testinfra#754 has been merged and a new release of pytest-testinfra is created the Service.exists line can be restored.
Can anything be done to move this PR along? Is it waiting on something? I'm happy to help where I can. |
testinfra/modules/service.py
Outdated
# list-units: List all units that Systemd currently has in memory, | ||
# this includes generated units like SysV files also | ||
cmd = self.run_test( | ||
r'systemctl list-units --all | grep -q "^[[:space:]]*%s"', self.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my machine (debian trixie) systemctl list-units --all
does not display "postgresql.service" while systemctl list-unit-files
does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are rigth. Non of this commands provided a complete list of unit-files. Therefore, I'll provide an update within the next days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 5d3f323 contains the improved check and executes both commands to check if the specified unit exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about rather using systemctl status <unit>
and check for exit code (4 = does not exists, < 4 exists) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. The updates branch contains this command to check the existance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code runs fine w/o any failed checks now.
e0b2e81
to
6990387
Compare
f598ce2
to
67a866c
Compare
67a866c
to
9b09891
Compare
No description provided.