summaryrefslogtreecommitdiffstats
path: root/tests/topotests/example_munet/test_munet.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/example_munet/test_munet.py')
-rw-r--r--tests/topotests/example_munet/test_munet.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/topotests/example_munet/test_munet.py b/tests/topotests/example_munet/test_munet.py
index 0d9599fa..71052099 100644
--- a/tests/topotests/example_munet/test_munet.py
+++ b/tests/topotests/example_munet/test_munet.py
@@ -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")