summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-04-23 08:26:41 -0400
committerChristian Hopps <chopps@labn.net>2023-04-23 15:02:46 -0400
commita929d94ff545c80786c29a7949677ac8cbec4cef (patch)
tree5529651aec74706c72179ea5c08efe17d388a548
parent0def198cd3294bac381ce7905998bfe88aa08d05 (diff)
tests: add an example of using munet native config
Signed-off-by: Christian Hopps <chopps@labn.net>
-rw-r--r--tests/topotests/example_munet/munet.yaml17
-rw-r--r--tests/topotests/example_munet/r1/daemons6
-rw-r--r--tests/topotests/example_munet/r1/frr.conf7
-rw-r--r--tests/topotests/example_munet/r1/vtysh.conf1
-rw-r--r--tests/topotests/example_munet/r2/daemons6
-rw-r--r--tests/topotests/example_munet/r2/frr.conf10
-rw-r--r--tests/topotests/example_munet/r2/vtysh.conf1
-rw-r--r--tests/topotests/example_munet/r3/daemons6
-rw-r--r--tests/topotests/example_munet/r3/frr.conf7
-rw-r--r--tests/topotests/example_munet/r3/vtysh.conf1
-rw-r--r--tests/topotests/example_munet/test_munet.py10
-rw-r--r--tests/topotests/pytest.ini2
12 files changed, 73 insertions, 1 deletions
diff --git a/tests/topotests/example_munet/munet.yaml b/tests/topotests/example_munet/munet.yaml
new file mode 100644
index 0000000000..34e1470103
--- /dev/null
+++ b/tests/topotests/example_munet/munet.yaml
@@ -0,0 +1,17 @@
+version: 1
+topology:
+ ipv6-enable: true
+ networks-autonumber: true
+ networks:
+ - name: net1
+ - name: net2
+ nodes:
+ - name: r1
+ kind: frr
+ connections: ["net1"]
+ - name: r2
+ kind: frr
+ connections: ["net1", "net2"]
+ - name: r3
+ kind: frr
+ connections: ["net2"]
diff --git a/tests/topotests/example_munet/r1/daemons b/tests/topotests/example_munet/r1/daemons
new file mode 100644
index 0000000000..a454c95923
--- /dev/null
+++ b/tests/topotests/example_munet/r1/daemons
@@ -0,0 +1,6 @@
+zebra=1
+staticd=1
+vtysh_enable=1
+watchfrr_enable=1
+zebra_options="-d -F traditional --log=file:/var/log/frr/zebra.log"
+staticd_options="-d -F traditional --log=file:/var/log/frr/staticd.log"
diff --git a/tests/topotests/example_munet/r1/frr.conf b/tests/topotests/example_munet/r1/frr.conf
new file mode 100644
index 0000000000..468bda5e01
--- /dev/null
+++ b/tests/topotests/example_munet/r1/frr.conf
@@ -0,0 +1,7 @@
+log file /var/log/frr/frr.log
+service integrated-vtysh-config
+
+interface eth0
+ ip address 10.0.1.1/24
+
+ip route 10.0.0.0/8 blackhole
diff --git a/tests/topotests/example_munet/r1/vtysh.conf b/tests/topotests/example_munet/r1/vtysh.conf
new file mode 100644
index 0000000000..f863f560f1
--- /dev/null
+++ b/tests/topotests/example_munet/r1/vtysh.conf
@@ -0,0 +1 @@
+service integrated-vtysh-config \ No newline at end of file
diff --git a/tests/topotests/example_munet/r2/daemons b/tests/topotests/example_munet/r2/daemons
new file mode 100644
index 0000000000..a454c95923
--- /dev/null
+++ b/tests/topotests/example_munet/r2/daemons
@@ -0,0 +1,6 @@
+zebra=1
+staticd=1
+vtysh_enable=1
+watchfrr_enable=1
+zebra_options="-d -F traditional --log=file:/var/log/frr/zebra.log"
+staticd_options="-d -F traditional --log=file:/var/log/frr/staticd.log"
diff --git a/tests/topotests/example_munet/r2/frr.conf b/tests/topotests/example_munet/r2/frr.conf
new file mode 100644
index 0000000000..77d9892485
--- /dev/null
+++ b/tests/topotests/example_munet/r2/frr.conf
@@ -0,0 +1,10 @@
+log file /var/log/frr/frr.log
+service integrated-vtysh-config
+
+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
diff --git a/tests/topotests/example_munet/r2/vtysh.conf b/tests/topotests/example_munet/r2/vtysh.conf
new file mode 100644
index 0000000000..f863f560f1
--- /dev/null
+++ b/tests/topotests/example_munet/r2/vtysh.conf
@@ -0,0 +1 @@
+service integrated-vtysh-config \ No newline at end of file
diff --git a/tests/topotests/example_munet/r3/daemons b/tests/topotests/example_munet/r3/daemons
new file mode 100644
index 0000000000..a454c95923
--- /dev/null
+++ b/tests/topotests/example_munet/r3/daemons
@@ -0,0 +1,6 @@
+zebra=1
+staticd=1
+vtysh_enable=1
+watchfrr_enable=1
+zebra_options="-d -F traditional --log=file:/var/log/frr/zebra.log"
+staticd_options="-d -F traditional --log=file:/var/log/frr/staticd.log"
diff --git a/tests/topotests/example_munet/r3/frr.conf b/tests/topotests/example_munet/r3/frr.conf
new file mode 100644
index 0000000000..e0839e6d8a
--- /dev/null
+++ b/tests/topotests/example_munet/r3/frr.conf
@@ -0,0 +1,7 @@
+log file /var/log/frr/frr.log
+service integrated-vtysh-config
+
+interface eth0
+ ip address 10.0.2.3/24
+
+ip route 10.0.0.0/8 blackhole
diff --git a/tests/topotests/example_munet/r3/vtysh.conf b/tests/topotests/example_munet/r3/vtysh.conf
new file mode 100644
index 0000000000..f863f560f1
--- /dev/null
+++ b/tests/topotests/example_munet/r3/vtysh.conf
@@ -0,0 +1 @@
+service integrated-vtysh-config \ No newline at end of file
diff --git a/tests/topotests/example_munet/test_munet.py b/tests/topotests/example_munet/test_munet.py
new file mode 100644
index 0000000000..0d9599fa54
--- /dev/null
+++ b/tests/topotests/example_munet/test_munet.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# April 23 2023, Christian Hopps <chopps@labn.net>
+#
+# Copyright (c) 2023, LabN Consulting, L.L.C.
+#
+async def test_native_test(unet):
+ o = unet.hosts["r1"].cmd_nostatus("ip addr")
+ print(o)
diff --git a/tests/topotests/pytest.ini b/tests/topotests/pytest.ini
index 322c07025f..f779bf0a74 100644
--- a/tests/topotests/pytest.ini
+++ b/tests/topotests/pytest.ini
@@ -26,7 +26,7 @@ log_file_date_format = %Y-%m-%d %H:%M:%S
junit_logging = all
junit_log_passing_tests = true
-norecursedirs = .git example_test example_topojson_test lib munet docker
+norecursedirs = .git example_munet example_test example_topojson_test lib munet docker
# Directory to store test results and run logs in, default shown
# rundir = /tmp/topotests