mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
support/testing: test_systemd.py: use assertRun{, Not}Ok()
Use the helpers to simplify the test. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user