Update check in SystemdService.exists and add tests #754
Update check in SystemdService.exists and add tests #754CarstenGrohmann wants to merge 5 commits intopytest-dev:mainfrom
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.
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.
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.
Commit 5d3f323 contains the improved check and executes both commands to check if the specified unit exists.
There was a problem hiding this comment.
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.
That's a good idea. The updates branch contains this command to check the existance.
There was a problem hiding this comment.
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.