Blob Blame History Raw
From e5d2b436ed9e01b357a069d1dd6b258fb0b651f3 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 18 May 2020 09:11:31 +0200
Subject: [PATCH 5/5] [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