]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: improve assertion message on failure
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 13 Oct 2022 08:31:37 +0000 (17:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 13 Oct 2022 08:33:09 +0000 (17:33 +0900)
Suggested by CodeQL#169 (https://github.com/systemd/systemd/security/code-scanning/169).

test/test-exec-deserialization.py

index 06a7d369f6e13bc5489340bbba77ddc2410790fa..08307b18d79a34d19e0358a7498d5ddbf3c8f274 100755 (executable)
@@ -200,7 +200,7 @@ class ExecutionResumeTest(unittest.TestCase):
         self.reload()
         time.sleep(5)
 
-        self.assertTrue(subprocess.call("journalctl -b _PID=1 | grep -q 'Freezing execution'", shell=True) != 0)
+        self.assertNotEqual(subprocess.call("journalctl -b _PID=1 | grep -q 'Freezing execution'", shell=True), 0)
 
     def tearDown(self):
         for f in [self.output_file, self.unitfile_path]: