javapackages-tools/SOURCES/0004-test-Don-t-try-to-kill...

30 lines
1.1 KiB
Diff

From 16808487796822c5477d1ba0478bd2b0ca884818 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 18 May 2020 09:11:31 +0200
Subject: [PATCH 4/4] [test] Don't try to kill PID 1 during tests
Normally PID 1 should not be killable, but when running tests in
container this is actually possible.
---
test/test_common.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/test_common.py b/test/test_common.py
index 9bdc4675..67370422 100644
--- a/test/test_common.py
+++ b/test/test_common.py
@@ -163,8 +163,8 @@ def call_rpmgen(rpmgen_name, filelist_prefix, filelist, env=None,
except OSError:
pass
for line in stdin:
- # FIXME this PID is a temporary hack
- ret = call_script(scriptpath, ["--cachedir", "/tmp", "--rpm-pid", "1"],
+ _, dummy_pid, _ = util.execute_command("echo $$")
+ ret = call_script(scriptpath, ["--cachedir", "/tmp", "--rpm-pid", dummy_pid],
stdin=line, extra_env=env)
try:
shutil.rmtree("/tmp/.javapackages_cache/")
--
2.25.4