From 8c301eed0e43ab03b195ca7a64a07e07d02881ce Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 18 Jun 2026 14:47:53 +0200 Subject: [PATCH] support/testing: test_systemd.py: use assertRun{, Not}Ok() Use the helpers to simplify the test. Signed-off-by: Peter Korsgaard --- support/testing/tests/init/test_systemd.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/support/testing/tests/init/test_systemd.py b/support/testing/tests/init/test_systemd.py index 472a65db57..60b9c3d032 100644 --- a/support/testing/tests/init/test_systemd.py +++ b/support/testing/tests/init/test_systemd.py @@ -340,19 +340,16 @@ class InitSystemSystemdBaseOverlayfs(): # /var/foo/bar is from the pre-populated /var, so it should # not be present in the upper of the overlay - _, exit_code = self.emulator.run("test -e /run/buildroot/mounts/var/upper/foo/bar") - self.assertNotEqual(exit_code, 0) + self.assertRunNotOk("test -e /run/buildroot/mounts/var/upper/foo/bar") # We can write in /var/foo/bar - _, exit_code = self.emulator.run("echo barfoo >/var/foo/bar") - self.assertEqual(exit_code, 0) + self.assertRunOk("echo barfoo >/var/foo/bar") # ... and it contains the new content out, exit_code = self.emulator.run("cat /var/foo/bar") self.assertEqual(exit_code, 0) self.assertEqual(out[0], "barfoo") # ... and it to appears in the upper - _, exit_code = self.emulator.run("test -e /run/buildroot/mounts/var/upper/foo/bar") - self.assertEqual(exit_code, 0) + self.assertRunOk("test -e /run/buildroot/mounts/var/upper/foo/bar") # ... with the new content out, exit_code = self.emulator.run("cat /run/buildroot/mounts/var/upper/foo/bar") self.assertEqual(exit_code, 0)