* [Buildroot] [PATCH 02/29] support/testing: test_systemd.py: use assertRun{, Not}Ok()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
@ 2026-06-18 12:47 ` Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 03/29] support/testing: test_acl.py: use assertRunNotOk() Peter Korsgaard
` (28 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:47 UTC (permalink / raw)
To: buildroot
Use the helpers to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
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)
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 03/29] support/testing: test_acl.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 02/29] support/testing: test_systemd.py: use assertRun{, Not}Ok() Peter Korsgaard
@ 2026-06-18 12:47 ` Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 04/29] support/testing: test_audit.py: " Peter Korsgaard
` (27 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:47 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_acl.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/support/testing/tests/package/test_acl.py b/support/testing/tests/package/test_acl.py
index e4827c7bec..4511c6db5b 100644
--- a/support/testing/tests/package/test_acl.py
+++ b/support/testing/tests/package/test_acl.py
@@ -52,8 +52,7 @@ class TestAcl(infra.basetest.BRTest):
# Reading the file as the test user is expected to fail.
test_read_cmd = f"su - {test_user} -c 'cat {test_file}'"
- _, ret = self.emulator.run(test_read_cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(test_read_cmd)
# We add a special read ACL for the test user.
cmd = f"setfacl -m u:{test_user}:r {test_file}"
@@ -73,8 +72,7 @@ class TestAcl(infra.basetest.BRTest):
# Attempting to write to the file as the test user is expected
# to fail (since we put an ACL only for reading).
cmd = f"su - {test_user} -c 'echo WriteTest > {test_file}'"
- _, ret = self.emulator.run(cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(cmd)
# Remove all ACLs. This could have been done with the command
# "setfacl -b". Instead, we use the "chacl -B" command which
@@ -83,5 +81,4 @@ class TestAcl(infra.basetest.BRTest):
self.assertRunOk(f"chacl -B {test_file}")
# Reading the file as the test user is expected to fail again.
- _, ret = self.emulator.run(test_read_cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(test_read_cmd)
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 04/29] support/testing: test_audit.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 02/29] support/testing: test_systemd.py: use assertRun{, Not}Ok() Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 03/29] support/testing: test_acl.py: use assertRunNotOk() Peter Korsgaard
@ 2026-06-18 12:47 ` Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 05/29] support/testing: test_bitcoin.py: " Peter Korsgaard
` (26 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:47 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_audit.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_audit.py b/support/testing/tests/package/test_audit.py
index f68a4b6831..722542a845 100644
--- a/support/testing/tests/package/test_audit.py
+++ b/support/testing/tests/package/test_audit.py
@@ -80,8 +80,7 @@ class TestAudit(infra.basetest.BRTest):
# normal user. This command is expected to fail (as only root
# can root is supposed to read this file).
cmd = f"su - {user} -c 'cat /etc/shadow'"
- _, ret = self.emulator.run(cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(cmd)
# Our last failed read attempt is supposed to have generated
# an event. We check we can see it in the log.
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 05/29] support/testing: test_bitcoin.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (2 preceding siblings ...)
2026-06-18 12:47 ` [Buildroot] [PATCH 04/29] support/testing: test_audit.py: " Peter Korsgaard
@ 2026-06-18 12:47 ` Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 06/29] support/testing: test_connman.py: " Peter Korsgaard
` (25 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:47 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_bitcoin.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_bitcoin.py b/support/testing/tests/package/test_bitcoin.py
index 186240b280..9a7d78e5e8 100644
--- a/support/testing/tests/package/test_bitcoin.py
+++ b/support/testing/tests/package/test_bitcoin.py
@@ -108,8 +108,7 @@ class TestBitcoin(infra.basetest.BRTest):
# The bitcoin daemon is not started. A client ping is expected
# to fail.
ping_cmd = f"{self.cli_cmd} ping"
- _, ret = self.emulator.run(ping_cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(ping_cmd)
# Start the daemon.
cmd = f"bitcoind -regtest -daemonwait -fallbackfee={btc_fee:f}"
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 06/29] support/testing: test_connman.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (3 preceding siblings ...)
2026-06-18 12:47 ` [Buildroot] [PATCH 05/29] support/testing: test_bitcoin.py: " Peter Korsgaard
@ 2026-06-18 12:47 ` Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 07/29] support/testing: test_cryptsetup.py: " Peter Korsgaard
` (24 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:47 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_connman.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_connman.py b/support/testing/tests/package/test_connman.py
index 6fef95104c..2e53135208 100644
--- a/support/testing/tests/package/test_connman.py
+++ b/support/testing/tests/package/test_connman.py
@@ -47,8 +47,7 @@ class TestConnMan(infra.basetest.BRTest):
# If we try to ping again the qemu gateway,
# it should now fail.
- _, ret = self.emulator.run(ping_cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(ping_cmd)
# We ask connman to re-enable Ethernet.
self.assertRunOk("connmanctl enable ethernet")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 07/29] support/testing: test_cryptsetup.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (4 preceding siblings ...)
2026-06-18 12:47 ` [Buildroot] [PATCH 06/29] support/testing: test_connman.py: " Peter Korsgaard
@ 2026-06-18 12:47 ` Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 08/29] support/testing: test_ddrescue.py: " Peter Korsgaard
` (23 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:47 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_cryptsetup.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/support/testing/tests/package/test_cryptsetup.py b/support/testing/tests/package/test_cryptsetup.py
index e409ea93e6..32a65210b5 100644
--- a/support/testing/tests/package/test_cryptsetup.py
+++ b/support/testing/tests/package/test_cryptsetup.py
@@ -65,8 +65,7 @@ class TestCryptSetup(infra.basetest.BRTest):
# Check the device is NOT detected as a LUKS volume, because
# it is not formatted yet.
is_luks_cmd = f"cryptsetup isLuks {dev}"
- _, ret = self.emulator.run(is_luks_cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(is_luks_cmd)
# Format the LUKS volume.
cmd = f"echo {passkey} | cryptsetup luksFormat {dev}"
@@ -110,15 +109,13 @@ class TestCryptSetup(infra.basetest.BRTest):
# We are NOT supposed to find our plain text message on the
# encrypted storage device.
- _, ret = self.emulator.run(f"grep -Fq '{msg}' {dev}", timeout=10)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(f"grep -Fq '{msg}' {dev}", timeout=10)
# Try to open LUKS volume with a wrong password. This is
# expected to fail.
cmd = f"echo 'Wrong{passkey}' | "
cmd += f"cryptsetup open --type luks {dev} {dm_name}"
- _, ret = self.emulator.run(cmd, timeout=10)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(cmd, timeout=10)
# Check the device-mapper device was NOT created (since we
# tried to open it with a wrong password).
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 08/29] support/testing: test_ddrescue.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (5 preceding siblings ...)
2026-06-18 12:47 ` [Buildroot] [PATCH 07/29] support/testing: test_cryptsetup.py: " Peter Korsgaard
@ 2026-06-18 12:47 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 09/29] support/testing: test_dos2unix.py: " Peter Korsgaard
` (22 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:47 UTC (permalink / raw)
To: buildroot
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_ddrescue.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_ddrescue.py b/support/testing/tests/package/test_ddrescue.py
index bd34694737..e7e71fefda 100644
--- a/support/testing/tests/package/test_ddrescue.py
+++ b/support/testing/tests/package/test_ddrescue.py
@@ -70,8 +70,7 @@ class TestDdrescue(infra.basetest.BRTest):
# A normal 'dd' is expected to fail with I/O error
cmd = f"dd if={dm_dev} of=/dev/null bs=512"
- _, exit_code = self.emulator.run(cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(cmd)
# Where a normal 'dd' fails, 'ddrescue' is expected to succeed
self.assertRunOk(f"ddrescue {dm_dev} {ddrescue_img}")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 09/29] support/testing: test_dos2unix.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (6 preceding siblings ...)
2026-06-18 12:47 ` [Buildroot] [PATCH 08/29] support/testing: test_ddrescue.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 10/29] support/testing: test_fping.py: " Peter Korsgaard
` (21 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_dos2unix.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_dos2unix.py b/support/testing/tests/package/test_dos2unix.py
index af5850ae3e..1c0ecf5967 100644
--- a/support/testing/tests/package/test_dos2unix.py
+++ b/support/testing/tests/package/test_dos2unix.py
@@ -32,8 +32,7 @@ class TestDos2Unix(infra.basetest.BRTest):
self.assertRunOk("unix2dos -n original.txt dos.txt")
# DOS file is expected to be different than the UNIX file
- _, exit_code = self.emulator.run("cmp original.txt dos.txt")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk("cmp original.txt dos.txt")
# The "cat -A" command should print '^M$' for CR-LF
self.assertRunOk("cat -A dos.txt | grep -Fq '^M$'")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 10/29] support/testing: test_fping.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (7 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 09/29] support/testing: test_dos2unix.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 11/29] support/testing: test_gnupg2.py: " Peter Korsgaard
` (20 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_fping.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_fping.py b/support/testing/tests/package/test_fping.py
index 507c4ce73b..e8aba653f1 100644
--- a/support/testing/tests/package/test_fping.py
+++ b/support/testing/tests/package/test_fping.py
@@ -41,5 +41,4 @@ class TestFping(infra.basetest.BRTest):
self.assertRunOk("ip route add to prohibit 192.168.12.0/24")
# We expect fping to fail when pinging the prohibited network.
- _, ret = self.emulator.run("fping 192.168.12.34")
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk("fping 192.168.12.34")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 11/29] support/testing: test_gnupg2.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (8 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 10/29] support/testing: test_fping.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 12/29] support/testing: test_iproute2.py: " Peter Korsgaard
` (19 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_gnupg2.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/support/testing/tests/package/test_gnupg2.py b/support/testing/tests/package/test_gnupg2.py
index 2b18f54fa3..6f862c31ce 100644
--- a/support/testing/tests/package/test_gnupg2.py
+++ b/support/testing/tests/package/test_gnupg2.py
@@ -49,8 +49,7 @@ class TestGnupg2(infra.basetest.BRTest):
# Test a failed decrypt with a bad password
cmd = "gpg --batch --decrypt"
cmd += " --passphrase 'A-Bad-Password' {}".format(gpg_file)
- _, exit_code = self.emulator.run(cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(cmd)
# Test the generation of an asymmetric key
cmd = "gpg --batch --passphrase ''"
@@ -106,9 +105,7 @@ class TestGnupg2(infra.basetest.BRTest):
self.assertRunOk(cmd)
cmd = "gpg --verify {}".format(sig_file)
- _, exit_code = self.emulator.run(cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(cmd)
cmd = "gpg --armor --verify {}".format(asc_file)
- _, exit_code = self.emulator.run(cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOK(cmd)
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 12/29] support/testing: test_iproute2.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (9 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 11/29] support/testing: test_gnupg2.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 13/29] support/testing: test_iptables.py: " Peter Korsgaard
` (18 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_iproute2.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/support/testing/tests/package/test_iproute2.py b/support/testing/tests/package/test_iproute2.py
index 91d9006e23..78f8dc291e 100644
--- a/support/testing/tests/package/test_iproute2.py
+++ b/support/testing/tests/package/test_iproute2.py
@@ -46,8 +46,7 @@ class TestIpRoute2(infra.basetest.BRTest):
for addr in addrs:
self.assertRunOk(f"{ping_cmd} {addr}")
# ...but the IP outside is supposed to fail.
- _, ret = self.emulator.run(f"{ping_cmd} 127.1.2.3")
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(f"{ping_cmd} 127.1.2.3")
# We add a prohibited route.
self.assertRunOk("ip route add prohibit 127.0.1.0/24")
@@ -57,8 +56,7 @@ class TestIpRoute2(infra.basetest.BRTest):
# ...while the other IPs expected to fail.
addrs = ["127.0.1.2", "127.1.2.3"]
for addr in addrs:
- _, ret = self.emulator.run(f"{ping_cmd} {addr}")
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(f"{ping_cmd} {addr}")
# We should be able to see our prohibited route.
out, ret = self.emulator.run("ip route list")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 13/29] support/testing: test_iptables.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (10 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 12/29] support/testing: test_iproute2.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 14/29] support/testing: test_jq.py: " Peter Korsgaard
` (17 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_iptables.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/support/testing/tests/package/test_iptables.py b/support/testing/tests/package/test_iptables.py
index 6e4db0ac06..72f2dd71a4 100644
--- a/support/testing/tests/package/test_iptables.py
+++ b/support/testing/tests/package/test_iptables.py
@@ -68,8 +68,7 @@ class TestIptables(infra.basetest.BRTest):
# A ping to 127.0.0.2 is expected to fail, because our rule is
# supposed to drop it.
ping_test_cmd = ping_cmd_prefix + "127.0.0.2"
- _, exit_code = self.emulator.run(ping_test_cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(ping_test_cmd)
# Save the current rules to test the init script later.
self.assertRunOk("/etc/init.d/S35iptables save")
@@ -85,8 +84,7 @@ class TestIptables(infra.basetest.BRTest):
self.assertRunOk("/etc/init.d/S35iptables start")
# Ping to 127.0.0.2 is expected to fail again.
- _, exit_code = self.emulator.run(ping_test_cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(ping_test_cmd)
# And flush the rules again.
self.assertRunOk("/etc/init.d/S35iptables stop")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 14/29] support/testing: test_jq.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (11 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 13/29] support/testing: test_iptables.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 15/29] support/testing: test_kmod.py: " Peter Korsgaard
` (16 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_jq.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_jq.py b/support/testing/tests/package/test_jq.py
index 67420abb6b..ffa284ce31 100644
--- a/support/testing/tests/package/test_jq.py
+++ b/support/testing/tests/package/test_jq.py
@@ -34,8 +34,7 @@ class TestJq(infra.basetest.BRTest):
# Check the execution fails on a non JSON file.
cmd = "jq -M '.' broken.json"
- _, ret = self.emulator.run(cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(cmd)
# Check an execution of a simple query. Note that output is a
# JSON (quoted) string.
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 15/29] support/testing: test_kmod.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (12 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 14/29] support/testing: test_jq.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 16/29] support/testing: test_libgpgme.py: " Peter Korsgaard
` (15 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_kmod.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/support/testing/tests/package/test_kmod.py b/support/testing/tests/package/test_kmod.py
index 3c06589b2b..a88257ef57 100644
--- a/support/testing/tests/package/test_kmod.py
+++ b/support/testing/tests/package/test_kmod.py
@@ -73,8 +73,7 @@ class TestKmod(infra.basetest.BRTest):
# With this test configuration, we are not supposed to have an
# eth0 Ethernet interface yet. Attempting to show info on this
# interface is expected to fail .
- _, ret = self.emulator.run("ip link show dev eth0")
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk("ip link show dev eth0")
# We try to load the module.
self.assertRunOk("modprobe virtio-net")
@@ -101,5 +100,4 @@ class TestKmod(infra.basetest.BRTest):
# Now the driver is unloaded, we should no longer be able to
# ping the emulator.
- _, ret = self.emulator.run(ping_cmd)
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(ping_cmd)
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 16/29] support/testing: test_libgpgme.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (13 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 15/29] support/testing: test_kmod.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 17/29] support/testing: test_lsof.py: " Peter Korsgaard
` (14 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_libgpgme.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/support/testing/tests/package/test_libgpgme.py b/support/testing/tests/package/test_libgpgme.py
index b497891249..5d0ee34aa6 100644
--- a/support/testing/tests/package/test_libgpgme.py
+++ b/support/testing/tests/package/test_libgpgme.py
@@ -31,8 +31,7 @@ class TestLibGpgme(infra.basetest.BRTest):
# We did not create a gpg key yet. We should not be able to
# list our key.
gpgme_listkey = f"echo LISTKEYS | gpgme-tool | grep '{gpg_userid}'"
- _, exit_code = self.emulator.run(gpgme_listkey)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(gpgme_listkey)
# We now create our gpg key.
cmd = "gpg --batch --passphrase ''"
@@ -66,8 +65,7 @@ class TestLibGpgme(infra.basetest.BRTest):
# The output encrypted file is also expected to be different
# from the input plain text file.
- _, exit_code = self.emulator.run(f"cmp {plain_file} {enc_file}")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(f"cmp {plain_file} {enc_file}")
# We now decrypt the encrypted file using gpgme-tool commands.
gpgme_dec_cmds = [
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 17/29] support/testing: test_lsof.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (14 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 16/29] support/testing: test_libgpgme.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 18/29] support/testing: test_mariadb.py: " Peter Korsgaard
` (13 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_lsof.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_lsof.py b/support/testing/tests/package/test_lsof.py
index b0478dfbb7..336a951549 100644
--- a/support/testing/tests/package/test_lsof.py
+++ b/support/testing/tests/package/test_lsof.py
@@ -28,8 +28,7 @@ class TestLsof(infra.basetest.BRTest):
self.assertRunOk("lsof")
# Check lsof fails if requested file is not opened
- _, exit_code = self.emulator.run("lsof {}".format(test_file))
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk("lsof {}".format(test_file))
# Open the test file from the shell on descriptor 10
self.assertRunOk("exec 10> {}".format(test_file))
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 18/29] support/testing: test_mariadb.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (15 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 17/29] support/testing: test_lsof.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 19/29] support/testing: test_mtools.py: " Peter Korsgaard
` (12 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_mariadb.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_mariadb.py b/support/testing/tests/package/test_mariadb.py
index 67ae61c3e1..9ffe6aa3b3 100644
--- a/support/testing/tests/package/test_mariadb.py
+++ b/support/testing/tests/package/test_mariadb.py
@@ -179,8 +179,7 @@ class TestMariaDB(infra.basetest.BRTest):
self.assertRunOk("/etc/init.d/S97mysqld stop")
# Check the server is stopped.
- _, exit_code = self.emulator.run("mariadb-admin ping")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk("mariadb-admin ping")
# Restart the server.
self.assertRunOk("/etc/init.d/S97mysqld start")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 19/29] support/testing: test_mtools.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (16 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 18/29] support/testing: test_mariadb.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 20/29] support/testing: test_nftables.py: " Peter Korsgaard
` (11 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_mtools.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_mtools.py b/support/testing/tests/package/test_mtools.py
index 23ec08b6d6..8fc8766207 100644
--- a/support/testing/tests/package/test_mtools.py
+++ b/support/testing/tests/package/test_mtools.py
@@ -29,8 +29,7 @@ class TestMtools(infra.basetest.BRTest):
# Any Mtools command is expected to fail on an unformatted
# partition.
cmd = f"minfo {mtools_opts} ::"
- _, exit_code = self.emulator.run(cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(cmd)
# Now, let's format the partition file to FAT
self.assertRunOk(f"mformat {mtools_opts} ::")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 20/29] support/testing: test_nftables.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (17 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 19/29] support/testing: test_mtools.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 21:24 ` Fiona Klute via buildroot
2026-06-18 12:48 ` [Buildroot] [PATCH 21/29] support/testing: test_octave.py: " Peter Korsgaard
` (10 subsequent siblings)
29 siblings, 1 reply; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain, Fiona Klute
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_nftables.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/support/testing/tests/package/test_nftables.py b/support/testing/tests/package/test_nftables.py
index 2622c7e822..62e14d5d35 100644
--- a/support/testing/tests/package/test_nftables.py
+++ b/support/testing/tests/package/test_nftables.py
@@ -69,8 +69,7 @@ class TestNftables(infra.basetest.BRTest):
# A ping to 127.0.0.2 is expected to fail, because our rule is
# supposed to drop it.
ping_test_cmd = ping_cmd_prefix + "127.0.0.2"
- _, exit_code = self.emulator.run(ping_test_cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(ping_test_cmd)
# We completely delete the table. This should also delete the
# chain and the rule.
@@ -128,8 +127,7 @@ class TestNftablesInit(TestNftables):
# should allow ping to 127.0.0.1, but not 127.0.0.2.
ping_cmd_prefix = "ping -c 3 -i 0.5 -W 2 "
self.assertRunOk(ping_cmd_prefix + "127.0.0.1")
- _, exit_code = self.emulator.run(ping_cmd_prefix + "127.0.0.2")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(ping_cmd_prefix + "127.0.0.2")
# Stop should flush the rules, ping to both addresses should
# work now.
@@ -140,5 +138,4 @@ class TestNftablesInit(TestNftables):
# Start is essentially the same as reload, check that
# 127.0.0.2 gets blocked again.
self.assertRunOk("/etc/init.d/S35nftables start")
- _, exit_code = self.emulator.run(ping_cmd_prefix + "127.0.0.2")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(ping_cmd_prefix + "127.0.0.2")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* Re: [Buildroot] [PATCH 20/29] support/testing: test_nftables.py: use assertRunNotOk()
2026-06-18 12:48 ` [Buildroot] [PATCH 20/29] support/testing: test_nftables.py: " Peter Korsgaard
@ 2026-06-18 21:24 ` Fiona Klute via buildroot
0 siblings, 0 replies; 32+ messages in thread
From: Fiona Klute via buildroot @ 2026-06-18 21:24 UTC (permalink / raw)
To: Peter Korsgaard, buildroot; +Cc: Julien Olivain
Am 18.06.26 um 14:48 schrieb Peter Korsgaard:
> Use the helper to simplify the test.
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Acked-by: Fiona Klute <fiona.klute@gmx.de>
> ---
> support/testing/tests/package/test_nftables.py | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/support/testing/tests/package/test_nftables.py b/support/testing/tests/package/test_nftables.py
> index 2622c7e822..62e14d5d35 100644
> --- a/support/testing/tests/package/test_nftables.py
> +++ b/support/testing/tests/package/test_nftables.py
> @@ -69,8 +69,7 @@ class TestNftables(infra.basetest.BRTest):
> # A ping to 127.0.0.2 is expected to fail, because our rule is
> # supposed to drop it.
> ping_test_cmd = ping_cmd_prefix + "127.0.0.2"
> - _, exit_code = self.emulator.run(ping_test_cmd)
> - self.assertNotEqual(exit_code, 0)
> + self.assertRunNotOk(ping_test_cmd)
>
> # We completely delete the table. This should also delete the
> # chain and the rule.
> @@ -128,8 +127,7 @@ class TestNftablesInit(TestNftables):
> # should allow ping to 127.0.0.1, but not 127.0.0.2.
> ping_cmd_prefix = "ping -c 3 -i 0.5 -W 2 "
> self.assertRunOk(ping_cmd_prefix + "127.0.0.1")
> - _, exit_code = self.emulator.run(ping_cmd_prefix + "127.0.0.2")
> - self.assertNotEqual(exit_code, 0)
> + self.assertRunNotOk(ping_cmd_prefix + "127.0.0.2")
>
> # Stop should flush the rules, ping to both addresses should
> # work now.
> @@ -140,5 +138,4 @@ class TestNftablesInit(TestNftables):
> # Start is essentially the same as reload, check that
> # 127.0.0.2 gets blocked again.
> self.assertRunOk("/etc/init.d/S35nftables start")
> - _, exit_code = self.emulator.run(ping_cmd_prefix + "127.0.0.2")
> - self.assertNotEqual(exit_code, 0)
> + self.assertRunNotOk(ping_cmd_prefix + "127.0.0.2")
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Buildroot] [PATCH 21/29] support/testing: test_octave.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (18 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 20/29] support/testing: test_nftables.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 22/29] support/testing: test_polkit.py: use assertRun{, Not}Ok() Peter Korsgaard
` (9 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_octave.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_octave.py b/support/testing/tests/package/test_octave.py
index 5c0b26a5fd..ef6516939e 100644
--- a/support/testing/tests/package/test_octave.py
+++ b/support/testing/tests/package/test_octave.py
@@ -51,8 +51,7 @@ class TestOctave(infra.basetest.BRTest):
# Check octave can fail
cmd = self.octave_cmd("assert(false)")
- _, exit_code = self.emulator.run(cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(cmd)
# Check string output
string = "Hello World"
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 22/29] support/testing: test_polkit.py: use assertRun{, Not}Ok()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (19 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 21/29] support/testing: test_octave.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 23/29] support/testing: test_postgresql.py: use assertRunNotOk() Peter Korsgaard
` (8 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot
Use the helpers to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_polkit.py | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/support/testing/tests/package/test_polkit.py b/support/testing/tests/package/test_polkit.py
index 3414fd5159..8ff02d91df 100644
--- a/support/testing/tests/package/test_polkit.py
+++ b/support/testing/tests/package/test_polkit.py
@@ -43,20 +43,16 @@ class TestPolkitSystemd(TestPolkitInfra):
rule_file = "systemd-timesyncd-restart.rules"
for rule_path in TestPolkitInfra.rule_paths:
cmd = "su brtest -c '/bin/systemctl restart systemd-timesyncd.service'"
- _, exit_code = self.emulator.run(cmd, 10)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(cmd, 10)
cmd = "cp /root/{file} {path}".format(file=rule_file, path=rule_path)
- _, exit_code = self.emulator.run(cmd, 10)
- self.assertEqual(exit_code, 0)
+ self.assertRunOk(cmd, 10)
cmd = "su brtest -c '/bin/systemctl restart systemd-timesyncd.service'"
- _, exit_code = self.emulator.run(cmd, 10)
- self.assertEqual(exit_code, 0)
+ self.assertRunOk(cmd, 10)
cmd = "rm {path}/{file}".format(file=rule_file, path=rule_path)
- _, exit_code = self.emulator.run(cmd, 10)
- self.assertEqual(exit_code, 0)
+ self.assertRunOk(cmd, 10)
class TestPolkitInitd(TestPolkitInfra):
@@ -73,8 +69,7 @@ class TestPolkitInitd(TestPolkitInfra):
self.assertEqual(output[0], "Error executing command as another user: Not authorized")
cmd = "cp /root/{file} {path}/{file}".format(file=rule_file, path=rule_path)
- _, exit_code = self.emulator.run(cmd, 10)
- self.assertEqual(exit_code, 0)
+ self.assertRunOk(cmd, 10)
cmd = "su brtest -c 'pkexec hello-polkit'"
output, exit_code = self.emulator.run(cmd, 10)
@@ -82,5 +77,4 @@ class TestPolkitInitd(TestPolkitInfra):
self.assertEqual(output[0], "Hello polkit!")
cmd = "rm {path}/{file}".format(file=rule_file, path=rule_path)
- _, exit_code = self.emulator.run(cmd, 10)
- self.assertEqual(exit_code, 0)
+ self.assertRunOk(cmd, 10)
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 23/29] support/testing: test_postgresql.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (20 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 22/29] support/testing: test_polkit.py: use assertRun{, Not}Ok() Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 24/29] support/testing: test_rasdaemon.py: " Peter Korsgaard
` (7 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_postgresql.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_postgresql.py b/support/testing/tests/package/test_postgresql.py
index bd41fc3f1b..08926b0ffc 100644
--- a/support/testing/tests/package/test_postgresql.py
+++ b/support/testing/tests/package/test_postgresql.py
@@ -180,8 +180,7 @@ class TestPostgreSQL(infra.basetest.BRTest):
self.assertRunOk(cmd)
# Check the server is no longer ready.
- _, exit_code = self.emulator.run("pg_isready")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk("pg_isready")
# Restart the server.
cmd = f"su - {self.db_admin} -c 'pg_ctl start -D {self.pgdata_dir}'"
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 24/29] support/testing: test_rasdaemon.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (21 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 23/29] support/testing: test_postgresql.py: use assertRunNotOk() Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 25/29] support/testing: test_screen.py: " Peter Korsgaard
` (6 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Bastien Curutchet
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_rasdaemon.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_rasdaemon.py b/support/testing/tests/package/test_rasdaemon.py
index ec29f1785b..2ae6fd2c28 100644
--- a/support/testing/tests/package/test_rasdaemon.py
+++ b/support/testing/tests/package/test_rasdaemon.py
@@ -43,5 +43,4 @@ class TestRasdaemon(infra.basetest.BRTest):
self.assertRunOk("/etc/init.d/S95rasdaemon restart")
self.assertRunOk("pidof /usr/sbin/rasdaemon")
self.assertRunOk("/etc/init.d/S95rasdaemon stop")
- _, ret = self.emulator.run("pidof /usr/sbin/rasdaemon")
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk("pidof /usr/sbin/rasdaemon")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 25/29] support/testing: test_screen.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (22 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 24/29] support/testing: test_rasdaemon.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 26/29] support/testing: test_swipl.py: " Peter Korsgaard
` (5 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_screen.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/support/testing/tests/package/test_screen.py b/support/testing/tests/package/test_screen.py
index b6264d34df..977aa5b59a 100644
--- a/support/testing/tests/package/test_screen.py
+++ b/support/testing/tests/package/test_screen.py
@@ -27,8 +27,7 @@ class TestScreen(infra.basetest.BRTest):
# There is no "screen" running yet. Listing sessions is
# expected to fail.
- _, exit_code = self.emulator.run("screen -ls")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk("screen -ls")
# We now start a detached and named session.
self.assertRunOk(f"screen -dmS {session_name}")
@@ -57,5 +56,4 @@ class TestScreen(infra.basetest.BRTest):
# Since the session is supposed to be terminated, listing
# sessions is expected to fail (again).
- _, exit_code = self.emulator.run("screen -ls")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk("screen -ls")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 26/29] support/testing: test_swipl.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (23 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 25/29] support/testing: test_screen.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 27/29] support/testing: test_usbip.py: " Peter Korsgaard
` (4 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_swipl.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_swipl.py b/support/testing/tests/package/test_swipl.py
index 0f317bb617..4005e02e5b 100644
--- a/support/testing/tests/package/test_swipl.py
+++ b/support/testing/tests/package/test_swipl.py
@@ -27,8 +27,7 @@ class TestSWIPL(infra.basetest.BRTest):
# Check swipl fails when goal is false.
cmd = "swipl -g false"
- _, exit_code = self.emulator.run(cmd)
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk(cmd)
# Test output.
string = "Hello Buildroot !"
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 27/29] support/testing: test_usbip.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (24 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 26/29] support/testing: test_swipl.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 28/29] support/testing: test_weston.py: " Peter Korsgaard
` (3 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_usbip.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_usbip.py b/support/testing/tests/package/test_usbip.py
index da94d6f92c..2fae8f7f6a 100644
--- a/support/testing/tests/package/test_usbip.py
+++ b/support/testing/tests/package/test_usbip.py
@@ -56,8 +56,7 @@ class TestUsbIp(infra.basetest.BRTest):
# The daemon is not running yet. Listing remote devices is
# expected to fail.
- _, ret = self.emulator.run("usbip list --remote=127.0.0.1")
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk("usbip list --remote=127.0.0.1")
# We start the USBIP daemon.
self.assertRunOk("usbipd -D")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 28/29] support/testing: test_weston.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (25 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 27/29] support/testing: test_usbip.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 29/29] support/testing: test_which.py: " Peter Korsgaard
` (2 subsequent siblings)
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_weston.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_weston.py b/support/testing/tests/package/test_weston.py
index c8b243a6a7..737015f8c4 100644
--- a/support/testing/tests/package/test_weston.py
+++ b/support/testing/tests/package/test_weston.py
@@ -150,5 +150,4 @@ class TestWeston(infra.basetest.BRTest, GraphicsBase):
# Now weston is supposed to be stopped,
# a simple client is expected to fail.
- _, exit_code = self.emulator.run("wayland-info")
- self.assertNotEqual(exit_code, 0)
+ self.assertRunNotOk("wayland-info")
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* [Buildroot] [PATCH 29/29] support/testing: test_which.py: use assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (26 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 28/29] support/testing: test_weston.py: " Peter Korsgaard
@ 2026-06-18 12:48 ` Peter Korsgaard
2026-06-18 21:23 ` [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Fiona Klute via buildroot
2026-06-19 9:02 ` Peter Korsgaard
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-18 12:48 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
Use the helper to simplify the test.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
support/testing/tests/package/test_which.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/support/testing/tests/package/test_which.py b/support/testing/tests/package/test_which.py
index 38f528aa7f..05ed56ccb4 100644
--- a/support/testing/tests/package/test_which.py
+++ b/support/testing/tests/package/test_which.py
@@ -33,8 +33,7 @@ class TestWhich(infra.basetest.BRTest):
# We check "which" returns an error when the program is not
# found.
- _, ret = self.emulator.run(f"which {alias_name}")
- self.assertNotEqual(ret, 0)
+ self.assertRunNotOk(f"which {alias_name}")
# We define a shell alias.
alias_cmd = "/bin/true"
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 32+ messages in thread* Re: [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (27 preceding siblings ...)
2026-06-18 12:48 ` [Buildroot] [PATCH 29/29] support/testing: test_which.py: " Peter Korsgaard
@ 2026-06-18 21:23 ` Fiona Klute via buildroot
2026-06-19 9:02 ` Peter Korsgaard
29 siblings, 0 replies; 32+ messages in thread
From: Fiona Klute via buildroot @ 2026-06-18 21:23 UTC (permalink / raw)
To: Peter Korsgaard, buildroot; +Cc: Ricardo Martincoski
Am 18.06.26 um 14:47 schrieb Peter Korsgaard:
> There are a number of runtime tests that checks that a command fails as
> expected, so add an assertRunNotOk() similar to the existing assertRunOk()
> to handle that instead of open coding it everywhere.
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Looks good to me!
Reviewed-by: Fiona Klute <fiona.klute@gmx.de>
> ---
> support/testing/infra/basetest.py | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py
> index 5fa902a77f..9b3eef6fa8 100644
> --- a/support/testing/infra/basetest.py
> +++ b/support/testing/infra/basetest.py
> @@ -150,3 +150,14 @@ class BRTest(BRConfigTest):
> 0,
> "\nFailed to run: {}\noutput was:\n{}".format(cmd, ' '+'\n '.join(out))
> )
> +
> + # Run the given 'cmd' with a 'timeout' on the target and
> + # assert that the command fails; on success, print the
> + # faulty command and its output
> + def assertRunNotOk(self, cmd, timeout=-1):
> + out, exit_code = self.emulator.run(cmd, timeout)
> + self.assertNotEqual(
> + exit_code,
> + 0,
> + "\nUnexpected success: {}\noutput was:\n{}".format(cmd, ' '+'\n '.join(out))
> + )
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk()
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
` (28 preceding siblings ...)
2026-06-18 21:23 ` [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Fiona Klute via buildroot
@ 2026-06-19 9:02 ` Peter Korsgaard
29 siblings, 0 replies; 32+ messages in thread
From: Peter Korsgaard @ 2026-06-19 9:02 UTC (permalink / raw)
To: buildroot; +Cc: Ricardo Martincoski
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
> There are a number of runtime tests that checks that a command fails as
> expected, so add an assertRunNotOk() similar to the existing assertRunOk()
> to handle that instead of open coding it everywhere.
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Committed series, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 32+ messages in thread