]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: improve example munet test
authorChristian Hopps <chopps@labn.net>
Tue, 3 Sep 2024 04:40:01 +0000 (00:40 -0400)
committerChristian Hopps <chopps@labn.net>
Tue, 3 Sep 2024 04:45:55 +0000 (00:45 -0400)
Signed-off-by: Christian Hopps <chopps@labn.net>
tests/topotests/example_munet/r1/frr.conf
tests/topotests/example_munet/r2/frr.conf
tests/topotests/example_munet/r3/frr.conf
tests/topotests/example_munet/test_munet.py

index 468bda5e0101e2aa3a280fb67f46f2b4a1c1d112..692e4ceb47249410a555c31d67a89ee462a09bc3 100644 (file)
@@ -4,4 +4,4 @@ service integrated-vtysh-config
 interface eth0
  ip address 10.0.1.1/24
 
-ip route 10.0.0.0/8 blackhole
+ip route 10.0.2.0/24 10.0.1.2
index 77d9892485d3c9b554087aa2b65503b17848f2c1..da3f15b80111c72801710e8f8e03128a819aea9a 100644 (file)
@@ -5,6 +5,4 @@ interface eth0
  ip address 10.0.1.2/24
 
 interface eth1
- ip address 10.0.2.2/24
-
-ip route 10.0.0.0/8 blackhole
+ ip address 10.0.2.2/24
\ No newline at end of file
index e0839e6d8a9ae9bd3455a69fd517b6f1b61f1828..84527b34df0aa0d81636c57349b4807d96fdcfb5 100644 (file)
@@ -4,4 +4,4 @@ service integrated-vtysh-config
 interface eth0
  ip address 10.0.2.3/24
 
-ip route 10.0.0.0/8 blackhole
+ip route 10.0.1.0/24 10.0.2.2
\ No newline at end of file
index 0d9599fa541d762d75c723701f9abede00b7a625..71052099c4ea9ca7c08dda822fc5fdcc031bed56 100644 (file)
@@ -5,6 +5,22 @@
 #
 # Copyright (c) 2023, LabN Consulting, L.L.C.
 #
+from munet.testing.util import retry
+
+
+@retry(retry_timeout=10)
+def wait_for_route(r, p):
+    o = r.cmd_raises(f"ip route show {p}")
+    assert p in o
+
+
 async def test_native_test(unet):
-    o = unet.hosts["r1"].cmd_nostatus("ip addr")
+    r1 = unet.hosts["r1"]
+    o = r1.cmd_nostatus("ip addr")
     print(o)
+
+    wait_for_route(r1, "10.0.2.0/24")
+
+    r1.cmd_raises("ping -c1 10.0.1.2")
+    r1.cmd_raises("ping -c1 10.0.2.2")
+    r1.cmd_raises("ping -c1 10.0.2.3")