]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: add an example of using munet native config
authorChristian Hopps <chopps@labn.net>
Sun, 23 Apr 2023 12:26:41 +0000 (08:26 -0400)
committerChristian Hopps <chopps@labn.net>
Sun, 23 Apr 2023 19:02:46 +0000 (15:02 -0400)
Signed-off-by: Christian Hopps <chopps@labn.net>
12 files changed:
tests/topotests/example_munet/munet.yaml [new file with mode: 0644]
tests/topotests/example_munet/r1/daemons [new file with mode: 0644]
tests/topotests/example_munet/r1/frr.conf [new file with mode: 0644]
tests/topotests/example_munet/r1/vtysh.conf [new file with mode: 0644]
tests/topotests/example_munet/r2/daemons [new file with mode: 0644]
tests/topotests/example_munet/r2/frr.conf [new file with mode: 0644]
tests/topotests/example_munet/r2/vtysh.conf [new file with mode: 0644]
tests/topotests/example_munet/r3/daemons [new file with mode: 0644]
tests/topotests/example_munet/r3/frr.conf [new file with mode: 0644]
tests/topotests/example_munet/r3/vtysh.conf [new file with mode: 0644]
tests/topotests/example_munet/test_munet.py [new file with mode: 0644]
tests/topotests/pytest.ini

diff --git a/tests/topotests/example_munet/munet.yaml b/tests/topotests/example_munet/munet.yaml
new file mode 100644 (file)
index 0000000..34e1470
--- /dev/null
@@ -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 (file)
index 0000000..a454c95
--- /dev/null
@@ -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 (file)
index 0000000..468bda5
--- /dev/null
@@ -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 (file)
index 0000000..f863f56
--- /dev/null
@@ -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 (file)
index 0000000..a454c95
--- /dev/null
@@ -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 (file)
index 0000000..77d9892
--- /dev/null
@@ -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 (file)
index 0000000..f863f56
--- /dev/null
@@ -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 (file)
index 0000000..a454c95
--- /dev/null
@@ -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 (file)
index 0000000..e0839e6
--- /dev/null
@@ -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 (file)
index 0000000..f863f56
--- /dev/null
@@ -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 (file)
index 0000000..0d9599f
--- /dev/null
@@ -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)
index 322c07025f906849aae5408c99be4accbae23e4b..f779bf0a74f74dab434393c6c648e285c4e4aed2 100644 (file)
@@ -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