From 33b216e16bcb53d3ab930aa8d4b6f1ee03c31d22 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 13:54:36 +0200 Subject: [PATCH 01/10] tests: fix prefix length in nhrp_redundancy The expected prefix should be 5.5.5.0/24 otherwise the hosts behind NHRP client 1 nhc1 (aka. r5) are not reachable via NHRP. The issue was not seen in the FRR official CI because the tests were skipped because iptables were missing in CI machines. It solves the 16690 issue. Fixes: https://github.com/FRRouting/frr/issues/16690 Signed-off-by: Louis Scalbert (cherry picked from commit cfb057ae3cc6573df87fa6dcfdeca03a099023eb) --- tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json b/tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json index f8efff2059..835dfd6b0f 100644 --- a/tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json +++ b/tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json @@ -1,7 +1,7 @@ { - "5.5.5.5\/32": [ + "5.5.5.0\/24": [ { - "prefix": "5.5.5.5\/32", + "prefix": "5.5.5.0\/24", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", From d600a9760896407bdb7c7332710db77265a0fc06 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 11:16:44 +0200 Subject: [PATCH 02/10] tests: rename routers in nhrp_redundancy Rename routers in nhrp_redundancy to match the diagram. Cosmetic change. > cd tests/topotests/nhrp_redundancy > git grep r1 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r1|nhs1|g' -i > git grep r2 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r2|nhs2|g' -i > git grep r3 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r3|nhs3|g' -i > git grep r4 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r4|nhc1|g' -i > git grep r5 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r5|nhc2|g' -i > git grep r6 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r6|router|g' -i > git grep r7 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r7|host|g' -i > > git grep R1 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R1|nhs1|g' -i > git grep R2 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R2|nhs2|g' -i > git grep R3 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R3|nhs3|g' -i > git grep R4 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R4|nhc1|g' -i > git grep R5 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R5|nhc2|g' -i > git grep R6 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R6|router|g' -i > git grep R7 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R7|host|g' -i > > mv r1 nhs1 > mv r2 nhs2 > mv r3 nhs3 > mv r4 nhc1 > mv r5 nhc2 > mv r6 router > mv r7 host Signed-off-by: Louis Scalbert (cherry picked from commit 3f49c5026c3f6ebc1583951f145b77d479abb834) --- .../nhrp_redundancy/{r7 => host}/zebra.conf | 2 +- .../{r4 => nhc1}/nhrp_cache.json | 8 +- .../{r5 => nhc1}/nhrp_route.json | 6 +- .../{r4 => nhc1}/nhrp_route_shortcut.json | 10 +- .../nhrp_redundancy/{r4 => nhc1}/nhrpd.conf | 4 +- .../nhrp_redundancy/{r4 => nhc1}/zebra.conf | 6 +- .../{r5 => nhc2}/nhrp_cache.json | 8 +- .../{r4 => nhc2}/nhrp_route.json | 6 +- .../nhrp_redundancy/{r5 => nhc2}/nhrpd.conf | 4 +- .../nhrp_redundancy/{r5 => nhc2}/zebra.conf | 6 +- .../{r1 => nhs1}/nhrp_cache.json | 6 +- .../{r3 => nhs1}/nhrp_route.json | 4 +- .../nhrp_redundancy/{r2 => nhs1}/nhrpd.conf | 4 +- .../nhrp_redundancy/{r1 => nhs1}/zebra.conf | 4 +- .../{r2 => nhs2}/nhrp_cache.json | 6 +- .../{r1 => nhs2}/nhrp_route.json | 4 +- .../nhrp_redundancy/{r3 => nhs2}/nhrpd.conf | 4 +- .../nhrp_redundancy/{r2 => nhs2}/zebra.conf | 4 +- .../{r3 => nhs3}/nhrp_cache.json | 6 +- .../{r2 => nhs3}/nhrp_route.json | 4 +- .../nhrp_redundancy/{r1 => nhs3}/nhrpd.conf | 4 +- .../nhrp_redundancy/{r3 => nhs3}/zebra.conf | 4 +- .../nhrp_redundancy/{r6 => router}/zebra.conf | 4 +- .../nhrp_redundancy/test_nhrp_redundancy.dot | 34 ++--- .../nhrp_redundancy/test_nhrp_redundancy.py | 121 +++++++++--------- 25 files changed, 133 insertions(+), 140 deletions(-) rename tests/topotests/nhrp_redundancy/{r7 => host}/zebra.conf (72%) rename tests/topotests/nhrp_redundancy/{r4 => nhc1}/nhrp_cache.json (88%) rename tests/topotests/nhrp_redundancy/{r5 => nhc1}/nhrp_route.json (92%) rename tests/topotests/nhrp_redundancy/{r4 => nhc1}/nhrp_route_shortcut.json (92%) rename tests/topotests/nhrp_redundancy/{r4 => nhc1}/nhrpd.conf (83%) rename tests/topotests/nhrp_redundancy/{r4 => nhc1}/zebra.conf (81%) rename tests/topotests/nhrp_redundancy/{r5 => nhc2}/nhrp_cache.json (88%) rename tests/topotests/nhrp_redundancy/{r4 => nhc2}/nhrp_route.json (92%) rename tests/topotests/nhrp_redundancy/{r5 => nhc2}/nhrpd.conf (83%) rename tests/topotests/nhrp_redundancy/{r5 => nhc2}/zebra.conf (81%) rename tests/topotests/nhrp_redundancy/{r1 => nhs1}/nhrp_cache.json (88%) rename tests/topotests/nhrp_redundancy/{r3 => nhs1}/nhrp_route.json (92%) rename tests/topotests/nhrp_redundancy/{r2 => nhs1}/nhrpd.conf (74%) rename tests/topotests/nhrp_redundancy/{r1 => nhs1}/zebra.conf (83%) rename tests/topotests/nhrp_redundancy/{r2 => nhs2}/nhrp_cache.json (88%) rename tests/topotests/nhrp_redundancy/{r1 => nhs2}/nhrp_route.json (92%) rename tests/topotests/nhrp_redundancy/{r3 => nhs2}/nhrpd.conf (74%) rename tests/topotests/nhrp_redundancy/{r2 => nhs2}/zebra.conf (83%) rename tests/topotests/nhrp_redundancy/{r3 => nhs3}/nhrp_cache.json (88%) rename tests/topotests/nhrp_redundancy/{r2 => nhs3}/nhrp_route.json (92%) rename tests/topotests/nhrp_redundancy/{r1 => nhs3}/nhrpd.conf (74%) rename tests/topotests/nhrp_redundancy/{r3 => nhs3}/zebra.conf (83%) rename tests/topotests/nhrp_redundancy/{r6 => router}/zebra.conf (63%) diff --git a/tests/topotests/nhrp_redundancy/r7/zebra.conf b/tests/topotests/nhrp_redundancy/host/zebra.conf similarity index 72% rename from tests/topotests/nhrp_redundancy/r7/zebra.conf rename to tests/topotests/nhrp_redundancy/host/zebra.conf index 5747b40956..58c8cb2c4b 100644 --- a/tests/topotests/nhrp_redundancy/r7/zebra.conf +++ b/tests/topotests/nhrp_redundancy/host/zebra.conf @@ -1,4 +1,4 @@ -interface r7-eth0 +interface host-eth0 ip address 4.4.4.7/24 ! ip route 0.0.0.0/0 4.4.4.4 diff --git a/tests/topotests/nhrp_redundancy/r4/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache.json similarity index 88% rename from tests/topotests/nhrp_redundancy/r4/nhrp_cache.json rename to tests/topotests/nhrp_redundancy/nhc1/nhrp_cache.json index f87ebcf5fc..5d2cf6fb5e 100644 --- a/tests/topotests/nhrp_redundancy/r4/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache.json @@ -4,7 +4,7 @@ }, "table": [ { - "interface": "r4-gre0", + "interface": "nhc1-gre0", "type": "nhs", "protocol": "176.16.1.2", "nbma": "192.168.1.2", @@ -15,7 +15,7 @@ "identity": "" }, { - "interface": "r4-gre0", + "interface": "nhc1-gre0", "type": "local", "protocol": "176.16.1.4", "nbma": "192.168.2.4", @@ -26,7 +26,7 @@ "identity": "-" }, { - "interface": "r4-gre0", + "interface": "nhc1-gre0", "type": "nhs", "protocol": "176.16.1.3", "nbma": "192.168.1.3", @@ -37,7 +37,7 @@ "identity": "" }, { - "interface": "r4-gre0", + "interface": "nhc1-gre0", "type": "nhs", "protocol": "176.16.1.1", "nbma": "192.168.1.1", diff --git a/tests/topotests/nhrp_redundancy/r5/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route.json similarity index 92% rename from tests/topotests/nhrp_redundancy/r5/nhrp_route.json rename to tests/topotests/nhrp_redundancy/nhc1/nhrp_route.json index 1d1c16ffb8..2af62dd4d6 100644 --- a/tests/topotests/nhrp_redundancy/r5/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route.json @@ -16,7 +16,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r5-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] @@ -39,7 +39,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r5-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] @@ -62,7 +62,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r5-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] diff --git a/tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut.json similarity index 92% rename from tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json rename to tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut.json index 835dfd6b0f..2111e27583 100644 --- a/tests/topotests/nhrp_redundancy/r4/nhrp_route_shortcut.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut.json @@ -17,7 +17,7 @@ "fib": true, "ip": "176.16.1.5", "afi": "ipv4", - "interfaceName": "r4-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] @@ -40,7 +40,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r4-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] @@ -63,7 +63,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r4-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] @@ -86,7 +86,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r4-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] @@ -109,7 +109,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r4-gre0", + "interfaceName": "nhc1-gre0", "active": true } ] diff --git a/tests/topotests/nhrp_redundancy/r4/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhc1/nhrpd.conf similarity index 83% rename from tests/topotests/nhrp_redundancy/r4/nhrpd.conf rename to tests/topotests/nhrp_redundancy/nhc1/nhrpd.conf index 8a52f3386e..a0862f77ef 100644 --- a/tests/topotests/nhrp_redundancy/r4/nhrpd.conf +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrpd.conf @@ -1,5 +1,5 @@ !debug nhrp all -interface r4-gre0 +interface nhc1-gre0 ip nhrp holdtime 10 ip nhrp network-id 42 ip nhrp registration no-unique @@ -7,5 +7,5 @@ interface r4-gre0 ip nhrp nhs dynamic nbma 192.168.1.2 ip nhrp nhs dynamic nbma 192.168.1.3 ip nhrp shortcut - tunnel source r4-eth0 + tunnel source nhc1-eth0 exit diff --git a/tests/topotests/nhrp_redundancy/r4/zebra.conf b/tests/topotests/nhrp_redundancy/nhc1/zebra.conf similarity index 81% rename from tests/topotests/nhrp_redundancy/r4/zebra.conf rename to tests/topotests/nhrp_redundancy/nhc1/zebra.conf index e4a9a6f80f..db25964ee4 100644 --- a/tests/topotests/nhrp_redundancy/r4/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhc1/zebra.conf @@ -1,14 +1,14 @@ ip forwarding -interface r4-eth0 +interface nhc1-eth0 ip address 192.168.2.4/24 ! ip route 192.168.1.0/24 192.168.2.6 -interface r4-gre0 +interface nhc1-gre0 ip address 176.16.1.4/32 no link-detect ipv6 nd suppress-ra ! -interface r4-eth1 +interface nhc1-eth1 ip address 4.4.4.4/24 ! ip route 0.0.0.0/0 176.16.1.1 50 diff --git a/tests/topotests/nhrp_redundancy/r5/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache.json similarity index 88% rename from tests/topotests/nhrp_redundancy/r5/nhrp_cache.json rename to tests/topotests/nhrp_redundancy/nhc2/nhrp_cache.json index bc041c6014..fa0f07aacf 100644 --- a/tests/topotests/nhrp_redundancy/r5/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache.json @@ -4,7 +4,7 @@ }, "table": [ { - "interface": "r5-gre0", + "interface": "nhc2-gre0", "type": "nhs", "protocol": "176.16.1.2", "nbma": "192.168.1.2", @@ -15,7 +15,7 @@ "identity": "" }, { - "interface": "r5-gre0", + "interface": "nhc2-gre0", "type": "nhs", "protocol": "176.16.1.3", "nbma": "192.168.1.3", @@ -26,7 +26,7 @@ "identity": "" }, { - "interface": "r5-gre0", + "interface": "nhc2-gre0", "type": "nhs", "protocol": "176.16.1.1", "nbma": "192.168.1.1", @@ -37,7 +37,7 @@ "identity": "" }, { - "interface": "r5-gre0", + "interface": "nhc2-gre0", "type": "local", "protocol": "176.16.1.5", "nbma": "192.168.2.5", diff --git a/tests/topotests/nhrp_redundancy/r4/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route.json similarity index 92% rename from tests/topotests/nhrp_redundancy/r4/nhrp_route.json rename to tests/topotests/nhrp_redundancy/nhc2/nhrp_route.json index 4f1faee7a7..a8f61861bc 100644 --- a/tests/topotests/nhrp_redundancy/r4/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route.json @@ -16,7 +16,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r4-gre0", + "interfaceName": "nhc2-gre0", "active": true } ] @@ -39,7 +39,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r4-gre0", + "interfaceName": "nhc2-gre0", "active": true } ] @@ -62,7 +62,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r4-gre0", + "interfaceName": "nhc2-gre0", "active": true } ] diff --git a/tests/topotests/nhrp_redundancy/r5/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhc2/nhrpd.conf similarity index 83% rename from tests/topotests/nhrp_redundancy/r5/nhrpd.conf rename to tests/topotests/nhrp_redundancy/nhc2/nhrpd.conf index 7241ed592d..16a6d87c27 100644 --- a/tests/topotests/nhrp_redundancy/r5/nhrpd.conf +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrpd.conf @@ -1,5 +1,5 @@ !debug nhrp all -interface r5-gre0 +interface nhc2-gre0 ip nhrp holdtime 10 ip nhrp network-id 42 ip nhrp nhs dynamic nbma 192.168.1.1 @@ -7,5 +7,5 @@ interface r5-gre0 ip nhrp nhs dynamic nbma 192.168.1.3 ip nhrp registration no-unique ip nhrp shortcut - tunnel source r5-eth0 + tunnel source nhc2-eth0 exit diff --git a/tests/topotests/nhrp_redundancy/r5/zebra.conf b/tests/topotests/nhrp_redundancy/nhc2/zebra.conf similarity index 81% rename from tests/topotests/nhrp_redundancy/r5/zebra.conf rename to tests/topotests/nhrp_redundancy/nhc2/zebra.conf index 9b1e1c0646..be22fc0ae5 100644 --- a/tests/topotests/nhrp_redundancy/r5/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhc2/zebra.conf @@ -1,14 +1,14 @@ ip forwarding -interface r5-eth0 +interface nhc2-eth0 ip address 192.168.2.5/24 ! ip route 192.168.1.0/24 192.168.2.6 -interface r5-gre0 +interface nhc2-gre0 ip address 176.16.1.5/32 no link-detect ipv6 nd suppress-ra ! -interface r5-eth1 +interface nhc2-eth1 ip address 5.5.5.5/24 ! ip route 0.0.0.0/0 176.16.1.1 50 diff --git a/tests/topotests/nhrp_redundancy/r1/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhs1/nhrp_cache.json similarity index 88% rename from tests/topotests/nhrp_redundancy/r1/nhrp_cache.json rename to tests/topotests/nhrp_redundancy/nhs1/nhrp_cache.json index a94dd9fecf..920644e67d 100644 --- a/tests/topotests/nhrp_redundancy/r1/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhs1/nhrp_cache.json @@ -4,7 +4,7 @@ }, "table": [ { - "interface": "r1-gre0", + "interface": "nhs1-gre0", "type": "dynamic", "protocol": "176.16.1.4", "nbma": "192.168.2.4", @@ -15,7 +15,7 @@ "identity": "" }, { - "interface": "r1-gre0", + "interface": "nhs1-gre0", "type": "local", "protocol": "176.16.1.1", "nbma": "192.168.1.1", @@ -26,7 +26,7 @@ "identity": "-" }, { - "interface": "r1-gre0", + "interface": "nhs1-gre0", "type": "dynamic", "protocol": "176.16.1.5", "nbma": "192.168.2.5", diff --git a/tests/topotests/nhrp_redundancy/r3/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhs1/nhrp_route.json similarity index 92% rename from tests/topotests/nhrp_redundancy/r3/nhrp_route.json rename to tests/topotests/nhrp_redundancy/nhs1/nhrp_route.json index 3d548c08fd..d89719c802 100644 --- a/tests/topotests/nhrp_redundancy/r3/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhs1/nhrp_route.json @@ -16,7 +16,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r3-gre0", + "interfaceName": "nhs1-gre0", "active": true } ] @@ -39,7 +39,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r3-gre0", + "interfaceName": "nhs1-gre0", "active": true } ] diff --git a/tests/topotests/nhrp_redundancy/r2/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhs1/nhrpd.conf similarity index 74% rename from tests/topotests/nhrp_redundancy/r2/nhrpd.conf rename to tests/topotests/nhrp_redundancy/nhs1/nhrpd.conf index 4d63f07d1f..c0c8c28f94 100644 --- a/tests/topotests/nhrp_redundancy/r2/nhrpd.conf +++ b/tests/topotests/nhrp_redundancy/nhs1/nhrpd.conf @@ -1,9 +1,9 @@ !debug nhrp all nhrp nflog-group 1 -interface r2-gre0 +interface nhs1-gre0 ip nhrp holdtime 10 ip nhrp network-id 42 ip nhrp registration no-unique ip nhrp redirect - tunnel source r2-eth0 + tunnel source nhs1-eth0 exit diff --git a/tests/topotests/nhrp_redundancy/r1/zebra.conf b/tests/topotests/nhrp_redundancy/nhs1/zebra.conf similarity index 83% rename from tests/topotests/nhrp_redundancy/r1/zebra.conf rename to tests/topotests/nhrp_redundancy/nhs1/zebra.conf index 0f11563f57..d116612c4f 100644 --- a/tests/topotests/nhrp_redundancy/r1/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhs1/zebra.conf @@ -1,9 +1,9 @@ ip forwarding -interface r1-eth0 +interface nhs1-eth0 ip address 192.168.1.1/24 ! ip route 192.168.2.0/24 192.168.1.6 -interface r1-gre0 +interface nhs1-gre0 ip address 176.16.1.1/32 no link-detect ipv6 nd suppress-ra diff --git a/tests/topotests/nhrp_redundancy/r2/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache.json similarity index 88% rename from tests/topotests/nhrp_redundancy/r2/nhrp_cache.json rename to tests/topotests/nhrp_redundancy/nhs2/nhrp_cache.json index 91557a1918..c0538203c7 100644 --- a/tests/topotests/nhrp_redundancy/r2/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache.json @@ -4,7 +4,7 @@ }, "table": [ { - "interface": "r2-gre0", + "interface": "nhs2-gre0", "type": "local", "protocol": "176.16.1.2", "nbma": "192.168.1.2", @@ -15,7 +15,7 @@ "identity": "-" }, { - "interface": "r2-gre0", + "interface": "nhs2-gre0", "type": "dynamic", "protocol": "176.16.1.4", "nbma": "192.168.2.4", @@ -26,7 +26,7 @@ "identity": "" }, { - "interface": "r2-gre0", + "interface": "nhs2-gre0", "type": "dynamic", "protocol": "176.16.1.5", "nbma": "192.168.2.5", diff --git a/tests/topotests/nhrp_redundancy/r1/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route.json similarity index 92% rename from tests/topotests/nhrp_redundancy/r1/nhrp_route.json rename to tests/topotests/nhrp_redundancy/nhs2/nhrp_route.json index b5f3e29e74..25086be7e8 100644 --- a/tests/topotests/nhrp_redundancy/r1/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route.json @@ -16,7 +16,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r1-gre0", + "interfaceName": "nhs2-gre0", "active": true } ] @@ -39,7 +39,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r1-gre0", + "interfaceName": "nhs2-gre0", "active": true } ] diff --git a/tests/topotests/nhrp_redundancy/r3/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhs2/nhrpd.conf similarity index 74% rename from tests/topotests/nhrp_redundancy/r3/nhrpd.conf rename to tests/topotests/nhrp_redundancy/nhs2/nhrpd.conf index 87cc2161f8..df86d2798e 100644 --- a/tests/topotests/nhrp_redundancy/r3/nhrpd.conf +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrpd.conf @@ -1,9 +1,9 @@ !debug nhrp all nhrp nflog-group 1 -interface r3-gre0 +interface nhs2-gre0 ip nhrp holdtime 10 ip nhrp network-id 42 ip nhrp registration no-unique ip nhrp redirect - tunnel source r3-eth0 + tunnel source nhs2-eth0 exit diff --git a/tests/topotests/nhrp_redundancy/r2/zebra.conf b/tests/topotests/nhrp_redundancy/nhs2/zebra.conf similarity index 83% rename from tests/topotests/nhrp_redundancy/r2/zebra.conf rename to tests/topotests/nhrp_redundancy/nhs2/zebra.conf index 1a9c4ff915..bf482b5837 100644 --- a/tests/topotests/nhrp_redundancy/r2/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhs2/zebra.conf @@ -1,9 +1,9 @@ ip forwarding -interface r2-eth0 +interface nhs2-eth0 ip address 192.168.1.2/24 ! ip route 192.168.2.0/24 192.168.1.6 -interface r2-gre0 +interface nhs2-gre0 ip address 176.16.1.2/32 no link-detect ipv6 nd suppress-ra diff --git a/tests/topotests/nhrp_redundancy/r3/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache.json similarity index 88% rename from tests/topotests/nhrp_redundancy/r3/nhrp_cache.json rename to tests/topotests/nhrp_redundancy/nhs3/nhrp_cache.json index ef3ab690bc..9bcf0f78c2 100644 --- a/tests/topotests/nhrp_redundancy/r3/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache.json @@ -4,7 +4,7 @@ }, "table": [ { - "interface": "r3-gre0", + "interface": "nhs3-gre0", "type": "dynamic", "protocol": "176.16.1.4", "nbma": "192.168.2.4", @@ -15,7 +15,7 @@ "identity": "" }, { - "interface": "r3-gre0", + "interface": "nhs3-gre0", "type": "local", "protocol": "176.16.1.3", "nbma": "192.168.1.3", @@ -26,7 +26,7 @@ "identity": "-" }, { - "interface": "r3-gre0", + "interface": "nhs3-gre0", "type": "dynamic", "protocol": "176.16.1.5", "nbma": "192.168.2.5", diff --git a/tests/topotests/nhrp_redundancy/r2/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route.json similarity index 92% rename from tests/topotests/nhrp_redundancy/r2/nhrp_route.json rename to tests/topotests/nhrp_redundancy/nhs3/nhrp_route.json index f1fa6e54c1..a5a493c973 100644 --- a/tests/topotests/nhrp_redundancy/r2/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route.json @@ -16,7 +16,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r2-gre0", + "interfaceName": "nhs3-gre0", "active": true } ] @@ -39,7 +39,7 @@ { "fib": true, "directlyConnected": true, - "interfaceName": "r2-gre0", + "interfaceName": "nhs3-gre0", "active": true } ] diff --git a/tests/topotests/nhrp_redundancy/r1/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhs3/nhrpd.conf similarity index 74% rename from tests/topotests/nhrp_redundancy/r1/nhrpd.conf rename to tests/topotests/nhrp_redundancy/nhs3/nhrpd.conf index ad48ce3769..e7c3504f65 100644 --- a/tests/topotests/nhrp_redundancy/r1/nhrpd.conf +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrpd.conf @@ -1,9 +1,9 @@ !debug nhrp all nhrp nflog-group 1 -interface r1-gre0 +interface nhs3-gre0 ip nhrp holdtime 10 ip nhrp network-id 42 ip nhrp registration no-unique ip nhrp redirect - tunnel source r1-eth0 + tunnel source nhs3-eth0 exit diff --git a/tests/topotests/nhrp_redundancy/r3/zebra.conf b/tests/topotests/nhrp_redundancy/nhs3/zebra.conf similarity index 83% rename from tests/topotests/nhrp_redundancy/r3/zebra.conf rename to tests/topotests/nhrp_redundancy/nhs3/zebra.conf index 980cfbcaab..2aac2eabbf 100644 --- a/tests/topotests/nhrp_redundancy/r3/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhs3/zebra.conf @@ -1,9 +1,9 @@ ip forwarding -interface r3-eth0 +interface nhs3-eth0 ip address 192.168.1.3/24 ! ip route 192.168.2.0/24 192.168.1.6 -interface r3-gre0 +interface nhs3-gre0 ip address 176.16.1.3/32 no link-detect ipv6 nd suppress-ra diff --git a/tests/topotests/nhrp_redundancy/r6/zebra.conf b/tests/topotests/nhrp_redundancy/router/zebra.conf similarity index 63% rename from tests/topotests/nhrp_redundancy/r6/zebra.conf rename to tests/topotests/nhrp_redundancy/router/zebra.conf index 63a37cd5bf..c0eb19ca40 100644 --- a/tests/topotests/nhrp_redundancy/r6/zebra.conf +++ b/tests/topotests/nhrp_redundancy/router/zebra.conf @@ -1,7 +1,7 @@ ip forwarding -interface r6-eth0 +interface router-eth0 ip address 192.168.1.6/24 ! -interface r6-eth1 +interface router-eth1 ip address 192.168.2.6/24 exit diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot index c169436db0..8a3363d1ae 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot @@ -16,43 +16,43 @@ graph template { label="nhrp-topo-redundant-nhs"; # Routers - r1 [ + nhs1 [ shape=doubleoctagon, label="NHS 1", fillcolor="#f08080", style=filled, ]; - r2 [ + nhs2 [ shape=doubleoctagon label="NHS 2", fillcolor="#f08080", style=filled, ]; - r3 [ + nhs3 [ shape=doubleoctagon label="NHS 3", fillcolor="#f08080", style=filled, ]; - r4 [ + nhc1 [ shape=doubleoctagon label="NHC 1", fillcolor="#f08080", style=filled, ]; - r5 [ + nhc2 [ shape=doubleoctagon label="NHC 2", fillcolor="#f08080", style=filled, ]; - r6 [ + router [ shape=doubleoctagon label="router", fillcolor="#f08080", style=filled, ]; - r7 [ + host [ shape=doubleoctagon label="host", fillcolor="#f08080", @@ -86,18 +86,18 @@ graph template { ]; # Connections - r1 -- sw1 [label="eth0"]; - r2 -- sw1 [label="eth0"]; - r3 -- sw1 [label="eth0"]; - r6 -- sw1 [label="eth0"]; + nhs1 -- sw1 [label="eth0"]; + nhs2 -- sw1 [label="eth0"]; + nhs3 -- sw1 [label="eth0"]; + router -- sw1 [label="eth0"]; - r4 -- sw2 [label="eth0"]; - r5 -- sw2 [label="eth0"]; - r6 -- sw2 [label="eth1"]; + nhc1 -- sw2 [label="eth0"]; + nhc2 -- sw2 [label="eth0"]; + router -- sw2 [label="eth1"]; - r4 -- sw3 [label="eth1"]; - r7 -- sw3 [label="eth0"]; + nhc1 -- sw3 [label="eth1"]; + host -- sw3 [label="eth0"]; - r5 -- sw4 [label="eth1"]; + nhc2 -- sw4 [label="eth1"]; } diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index 81a22ebfaf..c0d7312102 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -77,30 +77,26 @@ def build_topo(tgen): "Build function" # Create 7 routers - for routern in range(1, 8): - tgen.add_router("r{}".format(routern)) + for rname in ["nhs1", "nhs2", "nhs3", "nhc1", "nhc2", "router", "host"]: + tgen.add_router(rname) - # Interconnect routers 1, 2, 3, 6 switch = tgen.add_switch("s1") - switch.add_link(tgen.gears["r1"]) - switch.add_link(tgen.gears["r2"]) - switch.add_link(tgen.gears["r3"]) - switch.add_link(tgen.gears["r6"]) + switch.add_link(tgen.gears["nhs1"]) + switch.add_link(tgen.gears["nhs2"]) + switch.add_link(tgen.gears["nhs3"]) + switch.add_link(tgen.gears["router"]) - # Interconnect routers 4, 5, 6 switch = tgen.add_switch("s2") - switch.add_link(tgen.gears["r4"]) - switch.add_link(tgen.gears["r5"]) - switch.add_link(tgen.gears["r6"]) + switch.add_link(tgen.gears["nhc1"]) + switch.add_link(tgen.gears["nhc2"]) + switch.add_link(tgen.gears["router"]) - # Connect router 4, 7 switch = tgen.add_switch("s3") - switch.add_link(tgen.gears["r4"]) - switch.add_link(tgen.gears["r7"]) + switch.add_link(tgen.gears["nhc1"]) + switch.add_link(tgen.gears["host"]) - # Connect router 5 switch = tgen.add_switch("s4") - switch.add_link(tgen.gears["r5"]) + switch.add_link(tgen.gears["nhc2"]) def _populate_iface(): @@ -123,40 +119,37 @@ def _populate_iface(): ] for cmd in cmds_tot_hub: - # Router 1 - input = cmd.format("r1", "1") + input = cmd.format("nhs1", "1") logger.info("input: " + input) - output = tgen.net["r1"].cmd(input) + output = tgen.net["nhs1"].cmd(input) logger.info("output: " + output) - # Router 2 - input = cmd.format("r2", "2") + input = cmd.format("nhs2", "2") logger.info("input: " + input) - output = tgen.net["r2"].cmd(input) + output = tgen.net["nhs2"].cmd(input) logger.info("output: " + output) - # Router 3 - input = cmd.format("r3", "3") + input = cmd.format("nhs3", "3") logger.info("input: " + input) - output = tgen.net["r3"].cmd(input) + output = tgen.net["nhs3"].cmd(input) logger.info("output: " + output) for cmd in cmds_tot: - input = cmd.format("r4", "4") + input = cmd.format("nhc1", "4") logger.info("input: " + input) - output = tgen.net["r4"].cmd(input) + output = tgen.net["nhc1"].cmd(input) logger.info("output: " + output) - input = cmd.format("r5", "5") + input = cmd.format("nhc2", "5") logger.info("input: " + input) - output = tgen.net["r5"].cmd(input) + output = tgen.net["nhc2"].cmd(input) logger.info("output: " + output) def _verify_iptables(): tgen = get_topogen() # Verify iptables is installed. Required for shortcuts - rc, _, _ = tgen.net["r1"].cmd_status("iptables") + rc, _, _ = tgen.net["nhs1"].cmd_status("iptables") return False if rc == 127 else True @@ -179,7 +172,7 @@ def setup_module(mod): TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname)), ) - if rname in ("r1", "r2", "r3", "r4", "r5"): + if rname in ("nhs1", "nhs2", "nhs3", "nhc1", "nhc2"): router.load_config( TopoRouter.RD_NHRP, os.path.join(CWD, "{}/nhrpd.conf".format(rname)) ) @@ -247,53 +240,53 @@ def test_protocols_convergence(): assert result is None, assertmsg # Test connectivity from 1 NHRP server to all clients - pingrouter = tgen.gears["r1"] - logger.info("Check Ping IPv4 from R1 to R4 = 176.16.1.4)") + pingrouter = tgen.gears["nhs1"] + logger.info("Check Ping IPv4 from nhs1 to nhc1 = 176.16.1.4)") output = pingrouter.run("ping 176.16.1.4 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R1 to R4 should be ok" + assertmsg = "expected ping IPv4 from nhs1 to nhc1 should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R1 to R4 OK") + logger.info("Check Ping IPv4 from nhs1 to nhc1 OK") - logger.info("Check Ping IPv4 from R1 to R5 = 176.16.1.5)") + logger.info("Check Ping IPv4 from nhs1 to nhc2 = 176.16.1.5)") output = pingrouter.run("ping 176.16.1.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R1 to R5 should be ok" + assertmsg = "expected ping IPv4 from nhs1 to nhc2 should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R1 to R5 OK") + logger.info("Check Ping IPv4 from nhs1 to nhc2 OK") # Test connectivity from 1 NHRP client to all servers - pingrouter = tgen.gears["r4"] - logger.info("Check Ping IPv4 from R4 to R1 = 176.16.1.1)") + pingrouter = tgen.gears["nhc1"] + logger.info("Check Ping IPv4 from nhc1 to nhs1 = 176.16.1.1)") output = pingrouter.run("ping 176.16.1.1 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R4 to R1 should be ok" + assertmsg = "expected ping IPv4 from nhc1 to nhs1 should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R4 to R1 OK") + logger.info("Check Ping IPv4 from nhc1 to nhs1 OK") - logger.info("Check Ping IPv4 from R4 to R2 = 176.16.1.2)") + logger.info("Check Ping IPv4 from nhc1 to nhs2 = 176.16.1.2)") output = pingrouter.run("ping 176.16.1.2 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R4 to R2 should be ok" + assertmsg = "expected ping IPv4 from nhc1 to nhs2 should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R4 to R2 OK") + logger.info("Check Ping IPv4 from nhc1 to nhs2 OK") - logger.info("Check Ping IPv4 from R4 to R3 = 176.16.1.3)") + logger.info("Check Ping IPv4 from nhc1 to nhs3 = 176.16.1.3)") output = pingrouter.run("ping 176.16.1.3 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R4 to R3 should be ok" + assertmsg = "expected ping IPv4 from nhc1 to nhs3 should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R4 to R3 OK") + logger.info("Check Ping IPv4 from nhc1 to nhs3 OK") @retry(retry_timeout=30, initial_wait=5) @@ -302,16 +295,16 @@ def verify_shortcut_path(): Verifying that traffic flows through shortcut path """ tgen = get_topogen() - pingrouter = tgen.gears["r7"] - logger.info("Check Ping IPv4 from R7 to R5 = 5.5.5.5") + pingrouter = tgen.gears["host"] + logger.info("Check Ping IPv4 from host to nhc2 = 5.5.5.5") output = pingrouter.run("ping 5.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R7 to R5 should be ok" + assertmsg = "expected ping IPv4 from host to nhc2 should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R7 to R5 OK") + logger.info("Check Ping IPv4 from host to nhc2 OK") def test_redundancy_shortcut(): @@ -328,8 +321,8 @@ def test_redundancy_shortcut(): logger.info("Testing NHRP shortcuts with redundant servers") - # Verify R4 nhrp routes before shortcut creation - router = tgen.gears["r4"] + # Verify nhc1 nhrp routes before shortcut creation + router = tgen.gears["nhc1"] json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) assertmsg = "No nhrp_route file found" assert os.path.isfile(json_file), assertmsg @@ -347,16 +340,16 @@ def test_redundancy_shortcut(): assert result is None, assertmsg # Initiate shortcut by pinging between clients - pingrouter = tgen.gears["r7"] - logger.info("Check Ping IPv4 from R7 to R5 via shortcut = 5.5.5.5") + pingrouter = tgen.gears["host"] + logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 5.5.5.5") output = pingrouter.run("ping 5.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R7 to R5 via shortcut should be ok" + assertmsg = "expected ping IPv4 from host to nhc2 via shortcut should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R7 to R5 via shortcut OK") + logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") # Now check that NHRP shortcut route installed json_file = "{}/{}/nhrp_route_shortcut.json".format(CWD, router.name) @@ -376,20 +369,20 @@ def test_redundancy_shortcut(): assert result is None, assertmsg # Bring down primary GRE interface and verify shortcut is not disturbed - logger.info("Bringing down R1, primary NHRP server.") - shutdown_bringup_interface(tgen, "r1", "r1-gre0", False) + logger.info("Bringing down nhs1, primary NHRP server.") + shutdown_bringup_interface(tgen, "nhs1", "nhs1-gre0", False) # Verify shortcut is still active - pingrouter = tgen.gears["r7"] - logger.info("Check Ping IPv4 from R7 to R5 via shortcut = 5.5.5.5") + pingrouter = tgen.gears["host"] + logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 5.5.5.5") output = pingrouter.run("ping 5.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: - assertmsg = "expected ping IPv4 from R7 to R5 via shortcut should be ok" + assertmsg = "expected ping IPv4 from host to nhc2 via shortcut should be ok" assert 0, assertmsg else: - logger.info("Check Ping IPv4 from R7 to R5 via shortcut OK") + logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") # Now verify shortcut is purged with lack of traffic json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) From 1a04aa088ca256214c4ef7d0037c28005516d820 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 11:23:42 +0200 Subject: [PATCH 03/10] tests: rename router variables in nhrp_redundancy Rename router variables in nhrp_redundancy to match the actual name. Cosmetic change to help debugging. Signed-off-by: Louis Scalbert (cherry picked from commit 551c3290eddd2eab5c5727941a384b748a2bf632) --- .../nhrp_redundancy/test_nhrp_redundancy.py | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index c0d7312102..606df0e133 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -240,9 +240,9 @@ def test_protocols_convergence(): assert result is None, assertmsg # Test connectivity from 1 NHRP server to all clients - pingrouter = tgen.gears["nhs1"] + nhs1 = tgen.gears["nhs1"] logger.info("Check Ping IPv4 from nhs1 to nhc1 = 176.16.1.4)") - output = pingrouter.run("ping 176.16.1.4 -f -c 1000") + output = nhs1.run("ping 176.16.1.4 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhs1 to nhc1 should be ok" @@ -251,7 +251,7 @@ def test_protocols_convergence(): logger.info("Check Ping IPv4 from nhs1 to nhc1 OK") logger.info("Check Ping IPv4 from nhs1 to nhc2 = 176.16.1.5)") - output = pingrouter.run("ping 176.16.1.5 -f -c 1000") + output = nhs1.run("ping 176.16.1.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhs1 to nhc2 should be ok" @@ -260,9 +260,9 @@ def test_protocols_convergence(): logger.info("Check Ping IPv4 from nhs1 to nhc2 OK") # Test connectivity from 1 NHRP client to all servers - pingrouter = tgen.gears["nhc1"] + nhc1 = tgen.gears["nhc1"] logger.info("Check Ping IPv4 from nhc1 to nhs1 = 176.16.1.1)") - output = pingrouter.run("ping 176.16.1.1 -f -c 1000") + output = nhc1.run("ping 176.16.1.1 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhc1 to nhs1 should be ok" @@ -271,7 +271,7 @@ def test_protocols_convergence(): logger.info("Check Ping IPv4 from nhc1 to nhs1 OK") logger.info("Check Ping IPv4 from nhc1 to nhs2 = 176.16.1.2)") - output = pingrouter.run("ping 176.16.1.2 -f -c 1000") + output = nhc1.run("ping 176.16.1.2 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhc1 to nhs2 should be ok" @@ -280,7 +280,7 @@ def test_protocols_convergence(): logger.info("Check Ping IPv4 from nhc1 to nhs2 OK") logger.info("Check Ping IPv4 from nhc1 to nhs3 = 176.16.1.3)") - output = pingrouter.run("ping 176.16.1.3 -f -c 1000") + output = nhc1.run("ping 176.16.1.3 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhc1 to nhs3 should be ok" @@ -295,10 +295,10 @@ def verify_shortcut_path(): Verifying that traffic flows through shortcut path """ tgen = get_topogen() - pingrouter = tgen.gears["host"] + host = tgen.gears["host"] logger.info("Check Ping IPv4 from host to nhc2 = 5.5.5.5") - output = pingrouter.run("ping 5.5.5.5 -f -c 1000") + output = host.run("ping 5.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from host to nhc2 should be ok" @@ -322,28 +322,28 @@ def test_redundancy_shortcut(): logger.info("Testing NHRP shortcuts with redundant servers") # Verify nhc1 nhrp routes before shortcut creation - router = tgen.gears["nhc1"] - json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) + nhc1 = tgen.gears["nhc1"] + json_file = "{}/{}/nhrp_route.json".format(CWD, nhc1.name) assertmsg = "No nhrp_route file found" assert os.path.isfile(json_file), assertmsg expected = json.loads(open(json_file).read()) test_func = partial( - topotest.router_json_cmp, router, "show ip route nhrp json", expected + topotest.router_json_cmp, nhc1, "show ip route nhrp json", expected ) _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) - output = router.vtysh_cmd("show ip route nhrp") + output = nhc1.vtysh_cmd("show ip route nhrp") logger.info(output) - assertmsg = '"{}" JSON output mismatches'.format(router.name) + assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) assert result is None, assertmsg # Initiate shortcut by pinging between clients - pingrouter = tgen.gears["host"] + host = tgen.gears["host"] logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 5.5.5.5") - output = pingrouter.run("ping 5.5.5.5 -f -c 1000") + output = host.run("ping 5.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from host to nhc2 via shortcut should be ok" @@ -352,20 +352,20 @@ def test_redundancy_shortcut(): logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") # Now check that NHRP shortcut route installed - json_file = "{}/{}/nhrp_route_shortcut.json".format(CWD, router.name) + json_file = "{}/{}/nhrp_route_shortcut.json".format(CWD, nhc1.name) assertmsg = "No nhrp_route file found" assert os.path.isfile(json_file), assertmsg expected = json.loads(open(json_file).read()) test_func = partial( - topotest.router_json_cmp, router, "show ip route nhrp json", expected + topotest.router_json_cmp, nhc1, "show ip route nhrp json", expected ) _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) - output = router.vtysh_cmd("show ip route nhrp") + output = nhc1.vtysh_cmd("show ip route nhrp") logger.info(output) - assertmsg = '"{}" JSON output mismatches'.format(router.name) + assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) assert result is None, assertmsg # Bring down primary GRE interface and verify shortcut is not disturbed @@ -373,10 +373,10 @@ def test_redundancy_shortcut(): shutdown_bringup_interface(tgen, "nhs1", "nhs1-gre0", False) # Verify shortcut is still active - pingrouter = tgen.gears["host"] + host = tgen.gears["host"] logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 5.5.5.5") - output = pingrouter.run("ping 5.5.5.5 -f -c 1000") + output = host.run("ping 5.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from host to nhc2 via shortcut should be ok" @@ -385,20 +385,20 @@ def test_redundancy_shortcut(): logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") # Now verify shortcut is purged with lack of traffic - json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) + json_file = "{}/{}/nhrp_route.json".format(CWD, nhc1.name) assertmsg = "No nhrp_route file found" assert os.path.isfile(json_file), assertmsg expected = json.loads(open(json_file).read()) test_func = partial( - topotest.router_json_cmp, router, "show ip route nhrp json", expected + topotest.router_json_cmp, nhc1, "show ip route nhrp json", expected ) _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) - output = router.vtysh_cmd("show ip route nhrp") + output = nhc1.vtysh_cmd("show ip route nhrp") logger.info(output) - assertmsg = '"{}" JSON output mismatches'.format(router.name) + assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) assert result is None, assertmsg From ce233789f26a09b00b863108bd457b0ccd1cbb9d Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:14:17 +0200 Subject: [PATCH 04/10] tests: simplify nhrp_redundancy convergence Simplify nhrp_redundancy convergence code. Cosmetic change. Signed-off-by: Louis Scalbert (cherry picked from commit dbd888cce6665631a3db1f45ab5d084159878172) --- .../nhrp_redundancy/test_nhrp_redundancy.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index 606df0e133..891a3cb8c3 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -10,7 +10,6 @@ import os import sys import json -from time import sleep from functools import partial import pytest @@ -196,17 +195,15 @@ def test_protocols_convergence(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) - logger.info("Checking NHRP cache and IPv4 routes for convergence") + logger.info("Checking NHRP cache for convergence") router_list = tgen.routers() # Check NHRP cache on servers and clients for rname, router in router_list.items(): - - json_file = "{}/{}/nhrp_cache.json".format(CWD, router.name) - if not os.path.isfile(json_file): - logger.info("skipping file {}".format(json_file)) + if 'nh' not in rname: continue + json_file = "{}/{}/nhrp_cache.json".format(CWD, router.name) expected = json.loads(open(json_file).read()) test_func = partial( topotest.router_json_cmp, router, "show ip nhrp cache json", expected @@ -220,13 +217,12 @@ def test_protocols_convergence(): assert result is None, assertmsg # Check NHRP IPV4 routes on servers and clients + logger.info("Checking IPv4 routes for convergence") for rname, router in router_list.items(): - - json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) - if not os.path.isfile(json_file): - logger.info("skipping file {}".format(json_file)) + if 'nh' not in rname: continue + json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) expected = json.loads(open(json_file).read()) test_func = partial( topotest.router_json_cmp, router, "show ip route nhrp json", expected From 8a79cc4a0a79d512e6e7414ee41f1091b8e0f730 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:08:51 +0200 Subject: [PATCH 05/10] tests: fix nhc1 route check after nhs1 down After setting down nhs1, the test is checking that nhc1 routing table matches routes in nhc1/nhrp_route.json. It is incorrect because it checks that the NHRP route to nhs1 is still present but it should have disappeared. Signed-off-by: Louis Scalbert (cherry picked from commit df630bbc3ee57cffffbce07f20f9c77056e16e51) --- .../nhc1/nhrp_route_nhs1_down.json | 49 +++++++++++++++++++ .../nhrp_redundancy/test_nhrp_redundancy.py | 6 +-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json new file mode 100644 index 0000000000..a8fd1934d6 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json @@ -0,0 +1,49 @@ +{ + "176.16.1.1\/32": null, + "176.16.1.2\/32": [ + { + "prefix": "176.16.1.2\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ], + "176.16.1.3\/32": [ + { + "prefix": "176.16.1.3\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index 891a3cb8c3..441bd56adf 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -200,7 +200,7 @@ def test_protocols_convergence(): # Check NHRP cache on servers and clients for rname, router in router_list.items(): - if 'nh' not in rname: + if "nh" not in rname: continue json_file = "{}/{}/nhrp_cache.json".format(CWD, router.name) @@ -219,7 +219,7 @@ def test_protocols_convergence(): # Check NHRP IPV4 routes on servers and clients logger.info("Checking IPv4 routes for convergence") for rname, router in router_list.items(): - if 'nh' not in rname: + if "nh" not in rname: continue json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) @@ -381,7 +381,7 @@ def test_redundancy_shortcut(): logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") # Now verify shortcut is purged with lack of traffic - json_file = "{}/{}/nhrp_route.json".format(CWD, nhc1.name) + json_file = "{}/{}/nhrp_route_nhs1_down.json".format(CWD, nhc1.name) assertmsg = "No nhrp_route file found" assert os.path.isfile(json_file), assertmsg From 5e2143d46e140f480ca5c79d30961f40ebfc42ca Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:12:27 +0200 Subject: [PATCH 06/10] tests: fix nhs1 down check in nhrp_redundancy Fully check the NHRP convergence after setting nhs1 down. Otherwise the ping may pass because the previous shortcut is still present. Signed-off-by: Louis Scalbert (cherry picked from commit 9aa78070e0048ec54c07726b8a5bd3b33331257b) --- .../nhc1/nhrp_cache_nhs1_down.json | 40 ++++++++ .../nhc1/nhrp_route_shortcut_nhs1_down.json | 96 +++++++++++++++++++ .../nhc2/nhrp_cache_nhs1_down.json | 40 ++++++++ .../nhc2/nhrp_route_nhs1_down.json | 49 ++++++++++ .../nhs2/nhrp_cache_nhs1_down.json | 40 ++++++++ .../nhs2/nhrp_route_nhs1_down.json | 48 ++++++++++ .../nhs3/nhrp_cache_nhs1_down.json | 40 ++++++++ .../nhs3/nhrp_route_nhs1_down.json | 48 ++++++++++ .../nhrp_redundancy/test_nhrp_redundancy.py | 71 +++++++++++++- 9 files changed, 471 insertions(+), 1 deletion(-) create mode 100644 tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json create mode 100644 tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json create mode 100644 tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json create mode 100644 tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json create mode 100644 tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json create mode 100644 tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json create mode 100644 tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json create mode 100644 tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json new file mode 100644 index 0000000000..7ceebc321e --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json @@ -0,0 +1,40 @@ +{ + "attr": { + "entriesCount": 3 + }, + "table": [ + { + "interface": "nhc1-gre0", + "type": "nhs", + "protocol": "176.16.1.2", + "nbma": "192.168.1.2", + "claimed_nbma": "192.168.1.2", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + }, + { + "interface": "nhc1-gre0", + "type": "local", + "protocol": "176.16.1.4", + "nbma": "192.168.2.4", + "claimed_nbma": "192.168.2.4", + "used": false, + "timeout": false, + "auth": false, + "identity": "-" + }, + { + "interface": "nhc1-gre0", + "type": "nhs", + "protocol": "176.16.1.3", + "nbma": "192.168.1.3", + "claimed_nbma": "192.168.1.3", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json new file mode 100644 index 0000000000..38e5000324 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json @@ -0,0 +1,96 @@ +{ + "5.5.5.0\/24": [ + { + "prefix": "5.5.5.0\/24", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "ip": "176.16.1.5", + "afi": "ipv4", + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ], + "176.16.1.1\/32": null, + "176.16.1.2\/32": [ + { + "prefix": "176.16.1.2\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ], + "176.16.1.3\/32": [ + { + "prefix": "176.16.1.3\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ], + "176.16.1.5\/32": [ + { + "prefix": "176.16.1.5\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc1-gre0", + "active": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json new file mode 100644 index 0000000000..a76c85231d --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json @@ -0,0 +1,40 @@ +{ + "attr": { + "entriesCount": 3 + }, + "table": [ + { + "interface": "nhc2-gre0", + "type": "nhs", + "protocol": "176.16.1.2", + "nbma": "192.168.1.2", + "claimed_nbma": "192.168.1.2", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + }, + { + "interface": "nhc2-gre0", + "type": "nhs", + "protocol": "176.16.1.3", + "nbma": "192.168.1.3", + "claimed_nbma": "192.168.1.3", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + }, + { + "interface": "nhc2-gre0", + "type": "local", + "protocol": "176.16.1.5", + "nbma": "192.168.2.5", + "claimed_nbma": "192.168.2.5", + "used": false, + "timeout": false, + "auth": false, + "identity": "-" + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json new file mode 100644 index 0000000000..fd7c4c8f39 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json @@ -0,0 +1,49 @@ +{ + "176.16.1.1\/32": null, + "176.16.1.2\/32": [ + { + "prefix": "176.16.1.2\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc2-gre0", + "active": true + } + ] + } + ], + "176.16.1.3\/32": [ + { + "prefix": "176.16.1.3\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhc2-gre0", + "active": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json new file mode 100644 index 0000000000..c0538203c7 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json @@ -0,0 +1,40 @@ +{ + "attr": { + "entriesCount": 3 + }, + "table": [ + { + "interface": "nhs2-gre0", + "type": "local", + "protocol": "176.16.1.2", + "nbma": "192.168.1.2", + "claimed_nbma": "192.168.1.2", + "used": false, + "timeout": false, + "auth": false, + "identity": "-" + }, + { + "interface": "nhs2-gre0", + "type": "dynamic", + "protocol": "176.16.1.4", + "nbma": "192.168.2.4", + "claimed_nbma": "192.168.2.4", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + }, + { + "interface": "nhs2-gre0", + "type": "dynamic", + "protocol": "176.16.1.5", + "nbma": "192.168.2.5", + "claimed_nbma": "192.168.2.5", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json new file mode 100644 index 0000000000..25086be7e8 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json @@ -0,0 +1,48 @@ +{ + "176.16.1.4\/32": [ + { + "prefix": "176.16.1.4\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhs2-gre0", + "active": true + } + ] + } + ], + "176.16.1.5\/32": [ + { + "prefix": "176.16.1.5\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhs2-gre0", + "active": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json new file mode 100644 index 0000000000..9bcf0f78c2 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json @@ -0,0 +1,40 @@ +{ + "attr": { + "entriesCount": 3 + }, + "table": [ + { + "interface": "nhs3-gre0", + "type": "dynamic", + "protocol": "176.16.1.4", + "nbma": "192.168.2.4", + "claimed_nbma": "192.168.2.4", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + }, + { + "interface": "nhs3-gre0", + "type": "local", + "protocol": "176.16.1.3", + "nbma": "192.168.1.3", + "claimed_nbma": "192.168.1.3", + "used": false, + "timeout": false, + "auth": false, + "identity": "-" + }, + { + "interface": "nhs3-gre0", + "type": "dynamic", + "protocol": "176.16.1.5", + "nbma": "192.168.2.5", + "claimed_nbma": "192.168.2.5", + "used": false, + "timeout": true, + "auth": false, + "identity": "" + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json new file mode 100644 index 0000000000..a5a493c973 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json @@ -0,0 +1,48 @@ +{ + "176.16.1.4\/32": [ + { + "prefix": "176.16.1.4\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhs3-gre0", + "active": true + } + ] + } + ], + "176.16.1.5\/32": [ + { + "prefix": "176.16.1.5\/32", + "protocol": "nhrp", + "vrfId": 0, + "vrfName": "default", + "selected": true, + "destSelected": true, + "distance": 10, + "metric": 0, + "installed": true, + "internalNextHopNum": 1, + "internalNextHopActiveNum": 1, + "nexthops": [ + { + "fib": true, + "directlyConnected": true, + "interfaceName": "nhs3-gre0", + "active": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index 441bd56adf..f45006bd27 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -306,7 +306,6 @@ def verify_shortcut_path(): def test_redundancy_shortcut(): """ Assert that if shortcut created and then NHS goes down, there is no traffic disruption - Stop traffic and verify next time traffic started, shortcut is initiated by backup NHS """ tgen = get_topogen() if tgen.routers_have_failure(): @@ -364,10 +363,66 @@ def test_redundancy_shortcut(): assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) assert result is None, assertmsg + +def test_redundancy_shortcut_backup(): + """ + Stop traffic and verify next time traffic started, shortcut is initiated by backup NHS + """ + tgen = get_topogen() + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + if not _verify_iptables(): + pytest.skip("iptables not installed") + + nhc1 = tgen.gears["nhc1"] + router_list = tgen.routers() + # Bring down primary GRE interface and verify shortcut is not disturbed logger.info("Bringing down nhs1, primary NHRP server.") shutdown_bringup_interface(tgen, "nhs1", "nhs1-gre0", False) + # Check NHRP cache on servers and clients + for rname, router in router_list.items(): + if "nh" not in rname: + continue + if "nhs1" in rname: + continue + + json_file = "{}/{}/nhrp_cache_nhs1_down.json".format(CWD, router.name) + expected = json.loads(open(json_file).read()) + test_func = partial( + topotest.router_json_cmp, router, "show ip nhrp cache json", expected + ) + _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) + + output = router.vtysh_cmd("show ip nhrp cache") + logger.info(output) + + assertmsg = '"{}" JSON output mismatches'.format(router.name) + assert result is None, assertmsg + + # Check NHRP IPV4 routes on servers and clients + logger.info("Checking IPv4 routes for convergence") + for rname, router in router_list.items(): + if "nh" not in rname: + continue + if "nhs1" in rname: + continue + + json_file = "{}/{}/nhrp_route_nhs1_down.json".format(CWD, router.name) + expected = json.loads(open(json_file).read()) + test_func = partial( + topotest.router_json_cmp, router, "show ip route nhrp json", expected + ) + _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) + + output = router.vtysh_cmd("show ip route nhrp") + logger.info(output) + + assertmsg = '"{}" JSON output mismatches'.format(router.name) + assert result is None, assertmsg + # Verify shortcut is still active host = tgen.gears["host"] logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 5.5.5.5") @@ -380,6 +435,20 @@ def test_redundancy_shortcut(): else: logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") + # Verify shortcut is present in routing table + json_file = "{}/{}/nhrp_route_shortcut_nhs1_down.json".format(CWD, nhc1.name) + assertmsg = "No nhrp_route file found" + assert os.path.isfile(json_file), assertmsg + + expected = json.loads(open(json_file).read()) + test_func = partial( + topotest.router_json_cmp, nhc1, "show ip route nhrp json", expected + ) + _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) + + output = nhc1.vtysh_cmd("show ip route nhrp") + logger.info(output) + # Now verify shortcut is purged with lack of traffic json_file = "{}/{}/nhrp_route_nhs1_down.json".format(CWD, nhc1.name) assertmsg = "No nhrp_route file found" From a806714bf6f2f9f70a793d30b56cfc28dcad57ca Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:22:45 +0200 Subject: [PATCH 07/10] tests: fix iptables command in nhrp_redundancy Replace --nflog-range argument by --nflog-range due to: > 2024-08-30 10:44:54,816 INFO: topo: input: iptables -A FORWARD -i nhs3-gre0 -o nhs3-gre0 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-range 128 > 2024-08-30 10:44:54,819 INFO: topo: output: warn: --nflog-range has never worked and is no longer supported, please use --nflog-size insted Signed-off-by: Louis Scalbert (cherry picked from commit b175a3fab3cf90f5c68b074e76a70b81cdbf56c7) --- tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index f45006bd27..7026674014 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -106,7 +106,7 @@ def _populate_iface(): "echo 0 > /proc/sys/net/ipv4/ip_forward_use_pmtu", "echo 1 > /proc/sys/net/ipv6/conf/{0}-eth0/disable_ipv6", "echo 1 > /proc/sys/net/ipv6/conf/{0}-gre0/disable_ipv6", - "iptables -A FORWARD -i {0}-gre0 -o {0}-gre0 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-range 128", + "iptables -A FORWARD -i {0}-gre0 -o {0}-gre0 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-size 128", ] cmds_tot = [ From 95ed7b1da32fadcfb8eb7efd00a39f9ea02e2bcf Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:35:58 +0200 Subject: [PATCH 08/10] nhrpd: fix show nhrp shortcut json Fix show nhrp shortcut json Fixes: 87b9e98203 ("nhrpd: add json support to show nhrp vty commands") Signed-off-by: Louis Scalbert (cherry picked from commit 7028e399865bf1f21c286e2c11c3c90e9b0e3fe3) --- nhrpd/nhrp_vty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index 40d38c44d2..f91fcb532f 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -826,7 +826,7 @@ static void show_ip_nhrp_shortcut(struct nhrp_shortcut *s, void *pctx) char buf1[PREFIX_STRLEN], buf2[SU_ADDRSTRLEN]; struct json_object *json = NULL; - if (!ctx->count) { + if (!ctx->count && !ctx->json) { vty_out(vty, "%-8s %-24s %-24s %s\n", "Type", "Prefix", "Via", "Identity"); } From d46ad2257c1b68934ec1d8e2799ddf842e3d8e68 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:41:08 +0200 Subject: [PATCH 09/10] tests: check show ip nhrp shorcut in nhrp_redundancy Check show ip nhrp shorcut in nhrp_redundancy Signed-off-by: Louis Scalbert (cherry picked from commit 7f587c9c9d0291bae775cc0c3e2c8c7f8267407c) --- .../nhc1/nhrp_shortcut_absent.json | 5 ++ .../nhc1/nhrp_shortcut_present.json | 9 ++++ .../nhrp_redundancy/test_nhrp_redundancy.py | 53 +++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_absent.json create mode 100644 tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_absent.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_absent.json new file mode 100644 index 0000000000..78563cb902 --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_absent.json @@ -0,0 +1,5 @@ +{ + "attr":{ + "entriesCount":0 + } +} diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json new file mode 100644 index 0000000000..40a7086b1c --- /dev/null +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json @@ -0,0 +1,9 @@ +{ + "table":[ + { + "type":"dynamic", + "prefix":"5.5.5.0/24", + "via":"176.16.1.5" + } + ] +} diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index 7026674014..9b4933e43d 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -363,6 +363,33 @@ def test_redundancy_shortcut(): assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) assert result is None, assertmsg + json_file = "{}/{}/nhrp_shortcut_present.json".format(CWD, nhc1.name) + expected = json.loads(open(json_file).read()) + test_func = partial( + topotest.router_json_cmp, nhc1, "show ip nhrp shortcut json", expected + ) + _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) + + output = nhc1.vtysh_cmd("show ip nhrp shortcut") + logger.info(output) + + assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) + assert result is None, assertmsg + + # check the shortcut disappears because of no traffic + json_file = "{}/{}/nhrp_shortcut_absent.json".format(CWD, nhc1.name) + expected = json.loads(open(json_file).read()) + test_func = partial( + topotest.router_json_cmp, nhc1, "show ip nhrp shortcut json", expected + ) + _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) + + output = nhc1.vtysh_cmd("show ip nhrp shortcut") + logger.info(output) + + assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) + assert result is None, assertmsg + def test_redundancy_shortcut_backup(): """ @@ -449,6 +476,19 @@ def test_redundancy_shortcut_backup(): output = nhc1.vtysh_cmd("show ip route nhrp") logger.info(output) + json_file = "{}/{}/nhrp_shortcut_present.json".format(CWD, nhc1.name) + expected = json.loads(open(json_file).read()) + test_func = partial( + topotest.router_json_cmp, nhc1, "show ip nhrp shortcut json", expected + ) + _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) + + output = nhc1.vtysh_cmd("show ip nhrp shortcut") + logger.info(output) + + assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) + assert result is None, assertmsg + # Now verify shortcut is purged with lack of traffic json_file = "{}/{}/nhrp_route_nhs1_down.json".format(CWD, nhc1.name) assertmsg = "No nhrp_route file found" @@ -466,6 +506,19 @@ def test_redundancy_shortcut_backup(): assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) assert result is None, assertmsg + json_file = "{}/{}/nhrp_shortcut_absent.json".format(CWD, nhc1.name) + expected = json.loads(open(json_file).read()) + test_func = partial( + topotest.router_json_cmp, nhc1, "show ip nhrp shortcut json", expected + ) + _, result = topotest.run_and_expect(test_func, None, count=40, wait=0.5) + + output = nhc1.vtysh_cmd("show ip nhrp shortcut") + logger.info(output) + + assertmsg = '"{}" JSON output mismatches'.format(nhc1.name) + assert result is None, assertmsg + def test_memory_leak(): "Run the memory leak test and report results." From 322528f9ad81e9f53ad37f63d6dedcb3ace257e2 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 14:52:49 +0200 Subject: [PATCH 10/10] tests: use private addresses in nhrp_redundancy Use private addresses in nhrp_redundancy. > cd tests/topotests/nhrp_redundancy > git grep 176.16 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|176.16|172.16|g' -i > git grep 5.5.5. | cut -f1 -d: | uniq | xargs -L1 sed -e 's|5.5.5.|10.5.5.|g' -i > git grep 4.4.4 | cut -f1 -d: | uniq | xargs -L1 sed -e 's|4.4.4.|10.4.4.|g' -i Signed-off-by: Louis Scalbert (cherry picked from commit 995f6b8f16122fa63d470592263c82045823f80d) --- .../topotests/nhrp_redundancy/host/zebra.conf | 4 +-- .../nhrp_redundancy/nhc1/nhrp_cache.json | 8 ++--- .../nhc1/nhrp_cache_nhs1_down.json | 6 ++-- .../nhrp_redundancy/nhc1/nhrp_route.json | 12 +++---- .../nhc1/nhrp_route_nhs1_down.json | 10 +++--- .../nhc1/nhrp_route_shortcut.json | 22 ++++++------ .../nhc1/nhrp_route_shortcut_nhs1_down.json | 20 +++++------ .../nhc1/nhrp_shortcut_present.json | 4 +-- .../topotests/nhrp_redundancy/nhc1/zebra.conf | 10 +++--- .../nhrp_redundancy/nhc2/nhrp_cache.json | 8 ++--- .../nhc2/nhrp_cache_nhs1_down.json | 6 ++-- .../nhrp_redundancy/nhc2/nhrp_route.json | 12 +++---- .../nhc2/nhrp_route_nhs1_down.json | 10 +++--- .../topotests/nhrp_redundancy/nhc2/zebra.conf | 10 +++--- .../nhrp_redundancy/nhs1/nhrp_cache.json | 6 ++-- .../nhrp_redundancy/nhs1/nhrp_route.json | 8 ++--- .../topotests/nhrp_redundancy/nhs1/zebra.conf | 6 ++-- .../nhrp_redundancy/nhs2/nhrp_cache.json | 6 ++-- .../nhs2/nhrp_cache_nhs1_down.json | 6 ++-- .../nhrp_redundancy/nhs2/nhrp_route.json | 8 ++--- .../nhs2/nhrp_route_nhs1_down.json | 8 ++--- .../topotests/nhrp_redundancy/nhs2/zebra.conf | 6 ++-- .../nhrp_redundancy/nhs3/nhrp_cache.json | 6 ++-- .../nhs3/nhrp_cache_nhs1_down.json | 6 ++-- .../nhrp_redundancy/nhs3/nhrp_route.json | 8 ++--- .../nhs3/nhrp_route_nhs1_down.json | 8 ++--- .../topotests/nhrp_redundancy/nhs3/zebra.conf | 6 ++-- .../nhrp_redundancy/test_nhrp_redundancy.dot | 4 +-- .../nhrp_redundancy/test_nhrp_redundancy.py | 36 +++++++++---------- 29 files changed, 135 insertions(+), 135 deletions(-) diff --git a/tests/topotests/nhrp_redundancy/host/zebra.conf b/tests/topotests/nhrp_redundancy/host/zebra.conf index 58c8cb2c4b..8bb7da0ad6 100644 --- a/tests/topotests/nhrp_redundancy/host/zebra.conf +++ b/tests/topotests/nhrp_redundancy/host/zebra.conf @@ -1,4 +1,4 @@ interface host-eth0 - ip address 4.4.4.7/24 + ip address 10.4.4.7/24 ! -ip route 0.0.0.0/0 4.4.4.4 +ip route 0.0.0.0/0 10.4.4.4 diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache.json index 5d2cf6fb5e..9e8a5c999d 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache.json @@ -6,7 +6,7 @@ { "interface": "nhc1-gre0", "type": "nhs", - "protocol": "176.16.1.2", + "protocol": "172.16.1.2", "nbma": "192.168.1.2", "claimed_nbma": "192.168.1.2", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhc1-gre0", "type": "local", - "protocol": "176.16.1.4", + "protocol": "172.16.1.4", "nbma": "192.168.2.4", "claimed_nbma": "192.168.2.4", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhc1-gre0", "type": "nhs", - "protocol": "176.16.1.3", + "protocol": "172.16.1.3", "nbma": "192.168.1.3", "claimed_nbma": "192.168.1.3", "used": false, @@ -39,7 +39,7 @@ { "interface": "nhc1-gre0", "type": "nhs", - "protocol": "176.16.1.1", + "protocol": "172.16.1.1", "nbma": "192.168.1.1", "claimed_nbma": "192.168.1.1", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json index 7ceebc321e..5b91f3bcfb 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_cache_nhs1_down.json @@ -6,7 +6,7 @@ { "interface": "nhc1-gre0", "type": "nhs", - "protocol": "176.16.1.2", + "protocol": "172.16.1.2", "nbma": "192.168.1.2", "claimed_nbma": "192.168.1.2", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhc1-gre0", "type": "local", - "protocol": "176.16.1.4", + "protocol": "172.16.1.4", "nbma": "192.168.2.4", "claimed_nbma": "192.168.2.4", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhc1-gre0", "type": "nhs", - "protocol": "176.16.1.3", + "protocol": "172.16.1.3", "nbma": "192.168.1.3", "claimed_nbma": "192.168.1.3", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route.json index 2af62dd4d6..083675651f 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route.json @@ -1,7 +1,7 @@ { - "176.16.1.1\/32": [ + "172.16.1.1\/32": [ { - "prefix": "176.16.1.1\/32", + "prefix": "172.16.1.1\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -22,9 +22,9 @@ ] } ], - "176.16.1.2\/32": [ + "172.16.1.2\/32": [ { - "prefix": "176.16.1.2\/32", + "prefix": "172.16.1.2\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -45,9 +45,9 @@ ] } ], - "176.16.1.3\/32": [ + "172.16.1.3\/32": [ { - "prefix": "176.16.1.3\/32", + "prefix": "172.16.1.3\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json index a8fd1934d6..bfb468b0fb 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_nhs1_down.json @@ -1,8 +1,8 @@ { - "176.16.1.1\/32": null, - "176.16.1.2\/32": [ + "172.16.1.1\/32": null, + "172.16.1.2\/32": [ { - "prefix": "176.16.1.2\/32", + "prefix": "172.16.1.2\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -23,9 +23,9 @@ ] } ], - "176.16.1.3\/32": [ + "172.16.1.3\/32": [ { - "prefix": "176.16.1.3\/32", + "prefix": "172.16.1.3\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut.json index 2111e27583..3a91f1baaa 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut.json @@ -1,7 +1,7 @@ { - "5.5.5.0\/24": [ + "10.5.5.0\/24": [ { - "prefix": "5.5.5.0\/24", + "prefix": "10.5.5.0\/24", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -15,7 +15,7 @@ "nexthops": [ { "fib": true, - "ip": "176.16.1.5", + "ip": "172.16.1.5", "afi": "ipv4", "interfaceName": "nhc1-gre0", "active": true @@ -23,9 +23,9 @@ ] } ], - "176.16.1.1\/32": [ + "172.16.1.1\/32": [ { - "prefix": "176.16.1.1\/32", + "prefix": "172.16.1.1\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -46,9 +46,9 @@ ] } ], - "176.16.1.2\/32": [ + "172.16.1.2\/32": [ { - "prefix": "176.16.1.2\/32", + "prefix": "172.16.1.2\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -69,9 +69,9 @@ ] } ], - "176.16.1.3\/32": [ + "172.16.1.3\/32": [ { - "prefix": "176.16.1.3\/32", + "prefix": "172.16.1.3\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -92,9 +92,9 @@ ] } ], - "176.16.1.5\/32": [ + "172.16.1.5\/32": [ { - "prefix": "176.16.1.5\/32", + "prefix": "172.16.1.5\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json index 38e5000324..0f38feb6a8 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_route_shortcut_nhs1_down.json @@ -1,7 +1,7 @@ { - "5.5.5.0\/24": [ + "10.5.5.0\/24": [ { - "prefix": "5.5.5.0\/24", + "prefix": "10.5.5.0\/24", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -15,7 +15,7 @@ "nexthops": [ { "fib": true, - "ip": "176.16.1.5", + "ip": "172.16.1.5", "afi": "ipv4", "interfaceName": "nhc1-gre0", "active": true @@ -23,10 +23,10 @@ ] } ], - "176.16.1.1\/32": null, - "176.16.1.2\/32": [ + "172.16.1.1\/32": null, + "172.16.1.2\/32": [ { - "prefix": "176.16.1.2\/32", + "prefix": "172.16.1.2\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -47,9 +47,9 @@ ] } ], - "176.16.1.3\/32": [ + "172.16.1.3\/32": [ { - "prefix": "176.16.1.3\/32", + "prefix": "172.16.1.3\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -70,9 +70,9 @@ ] } ], - "176.16.1.5\/32": [ + "172.16.1.5\/32": [ { - "prefix": "176.16.1.5\/32", + "prefix": "172.16.1.5\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json b/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json index 40a7086b1c..4547c59c88 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json +++ b/tests/topotests/nhrp_redundancy/nhc1/nhrp_shortcut_present.json @@ -2,8 +2,8 @@ "table":[ { "type":"dynamic", - "prefix":"5.5.5.0/24", - "via":"176.16.1.5" + "prefix":"10.5.5.0/24", + "via":"172.16.1.5" } ] } diff --git a/tests/topotests/nhrp_redundancy/nhc1/zebra.conf b/tests/topotests/nhrp_redundancy/nhc1/zebra.conf index db25964ee4..07d9175418 100644 --- a/tests/topotests/nhrp_redundancy/nhc1/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhc1/zebra.conf @@ -4,13 +4,13 @@ interface nhc1-eth0 ! ip route 192.168.1.0/24 192.168.2.6 interface nhc1-gre0 - ip address 176.16.1.4/32 + ip address 172.16.1.4/32 no link-detect ipv6 nd suppress-ra ! interface nhc1-eth1 - ip address 4.4.4.4/24 + ip address 10.4.4.4/24 ! -ip route 0.0.0.0/0 176.16.1.1 50 -ip route 0.0.0.0/0 176.16.1.2 60 -ip route 0.0.0.0/0 176.16.1.3 70 \ No newline at end of file +ip route 0.0.0.0/0 172.16.1.1 50 +ip route 0.0.0.0/0 172.16.1.2 60 +ip route 0.0.0.0/0 172.16.1.3 70 \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache.json index fa0f07aacf..8ee02a7cbf 100644 --- a/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache.json @@ -6,7 +6,7 @@ { "interface": "nhc2-gre0", "type": "nhs", - "protocol": "176.16.1.2", + "protocol": "172.16.1.2", "nbma": "192.168.1.2", "claimed_nbma": "192.168.1.2", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhc2-gre0", "type": "nhs", - "protocol": "176.16.1.3", + "protocol": "172.16.1.3", "nbma": "192.168.1.3", "claimed_nbma": "192.168.1.3", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhc2-gre0", "type": "nhs", - "protocol": "176.16.1.1", + "protocol": "172.16.1.1", "nbma": "192.168.1.1", "claimed_nbma": "192.168.1.1", "used": false, @@ -39,7 +39,7 @@ { "interface": "nhc2-gre0", "type": "local", - "protocol": "176.16.1.5", + "protocol": "172.16.1.5", "nbma": "192.168.2.5", "claimed_nbma": "192.168.2.5", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json index a76c85231d..bb1c483718 100644 --- a/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_cache_nhs1_down.json @@ -6,7 +6,7 @@ { "interface": "nhc2-gre0", "type": "nhs", - "protocol": "176.16.1.2", + "protocol": "172.16.1.2", "nbma": "192.168.1.2", "claimed_nbma": "192.168.1.2", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhc2-gre0", "type": "nhs", - "protocol": "176.16.1.3", + "protocol": "172.16.1.3", "nbma": "192.168.1.3", "claimed_nbma": "192.168.1.3", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhc2-gre0", "type": "local", - "protocol": "176.16.1.5", + "protocol": "172.16.1.5", "nbma": "192.168.2.5", "claimed_nbma": "192.168.2.5", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhc2/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route.json index a8f61861bc..a69c0caec3 100644 --- a/tests/topotests/nhrp_redundancy/nhc2/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route.json @@ -1,7 +1,7 @@ { - "176.16.1.1\/32": [ + "172.16.1.1\/32": [ { - "prefix": "176.16.1.1\/32", + "prefix": "172.16.1.1\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -22,9 +22,9 @@ ] } ], - "176.16.1.2\/32": [ + "172.16.1.2\/32": [ { - "prefix": "176.16.1.2\/32", + "prefix": "172.16.1.2\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -45,9 +45,9 @@ ] } ], - "176.16.1.3\/32": [ + "172.16.1.3\/32": [ { - "prefix": "176.16.1.3\/32", + "prefix": "172.16.1.3\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json index fd7c4c8f39..e2dd9dde23 100644 --- a/tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhc2/nhrp_route_nhs1_down.json @@ -1,8 +1,8 @@ { - "176.16.1.1\/32": null, - "176.16.1.2\/32": [ + "172.16.1.1\/32": null, + "172.16.1.2\/32": [ { - "prefix": "176.16.1.2\/32", + "prefix": "172.16.1.2\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -23,9 +23,9 @@ ] } ], - "176.16.1.3\/32": [ + "172.16.1.3\/32": [ { - "prefix": "176.16.1.3\/32", + "prefix": "172.16.1.3\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhc2/zebra.conf b/tests/topotests/nhrp_redundancy/nhc2/zebra.conf index be22fc0ae5..30ea6d4d1d 100644 --- a/tests/topotests/nhrp_redundancy/nhc2/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhc2/zebra.conf @@ -4,13 +4,13 @@ interface nhc2-eth0 ! ip route 192.168.1.0/24 192.168.2.6 interface nhc2-gre0 - ip address 176.16.1.5/32 + ip address 172.16.1.5/32 no link-detect ipv6 nd suppress-ra ! interface nhc2-eth1 - ip address 5.5.5.5/24 + ip address 10.5.5.5/24 ! -ip route 0.0.0.0/0 176.16.1.1 50 -ip route 0.0.0.0/0 176.16.1.2 60 -ip route 0.0.0.0/0 176.16.1.3 70 +ip route 0.0.0.0/0 172.16.1.1 50 +ip route 0.0.0.0/0 172.16.1.2 60 +ip route 0.0.0.0/0 172.16.1.3 70 diff --git a/tests/topotests/nhrp_redundancy/nhs1/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhs1/nhrp_cache.json index 920644e67d..11d41d1b83 100644 --- a/tests/topotests/nhrp_redundancy/nhs1/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhs1/nhrp_cache.json @@ -6,7 +6,7 @@ { "interface": "nhs1-gre0", "type": "dynamic", - "protocol": "176.16.1.4", + "protocol": "172.16.1.4", "nbma": "192.168.2.4", "claimed_nbma": "192.168.2.4", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhs1-gre0", "type": "local", - "protocol": "176.16.1.1", + "protocol": "172.16.1.1", "nbma": "192.168.1.1", "claimed_nbma": "192.168.1.1", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhs1-gre0", "type": "dynamic", - "protocol": "176.16.1.5", + "protocol": "172.16.1.5", "nbma": "192.168.2.5", "claimed_nbma": "192.168.2.5", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhs1/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhs1/nhrp_route.json index d89719c802..2574b1a5d2 100644 --- a/tests/topotests/nhrp_redundancy/nhs1/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhs1/nhrp_route.json @@ -1,7 +1,7 @@ { - "176.16.1.4\/32": [ + "172.16.1.4\/32": [ { - "prefix": "176.16.1.4\/32", + "prefix": "172.16.1.4\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -22,9 +22,9 @@ ] } ], - "176.16.1.5\/32": [ + "172.16.1.5\/32": [ { - "prefix": "176.16.1.5\/32", + "prefix": "172.16.1.5\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhs1/zebra.conf b/tests/topotests/nhrp_redundancy/nhs1/zebra.conf index d116612c4f..718e01b991 100644 --- a/tests/topotests/nhrp_redundancy/nhs1/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhs1/zebra.conf @@ -4,9 +4,9 @@ interface nhs1-eth0 ! ip route 192.168.2.0/24 192.168.1.6 interface nhs1-gre0 - ip address 176.16.1.1/32 + ip address 172.16.1.1/32 no link-detect ipv6 nd suppress-ra ! -ip route 4.4.4.0/24 176.16.1.4 -ip route 5.5.5.0/24 176.16.1.5 +ip route 10.4.4.0/24 172.16.1.4 +ip route 10.5.5.0/24 172.16.1.5 diff --git a/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache.json index c0538203c7..6343c4deb9 100644 --- a/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache.json @@ -6,7 +6,7 @@ { "interface": "nhs2-gre0", "type": "local", - "protocol": "176.16.1.2", + "protocol": "172.16.1.2", "nbma": "192.168.1.2", "claimed_nbma": "192.168.1.2", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhs2-gre0", "type": "dynamic", - "protocol": "176.16.1.4", + "protocol": "172.16.1.4", "nbma": "192.168.2.4", "claimed_nbma": "192.168.2.4", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhs2-gre0", "type": "dynamic", - "protocol": "176.16.1.5", + "protocol": "172.16.1.5", "nbma": "192.168.2.5", "claimed_nbma": "192.168.2.5", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json index c0538203c7..6343c4deb9 100644 --- a/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_cache_nhs1_down.json @@ -6,7 +6,7 @@ { "interface": "nhs2-gre0", "type": "local", - "protocol": "176.16.1.2", + "protocol": "172.16.1.2", "nbma": "192.168.1.2", "claimed_nbma": "192.168.1.2", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhs2-gre0", "type": "dynamic", - "protocol": "176.16.1.4", + "protocol": "172.16.1.4", "nbma": "192.168.2.4", "claimed_nbma": "192.168.2.4", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhs2-gre0", "type": "dynamic", - "protocol": "176.16.1.5", + "protocol": "172.16.1.5", "nbma": "192.168.2.5", "claimed_nbma": "192.168.2.5", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhs2/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route.json index 25086be7e8..0ad37fc319 100644 --- a/tests/topotests/nhrp_redundancy/nhs2/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route.json @@ -1,7 +1,7 @@ { - "176.16.1.4\/32": [ + "172.16.1.4\/32": [ { - "prefix": "176.16.1.4\/32", + "prefix": "172.16.1.4\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -22,9 +22,9 @@ ] } ], - "176.16.1.5\/32": [ + "172.16.1.5\/32": [ { - "prefix": "176.16.1.5\/32", + "prefix": "172.16.1.5\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json index 25086be7e8..0ad37fc319 100644 --- a/tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhs2/nhrp_route_nhs1_down.json @@ -1,7 +1,7 @@ { - "176.16.1.4\/32": [ + "172.16.1.4\/32": [ { - "prefix": "176.16.1.4\/32", + "prefix": "172.16.1.4\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -22,9 +22,9 @@ ] } ], - "176.16.1.5\/32": [ + "172.16.1.5\/32": [ { - "prefix": "176.16.1.5\/32", + "prefix": "172.16.1.5\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhs2/zebra.conf b/tests/topotests/nhrp_redundancy/nhs2/zebra.conf index bf482b5837..6001bf21c0 100644 --- a/tests/topotests/nhrp_redundancy/nhs2/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhs2/zebra.conf @@ -4,9 +4,9 @@ interface nhs2-eth0 ! ip route 192.168.2.0/24 192.168.1.6 interface nhs2-gre0 - ip address 176.16.1.2/32 + ip address 172.16.1.2/32 no link-detect ipv6 nd suppress-ra ! -ip route 4.4.4.0/24 176.16.1.4 -ip route 5.5.5.0/24 176.16.1.5 +ip route 10.4.4.0/24 172.16.1.4 +ip route 10.5.5.0/24 172.16.1.5 diff --git a/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache.json index 9bcf0f78c2..d911de348b 100644 --- a/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache.json +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache.json @@ -6,7 +6,7 @@ { "interface": "nhs3-gre0", "type": "dynamic", - "protocol": "176.16.1.4", + "protocol": "172.16.1.4", "nbma": "192.168.2.4", "claimed_nbma": "192.168.2.4", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhs3-gre0", "type": "local", - "protocol": "176.16.1.3", + "protocol": "172.16.1.3", "nbma": "192.168.1.3", "claimed_nbma": "192.168.1.3", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhs3-gre0", "type": "dynamic", - "protocol": "176.16.1.5", + "protocol": "172.16.1.5", "nbma": "192.168.2.5", "claimed_nbma": "192.168.2.5", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json index 9bcf0f78c2..d911de348b 100644 --- a/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_cache_nhs1_down.json @@ -6,7 +6,7 @@ { "interface": "nhs3-gre0", "type": "dynamic", - "protocol": "176.16.1.4", + "protocol": "172.16.1.4", "nbma": "192.168.2.4", "claimed_nbma": "192.168.2.4", "used": false, @@ -17,7 +17,7 @@ { "interface": "nhs3-gre0", "type": "local", - "protocol": "176.16.1.3", + "protocol": "172.16.1.3", "nbma": "192.168.1.3", "claimed_nbma": "192.168.1.3", "used": false, @@ -28,7 +28,7 @@ { "interface": "nhs3-gre0", "type": "dynamic", - "protocol": "176.16.1.5", + "protocol": "172.16.1.5", "nbma": "192.168.2.5", "claimed_nbma": "192.168.2.5", "used": false, diff --git a/tests/topotests/nhrp_redundancy/nhs3/nhrp_route.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route.json index a5a493c973..29a4f8f11b 100644 --- a/tests/topotests/nhrp_redundancy/nhs3/nhrp_route.json +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route.json @@ -1,7 +1,7 @@ { - "176.16.1.4\/32": [ + "172.16.1.4\/32": [ { - "prefix": "176.16.1.4\/32", + "prefix": "172.16.1.4\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -22,9 +22,9 @@ ] } ], - "176.16.1.5\/32": [ + "172.16.1.5\/32": [ { - "prefix": "176.16.1.5\/32", + "prefix": "172.16.1.5\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json index a5a493c973..29a4f8f11b 100644 --- a/tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json +++ b/tests/topotests/nhrp_redundancy/nhs3/nhrp_route_nhs1_down.json @@ -1,7 +1,7 @@ { - "176.16.1.4\/32": [ + "172.16.1.4\/32": [ { - "prefix": "176.16.1.4\/32", + "prefix": "172.16.1.4\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", @@ -22,9 +22,9 @@ ] } ], - "176.16.1.5\/32": [ + "172.16.1.5\/32": [ { - "prefix": "176.16.1.5\/32", + "prefix": "172.16.1.5\/32", "protocol": "nhrp", "vrfId": 0, "vrfName": "default", diff --git a/tests/topotests/nhrp_redundancy/nhs3/zebra.conf b/tests/topotests/nhrp_redundancy/nhs3/zebra.conf index 2aac2eabbf..7c15438817 100644 --- a/tests/topotests/nhrp_redundancy/nhs3/zebra.conf +++ b/tests/topotests/nhrp_redundancy/nhs3/zebra.conf @@ -4,9 +4,9 @@ interface nhs3-eth0 ! ip route 192.168.2.0/24 192.168.1.6 interface nhs3-gre0 - ip address 176.16.1.3/32 + ip address 172.16.1.3/32 no link-detect ipv6 nd suppress-ra ! -ip route 4.4.4.0/24 176.16.1.4 -ip route 5.5.5.0/24 176.16.1.5 \ No newline at end of file +ip route 10.4.4.0/24 172.16.1.4 +ip route 10.5.5.0/24 172.16.1.5 \ No newline at end of file diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot index 8a3363d1ae..e94e1d0734 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.dot @@ -74,13 +74,13 @@ graph template { ]; sw3 [ shape=oval, - label="sw3\n4.4.4.0/24", + label="sw3\n10.4.4.0/24", fillcolor="#d0e0d0", style=filled, ]; sw4 [ shape=oval, - label="sw4\n5.5.5.0/24", + label="sw4\n10.5.5.0/24", fillcolor="#d0e0d0", style=filled, ]; diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py index 9b4933e43d..06777aaa23 100644 --- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py +++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py @@ -56,11 +56,11 @@ TOPOLOGY = """ +------------+ | +-------+----+ +------+-----+ | | | | | | | | | | | +--------+ | | | | -| Host |.7 | | NHC 1 | | NHC 2 +-----+5.5.5.0/24 +| Host |.7 | | NHC 1 | | NHC 2 +-----+10.5.5.0/24 | +---------+ | | | | | +------------+ | +------------+ +------------+ | | | - 4.4.4.0/24 + 10.4.4.0/24 """ # Save the Current Working Directory to find configuration files. @@ -237,8 +237,8 @@ def test_protocols_convergence(): # Test connectivity from 1 NHRP server to all clients nhs1 = tgen.gears["nhs1"] - logger.info("Check Ping IPv4 from nhs1 to nhc1 = 176.16.1.4)") - output = nhs1.run("ping 176.16.1.4 -f -c 1000") + logger.info("Check Ping IPv4 from nhs1 to nhc1 = 172.16.1.4)") + output = nhs1.run("ping 172.16.1.4 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhs1 to nhc1 should be ok" @@ -246,8 +246,8 @@ def test_protocols_convergence(): else: logger.info("Check Ping IPv4 from nhs1 to nhc1 OK") - logger.info("Check Ping IPv4 from nhs1 to nhc2 = 176.16.1.5)") - output = nhs1.run("ping 176.16.1.5 -f -c 1000") + logger.info("Check Ping IPv4 from nhs1 to nhc2 = 172.16.1.5)") + output = nhs1.run("ping 172.16.1.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhs1 to nhc2 should be ok" @@ -257,8 +257,8 @@ def test_protocols_convergence(): # Test connectivity from 1 NHRP client to all servers nhc1 = tgen.gears["nhc1"] - logger.info("Check Ping IPv4 from nhc1 to nhs1 = 176.16.1.1)") - output = nhc1.run("ping 176.16.1.1 -f -c 1000") + logger.info("Check Ping IPv4 from nhc1 to nhs1 = 172.16.1.1)") + output = nhc1.run("ping 172.16.1.1 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhc1 to nhs1 should be ok" @@ -266,8 +266,8 @@ def test_protocols_convergence(): else: logger.info("Check Ping IPv4 from nhc1 to nhs1 OK") - logger.info("Check Ping IPv4 from nhc1 to nhs2 = 176.16.1.2)") - output = nhc1.run("ping 176.16.1.2 -f -c 1000") + logger.info("Check Ping IPv4 from nhc1 to nhs2 = 172.16.1.2)") + output = nhc1.run("ping 172.16.1.2 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhc1 to nhs2 should be ok" @@ -275,8 +275,8 @@ def test_protocols_convergence(): else: logger.info("Check Ping IPv4 from nhc1 to nhs2 OK") - logger.info("Check Ping IPv4 from nhc1 to nhs3 = 176.16.1.3)") - output = nhc1.run("ping 176.16.1.3 -f -c 1000") + logger.info("Check Ping IPv4 from nhc1 to nhs3 = 172.16.1.3)") + output = nhc1.run("ping 172.16.1.3 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from nhc1 to nhs3 should be ok" @@ -292,9 +292,9 @@ def verify_shortcut_path(): """ tgen = get_topogen() host = tgen.gears["host"] - logger.info("Check Ping IPv4 from host to nhc2 = 5.5.5.5") + logger.info("Check Ping IPv4 from host to nhc2 = 10.5.5.5") - output = host.run("ping 5.5.5.5 -f -c 1000") + output = host.run("ping 10.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from host to nhc2 should be ok" @@ -336,9 +336,9 @@ def test_redundancy_shortcut(): # Initiate shortcut by pinging between clients host = tgen.gears["host"] - logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 5.5.5.5") + logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 10.5.5.5") - output = host.run("ping 5.5.5.5 -f -c 1000") + output = host.run("ping 10.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from host to nhc2 via shortcut should be ok" @@ -452,9 +452,9 @@ def test_redundancy_shortcut_backup(): # Verify shortcut is still active host = tgen.gears["host"] - logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 5.5.5.5") + logger.info("Check Ping IPv4 from host to nhc2 via shortcut = 10.5.5.5") - output = host.run("ping 5.5.5.5 -f -c 1000") + output = host.run("ping 10.5.5.5 -f -c 1000") logger.info(output) if "1000 packets transmitted, 1000 received" not in output: assertmsg = "expected ping IPv4 from host to nhc2 via shortcut should be ok"