Tests: fixed test_respawn.py to act upon test processes.
Running `test_respawn_` test cases on a machine with Unit daemon in background would fail tests because `ps ax` was used without filtering out other unit instances. This patch also prevents from tests killing other Unit processes not related to tests.
This commit is contained in:
@@ -443,6 +443,10 @@ def is_unsafe(request):
|
||||
def is_su(request):
|
||||
return os.geteuid() == 0
|
||||
|
||||
@pytest.fixture
|
||||
def unit_pid(request):
|
||||
return unit_instance['process'].pid
|
||||
|
||||
def pytest_sessionfinish(session):
|
||||
unit_stop()
|
||||
shutil.rmtree(option.cache_dir)
|
||||
|
||||
Reference in New Issue
Block a user