mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-09 07:51:59 -09:00
support/testing: test_iproute2.py: use assertRunNotOk()
Use the helper to simplify the test. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user