From 685197182f069c83294787731667b270d783421f Mon Sep 17 00:00:00 2001 From: "wumu.zsl" Date: Mon, 6 Jan 2025 12:14:09 +0000 Subject: [PATCH] add basic topotest cases for sbfd Initiator and Reflector Signed-off-by: wumu.zsl --- tests/topotests/sbfd_topo1/__init__.py | 0 tests/topotests/sbfd_topo1/r1/bfdd.conf | 7 + tests/topotests/sbfd_topo1/r1/zebra.conf | 7 + tests/topotests/sbfd_topo1/r2/bfdd.conf | 7 + tests/topotests/sbfd_topo1/r2/zebra.conf | 7 + tests/topotests/sbfd_topo1/sbfd_topo1.dot | 45 ++++ tests/topotests/sbfd_topo1/test_sbfd_topo1.py | 217 ++++++++++++++++++ 7 files changed, 290 insertions(+) create mode 100644 tests/topotests/sbfd_topo1/__init__.py create mode 100644 tests/topotests/sbfd_topo1/r1/bfdd.conf create mode 100644 tests/topotests/sbfd_topo1/r1/zebra.conf create mode 100644 tests/topotests/sbfd_topo1/r2/bfdd.conf create mode 100644 tests/topotests/sbfd_topo1/r2/zebra.conf create mode 100644 tests/topotests/sbfd_topo1/sbfd_topo1.dot create mode 100644 tests/topotests/sbfd_topo1/test_sbfd_topo1.py diff --git a/tests/topotests/sbfd_topo1/__init__.py b/tests/topotests/sbfd_topo1/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/sbfd_topo1/r1/bfdd.conf b/tests/topotests/sbfd_topo1/r1/bfdd.conf new file mode 100644 index 000000000000..437f063d8f1a --- /dev/null +++ b/tests/topotests/sbfd_topo1/r1/bfdd.conf @@ -0,0 +1,7 @@ +! +debug bfd network +debug bfd peer +debug bfd zebra +! +bfd +! diff --git a/tests/topotests/sbfd_topo1/r1/zebra.conf b/tests/topotests/sbfd_topo1/r1/zebra.conf new file mode 100644 index 000000000000..5f19bd87aa2a --- /dev/null +++ b/tests/topotests/sbfd_topo1/r1/zebra.conf @@ -0,0 +1,7 @@ +ip forwarding +ipv6 forwarding +! + +interface r1-eth0 + ipv6 address 2001::10/64 +! diff --git a/tests/topotests/sbfd_topo1/r2/bfdd.conf b/tests/topotests/sbfd_topo1/r2/bfdd.conf new file mode 100644 index 000000000000..437f063d8f1a --- /dev/null +++ b/tests/topotests/sbfd_topo1/r2/bfdd.conf @@ -0,0 +1,7 @@ +! +debug bfd network +debug bfd peer +debug bfd zebra +! +bfd +! diff --git a/tests/topotests/sbfd_topo1/r2/zebra.conf b/tests/topotests/sbfd_topo1/r2/zebra.conf new file mode 100644 index 000000000000..0c6ee75f705d --- /dev/null +++ b/tests/topotests/sbfd_topo1/r2/zebra.conf @@ -0,0 +1,7 @@ +ip forwarding +ipv6 forwarding +! + +interface r2-eth0 + ipv6 address 2001::20/64 +! diff --git a/tests/topotests/sbfd_topo1/sbfd_topo1.dot b/tests/topotests/sbfd_topo1/sbfd_topo1.dot new file mode 100644 index 000000000000..437e8230ce20 --- /dev/null +++ b/tests/topotests/sbfd_topo1/sbfd_topo1.dot @@ -0,0 +1,45 @@ +## Color coding: +######################### +## Main FRR: #f08080 red +## Switches: #d0e0d0 gray +## RIP: #19e3d9 Cyan +## RIPng: #fcb314 dark yellow +## OSPFv2: #32b835 Green +## OSPFv3: #19e3d9 Cyan +## ISIS IPv4 #fcb314 dark yellow +## ISIS IPv6 #9a81ec purple +## BGP IPv4 #eee3d3 beige +## BGP IPv6 #fdff00 yellow +##### Colors (see http://www.color-hex.com/) + +graph template { + label="template"; + + # Routers + r1 [ + shape=doubleoctagon, + label="A\nAS 100\n1.1.1.1", + fillcolor="#f08080", + style=filled, + ]; + r2 [ + shape=doubleoctagon + label="B\nAS 200\n1.1.1.2", + fillcolor="#f08080", + style=filled, + ]; + + # Switches + s1 [ + shape=oval, + label="s1\n192.168.0.0/24", + fillcolor="#d0e0d0", + style=filled, + ]; + + + # Connections + r1 -- s1 [label="A-eth0"]; + r2 -- s1 [label="B-eth0"]; + +} diff --git a/tests/topotests/sbfd_topo1/test_sbfd_topo1.py b/tests/topotests/sbfd_topo1/test_sbfd_topo1.py new file mode 100644 index 000000000000..0514b94efd13 --- /dev/null +++ b/tests/topotests/sbfd_topo1/test_sbfd_topo1.py @@ -0,0 +1,217 @@ +#!/usr/bin/env python + +# +#