]> git.ipfire.org Git - pakfire.git/commitdiff
tests: execute: Check if the process has received PID 1
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Jul 2022 08:39:50 +0000 (08:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Jul 2022 08:39:50 +0000 (08:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/python/execute.py

index 575216cca700456fe20377eb20264fa4dca76958..4de96f4e45a27d414ae13c98f45aad267dd7e551 100755 (executable)
@@ -99,6 +99,13 @@ class Test(unittest.TestCase):
                                logging_callback=log,
                        )
 
+       def test_pid(self):
+               def checkpid(priority, message):
+                       # The PID must be 1
+                       self.assertEqual(message, "1")
+
+               self.pakfire.execute(["/command", "pid"], logging_callback=checkpid)
+
        # This is an interactive test which cannot be performed automatically
        #def test_shell(self):
        #       self.pakfire.execute(["/bin/bash", "-i"])