From: Yu Watanabe Date: Thu, 13 Oct 2022 08:31:37 +0000 (+0900) Subject: test: improve assertion message on failure X-Git-Tag: v252-rc2~46^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c273476934bc5011ef4f377fd1ebbb51d4385ab;p=thirdparty%2Fsystemd.git test: improve assertion message on failure Suggested by CodeQL#169 (https://github.com/systemd/systemd/security/code-scanning/169). --- diff --git a/test/test-exec-deserialization.py b/test/test-exec-deserialization.py index 06a7d369f6e..08307b18d79 100755 --- a/test/test-exec-deserialization.py +++ b/test/test-exec-deserialization.py @@ -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]: