From 35a40614e5be2e57f29e930ad31ee41a36d8bb03 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 12 Oct 2019 00:00:40 +0300 Subject: use process_name_prefix to kill ustreamer --- testenv/tests/apps/cleanup/test_main.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'testenv') diff --git a/testenv/tests/apps/cleanup/test_main.py b/testenv/tests/apps/cleanup/test_main.py index 3e2e4c72..f9b74a06 100644 --- a/testenv/tests/apps/cleanup/test_main.py +++ b/testenv/tests/apps/cleanup/test_main.py @@ -21,7 +21,6 @@ import os -import secrets import multiprocessing import multiprocessing.queues import time @@ -35,16 +34,13 @@ from kvmd.apps.cleanup import main def test_ok(tmpdir) -> None: # type: ignore queue: multiprocessing.queues.Queue = multiprocessing.Queue() - ustreamer_tmp_path = os.path.abspath(str(tmpdir.join("ustr-" + secrets.token_hex(3)))) - os.symlink("/usr/bin/ustreamer", ustreamer_tmp_path) - ustreamer_sock_path = os.path.abspath(str(tmpdir.join("ustreamer-fake.sock"))) open(ustreamer_sock_path, "w").close() kvmd_sock_path = os.path.abspath(str(tmpdir.join("kvmd-fake.sock"))) open(kvmd_sock_path, "w").close() def ustreamer_fake() -> None: - setproctitle.setproctitle(os.path.basename(ustreamer_tmp_path)) + setproctitle.setproctitle("kvmd/streamer: /usr/bin/ustreamer") queue.put(True) while True: time.sleep(1) @@ -57,11 +53,8 @@ def test_ok(tmpdir) -> None: # type: ignore main([ "kvmd-cleanup", "--set-options", - "kvmd/server/port=0", - "kvmd/server/unix=" + kvmd_sock_path, - "kvmd/streamer/port=0", - "kvmd/streamer/unix=" + ustreamer_sock_path, - "kvmd/streamer/cmd=" + ustreamer_tmp_path, + f"kvmd/server/unix={kvmd_sock_path}", + f"kvmd/streamer/unix={ustreamer_sock_path}", ]) assert not os.path.exists(ustreamer_sock_path) -- cgit v1.2.3