From f3942975c49804cec7b2e5288cc9fba906dcafdc Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 18 Jun 2026 14:48:03 +0200 Subject: [PATCH] support/testing: test_iproute2.py: use assertRunNotOk() Use the helper to simplify the test. Signed-off-by: Peter Korsgaard --- 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")