test: case: bridge_*: Use standard ping tests

This commit is contained in:
Tobias Waldekranz
2024-05-17 23:14:42 +02:00
parent 9e7e30ccb0
commit 77923d4f75
4 changed files with 9 additions and 49 deletions
+2 -12
View File
@@ -46,17 +46,7 @@ with infamy.Test() as test:
_, hport = env.ltop.xlate("host", "data")
with infamy.IsolatedMacVlan(hport) as ns:
pingtest = ns.runsh("""
set -ex
ip link set iface up
ip addr add 10.0.0.1/24 dev iface
ping -c1 -w5 10.0.0.2 || exit 1
""")
if pingtest.returncode:
print(pingtest.stdout)
test.fail()
ns.addip("10.0.0.1")
ns.must_reach("10.0.0.2")
test.succeed()
+2 -12
View File
@@ -65,17 +65,7 @@ with infamy.Test() as test:
_, hport = env.ltop.xlate("host", "data")
with infamy.IsolatedMacVlan(hport) as ns:
pingtest = ns.runsh("""
set -ex
ip link set iface up
ip addr add 10.0.0.1/24 dev iface
ping -c1 -w10 10.0.0.2 || exit 1
""")
if pingtest.returncode:
print(pingtest.stdout)
test.fail()
ns.addip("10.0.0.1")
ns.must_reach("10.0.0.2")
test.succeed()
+3 -13
View File
@@ -117,18 +117,8 @@ with infamy.Test() as test:
_, hport = env.ltop.xlate("host", "data1")
with infamy.IsolatedMacVlan(hport) as ns:
pingtest = ns.runsh("""
set -ex
ip link set iface up
ip addr add 10.0.0.1/24 dev iface
ping -c1 -w5 10.0.0.2 || exit 1
ping -c1 -w5 10.0.0.3 || exit 1
""")
if pingtest.returncode:
print(pingtest.stdout)
test.fail()
ns.addip("10.0.0.1")
ns.must_reach("10.0.0.2")
ns.must_reach("10.0.0.3")
test.succeed()
+2 -12
View File
@@ -73,17 +73,7 @@ with infamy.Test() as test:
_, hport = env.ltop.xlate("host", "data")
with infamy.IsolatedMacVlan(hport) as ns:
pingtest = ns.runsh("""
set -ex
ip link set iface up
ip addr add 10.0.0.1/24 dev iface
ping -c1 -w10 10.0.0.2 || exit 1
""")
if pingtest.returncode:
print(pingtest.stdout)
test.fail()
ns.addip("10.0.0.1")
ns.must_reach("10.0.0.2")
test.succeed()