test: case: bridge_*: Use standard ping tests

This commit is contained in:
Tobias Waldekranz
2024-05-20 16:21:06 +02:00
parent 4c6dfdf600
commit dc6dffbff9
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()