]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: nhrp, use unified config, remove misleading error log
authorJafar Al-Gharaibeh <jafar@atcorp.com>
Thu, 5 Sep 2024 04:51:39 +0000 (23:51 -0500)
committerJafar Al-Gharaibeh <jafar@atcorp.com>
Thu, 5 Sep 2024 05:00:52 +0000 (00:00 -0500)
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
20 files changed:
tests/topotests/nhrp_redundancy/host/frr.conf [new file with mode: 0644]
tests/topotests/nhrp_redundancy/host/zebra.conf [deleted file]
tests/topotests/nhrp_redundancy/nhc1/frr.conf [new file with mode: 0644]
tests/topotests/nhrp_redundancy/nhc1/nhrpd.conf [deleted file]
tests/topotests/nhrp_redundancy/nhc1/zebra.conf [deleted file]
tests/topotests/nhrp_redundancy/nhc2/frr.conf [new file with mode: 0644]
tests/topotests/nhrp_redundancy/nhc2/nhrpd.conf [deleted file]
tests/topotests/nhrp_redundancy/nhc2/zebra.conf [deleted file]
tests/topotests/nhrp_redundancy/nhs1/frr.conf [new file with mode: 0644]
tests/topotests/nhrp_redundancy/nhs1/nhrpd.conf [deleted file]
tests/topotests/nhrp_redundancy/nhs1/zebra.conf [deleted file]
tests/topotests/nhrp_redundancy/nhs2/frr.conf [new file with mode: 0644]
tests/topotests/nhrp_redundancy/nhs2/nhrpd.conf [deleted file]
tests/topotests/nhrp_redundancy/nhs2/zebra.conf [deleted file]
tests/topotests/nhrp_redundancy/nhs3/frr.conf [new file with mode: 0644]
tests/topotests/nhrp_redundancy/nhs3/nhrpd.conf [deleted file]
tests/topotests/nhrp_redundancy/nhs3/zebra.conf [deleted file]
tests/topotests/nhrp_redundancy/router/frr.conf [new file with mode: 0644]
tests/topotests/nhrp_redundancy/router/zebra.conf [deleted file]
tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py

diff --git a/tests/topotests/nhrp_redundancy/host/frr.conf b/tests/topotests/nhrp_redundancy/host/frr.conf
new file mode 100644 (file)
index 0000000..8bb7da0
--- /dev/null
@@ -0,0 +1,4 @@
+interface host-eth0
+ ip address 10.4.4.7/24
+!
+ip route 0.0.0.0/0 10.4.4.4
diff --git a/tests/topotests/nhrp_redundancy/host/zebra.conf b/tests/topotests/nhrp_redundancy/host/zebra.conf
deleted file mode 100644 (file)
index 8bb7da0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-interface host-eth0
- ip address 10.4.4.7/24
-!
-ip route 0.0.0.0/0 10.4.4.4
diff --git a/tests/topotests/nhrp_redundancy/nhc1/frr.conf b/tests/topotests/nhrp_redundancy/nhc1/frr.conf
new file mode 100644 (file)
index 0000000..98e848b
--- /dev/null
@@ -0,0 +1,25 @@
+ip forwarding
+!debug nhrp all
+interface nhc1-eth0
+ ip address 192.168.2.4/24
+!
+ip route 192.168.1.0/24 192.168.2.6
+interface nhc1-gre0
+ ip address 172.16.1.4/32
+ no link-detect
+ ipv6 nd suppress-ra
+ ip nhrp holdtime 10
+ ip nhrp network-id 42
+ ip nhrp registration no-unique
+ ip nhrp nhs dynamic nbma 192.168.1.1
+ ip nhrp nhs dynamic nbma 192.168.1.2
+ ip nhrp nhs dynamic nbma 192.168.1.3
+ ip nhrp shortcut
+ tunnel source nhc1-eth0
+!
+interface nhc1-eth1
+ ip address 10.4.4.4/24
+!
+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/nhc1/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhc1/nhrpd.conf
deleted file mode 100644 (file)
index a0862f7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-!debug nhrp all
-interface nhc1-gre0
- ip nhrp holdtime 10
- ip nhrp network-id 42
- ip nhrp registration no-unique
- ip nhrp nhs dynamic nbma 192.168.1.1 
- ip nhrp nhs dynamic nbma 192.168.1.2
- ip nhrp nhs dynamic nbma 192.168.1.3
- ip nhrp shortcut
- tunnel source nhc1-eth0
-exit
diff --git a/tests/topotests/nhrp_redundancy/nhc1/zebra.conf b/tests/topotests/nhrp_redundancy/nhc1/zebra.conf
deleted file mode 100644 (file)
index 07d9175..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-ip forwarding
-interface nhc1-eth0
- ip address 192.168.2.4/24
-!
-ip route 192.168.1.0/24 192.168.2.6
-interface nhc1-gre0
- ip address 172.16.1.4/32
- no link-detect
- ipv6 nd suppress-ra
-!
-interface nhc1-eth1
- ip address 10.4.4.4/24
-!
-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/frr.conf b/tests/topotests/nhrp_redundancy/nhc2/frr.conf
new file mode 100644 (file)
index 0000000..818dd48
--- /dev/null
@@ -0,0 +1,25 @@
+ip forwarding
+!debug nhrp all
+interface nhc2-eth0
+ ip address 192.168.2.5/24
+!
+ip route 192.168.1.0/24 192.168.2.6
+interface nhc2-gre0
+ ip address 172.16.1.5/32
+ no link-detect
+ ipv6 nd suppress-ra
+ ip nhrp holdtime 10
+ ip nhrp network-id 42
+ ip nhrp nhs dynamic nbma 192.168.1.1
+ ip nhrp nhs dynamic nbma 192.168.1.2
+ ip nhrp nhs dynamic nbma 192.168.1.3
+ ip nhrp registration no-unique
+ ip nhrp shortcut
+ tunnel source nhc2-eth0
+!
+interface nhc2-eth1
+ ip address 10.5.5.5/24
+!
+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/nhc2/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhc2/nhrpd.conf
deleted file mode 100644 (file)
index 16a6d87..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-!debug nhrp all
-interface nhc2-gre0
- ip nhrp holdtime 10
- ip nhrp network-id 42
- ip nhrp nhs dynamic nbma 192.168.1.1
- ip nhrp nhs dynamic nbma 192.168.1.2
- ip nhrp nhs dynamic nbma 192.168.1.3
- ip nhrp registration no-unique
- ip nhrp shortcut
- tunnel source nhc2-eth0
-exit
diff --git a/tests/topotests/nhrp_redundancy/nhc2/zebra.conf b/tests/topotests/nhrp_redundancy/nhc2/zebra.conf
deleted file mode 100644 (file)
index 30ea6d4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-ip forwarding
-interface nhc2-eth0
- ip address 192.168.2.5/24
-!
-ip route 192.168.1.0/24 192.168.2.6
-interface nhc2-gre0
- ip address 172.16.1.5/32
- no link-detect
- ipv6 nd suppress-ra
-!
-interface nhc2-eth1
- ip address 10.5.5.5/24
-!
-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/frr.conf b/tests/topotests/nhrp_redundancy/nhs1/frr.conf
new file mode 100644 (file)
index 0000000..583d014
--- /dev/null
@@ -0,0 +1,19 @@
+ip forwarding
+!debug nhrp all
+interface nhs1-eth0
+ ip address 192.168.1.1/24
+!
+ip route 192.168.2.0/24 192.168.1.6
+nhrp nflog-group 1
+interface nhs1-gre0
+ ip address 172.16.1.1/32
+ no link-detect
+ ipv6 nd suppress-ra
+ ip nhrp holdtime 10
+ ip nhrp network-id 42
+ ip nhrp registration no-unique
+ ip nhrp redirect
+ tunnel source nhs1-eth0
+!
+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/nhs1/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhs1/nhrpd.conf
deleted file mode 100644 (file)
index c0c8c28..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-!debug nhrp all
-nhrp nflog-group 1
-interface nhs1-gre0
- ip nhrp holdtime 10
- ip nhrp network-id 42
- ip nhrp registration no-unique
- ip nhrp redirect
- tunnel source nhs1-eth0
-exit
diff --git a/tests/topotests/nhrp_redundancy/nhs1/zebra.conf b/tests/topotests/nhrp_redundancy/nhs1/zebra.conf
deleted file mode 100644 (file)
index 718e01b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-ip forwarding
-interface nhs1-eth0
- ip address 192.168.1.1/24
-!
-ip route 192.168.2.0/24 192.168.1.6
-interface nhs1-gre0
- ip address 172.16.1.1/32
- no link-detect
- ipv6 nd suppress-ra
-!
-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/frr.conf b/tests/topotests/nhrp_redundancy/nhs2/frr.conf
new file mode 100644 (file)
index 0000000..a6e0a98
--- /dev/null
@@ -0,0 +1,19 @@
+ip forwarding
+!debug nhrp all
+interface nhs2-eth0
+ ip address 192.168.1.2/24
+!
+ip route 192.168.2.0/24 192.168.1.6
+nhrp nflog-group 1
+interface nhs2-gre0
+ ip address 172.16.1.2/32
+ no link-detect
+ ipv6 nd suppress-ra
+ ip nhrp holdtime 10
+ ip nhrp network-id 42
+ ip nhrp registration no-unique
+ ip nhrp redirect
+ tunnel source nhs2-eth0
+!
+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/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhs2/nhrpd.conf
deleted file mode 100644 (file)
index df86d27..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-!debug nhrp all
-nhrp nflog-group 1
-interface nhs2-gre0
- ip nhrp holdtime 10
- ip nhrp network-id 42
- ip nhrp registration no-unique
- ip nhrp redirect
- tunnel source nhs2-eth0
-exit
diff --git a/tests/topotests/nhrp_redundancy/nhs2/zebra.conf b/tests/topotests/nhrp_redundancy/nhs2/zebra.conf
deleted file mode 100644 (file)
index 6001bf2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-ip forwarding
-interface nhs2-eth0
- ip address 192.168.1.2/24
-!
-ip route 192.168.2.0/24 192.168.1.6
-interface nhs2-gre0
- ip address 172.16.1.2/32
- no link-detect
- ipv6 nd suppress-ra
-!
-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/frr.conf b/tests/topotests/nhrp_redundancy/nhs3/frr.conf
new file mode 100644 (file)
index 0000000..e965baf
--- /dev/null
@@ -0,0 +1,19 @@
+ip forwarding
+!debug nhrp all
+interface nhs3-eth0
+ ip address 192.168.1.3/24
+!
+ip route 192.168.2.0/24 192.168.1.6
+nhrp nflog-group 1
+interface nhs3-gre0
+ ip address 172.16.1.3/32
+ no link-detect
+ ipv6 nd suppress-ra
+ ip nhrp holdtime 10
+ ip nhrp network-id 42
+ ip nhrp registration no-unique
+ ip nhrp redirect
+ tunnel source nhs3-eth0
+!
+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/nhs3/nhrpd.conf b/tests/topotests/nhrp_redundancy/nhs3/nhrpd.conf
deleted file mode 100644 (file)
index e7c3504..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-!debug nhrp all
-nhrp nflog-group 1
-interface nhs3-gre0
- ip nhrp holdtime 10
- ip nhrp network-id 42
- ip nhrp registration no-unique
- ip nhrp redirect
- tunnel source nhs3-eth0
-exit
diff --git a/tests/topotests/nhrp_redundancy/nhs3/zebra.conf b/tests/topotests/nhrp_redundancy/nhs3/zebra.conf
deleted file mode 100644 (file)
index 7c15438..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-ip forwarding
-interface nhs3-eth0
- ip address 192.168.1.3/24
-!
-ip route 192.168.2.0/24 192.168.1.6
-interface nhs3-gre0
- ip address 172.16.1.3/32
- no link-detect
- ipv6 nd suppress-ra
-!
-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/router/frr.conf b/tests/topotests/nhrp_redundancy/router/frr.conf
new file mode 100644 (file)
index 0000000..c0eb19c
--- /dev/null
@@ -0,0 +1,7 @@
+ip forwarding
+interface router-eth0
+ ip address 192.168.1.6/24
+!
+interface router-eth1
+ ip address 192.168.2.6/24
+exit
diff --git a/tests/topotests/nhrp_redundancy/router/zebra.conf b/tests/topotests/nhrp_redundancy/router/zebra.conf
deleted file mode 100644 (file)
index c0eb19c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-ip forwarding
-interface router-eth0
- ip address 192.168.1.6/24
-!
-interface router-eth1
- ip address 192.168.2.6/24
-exit
index 06777aaa23ddf8f3f31780ceba8149892dba28ad..d4cf98596cedb67cad6e7e53ead10da7b2162352 100644 (file)
@@ -29,38 +29,38 @@ test_nhrp_redundancy.py: Test NHS redundancy for NHRP
 """
 
 TOPOLOGY = """
-+------------+                  +------------+                   +------------+               
-|            |                  |            |                   |            |               
-|            |                  |            |                   |            |               
-|   NHS 1    |                  |   NHS 2    |                   |    NHS 3   |               
-|            |                  |            |                   |            |               
-+-----+------+                  +-----+------+                   +-----+------+               
-      |.1                             |.2                              |.3                    
-      |                               |                                |                      
-      |                               |            192.168.1.0/24      |                      
-------+-------------------------------+------------------+-------------+------                
-                                                         |                                    
-                                                         |.6                                  
-         GRE P2MP between all NHS and NHC          +-----+------+                             
-               172.16.1.x/32                       |            |                             
-                                                   |            |                             
-                                                   |   Router   |                             
-                                                   |            |                             
-                                                   +-----+------+                             
-                                                         |                                    
-                                                         |                                    
-                               ---------+----------------+-------------+------                
-                                        |          192.168.2.0/24      |                      
-                                        |                              |                      
-                       |                |.4                            |.5                    
-+------------+         |        +-------+----+                  +------+-----+     |          
-|            |         |        |            |                  |            |     |          
-|            |         +--------+            |                  |            |     |          
++------------+                  +------------+                   +------------+
+|            |                  |            |                   |            |
+|            |                  |            |                   |            |
+|   NHS 1    |                  |   NHS 2    |                   |    NHS 3   |
+|            |                  |            |                   |            |
++-----+------+                  +-----+------+                   +-----+------+
+      |.1                             |.2                              |.3
+      |                               |                                |
+      |                               |            192.168.1.0/24      |
+------+-------------------------------+------------------+-------------+------
+                                                         |
+                                                         |.6
+         GRE P2MP between all NHS and NHC          +-----+------+
+               172.16.1.x/32                       |            |
+                                                   |            |
+                                                   |   Router   |
+                                                   |            |
+                                                   +-----+------+
+                                                         |
+                                                         |
+                               ---------+----------------+-------------+------
+                                        |          192.168.2.0/24      |
+                                        |                              |
+                       |                |.4                            |.5
++------------+         |        +-------+----+                  +------+-----+     |
+|            |         |        |            |                  |            |     |
+|            |         +--------+            |                  |            |     |
 |    Host    |.7       |        |    NHC 1   |                  |    NHC 2   +-----+10.5.5.0/24
-|            +---------+        |            |                  |            |     |          
-+------------+         |        +------------+                  +------------+     |          
-                       |                                                           |          
-                  10.4.4.0/24                                                                  
+|            +---------+        |            |                  |            |     |
++------------+         |        +------------+                  +------------+     |
+                       |                                                           |
+                  10.4.4.0/24
 """
 
 # Save the Current Working Directory to find configuration files.
@@ -148,8 +148,8 @@ def _populate_iface():
 def _verify_iptables():
     tgen = get_topogen()
     # Verify iptables is installed. Required for shortcuts
-    rc, _, _ = tgen.net["nhs1"].cmd_status("iptables")
-    return False if rc == 127 else True
+    rc, _, _ = tgen.net["nhs1"].cmd_status("iptables -V")
+    return True if rc == 0 else False
 
 
 def setup_module(mod):
@@ -167,14 +167,8 @@ def setup_module(mod):
     _populate_iface()
 
     for rname, router in router_list.items():
-        router.load_config(
-            TopoRouter.RD_ZEBRA,
-            os.path.join(CWD, "{}/zebra.conf".format(rname)),
-        )
-        if rname in ("nhs1", "nhs2", "nhs3", "nhc1", "nhc2"):
-            router.load_config(
-                TopoRouter.RD_NHRP, os.path.join(CWD, "{}/nhrpd.conf".format(rname))
-            )
+        logger.info("Loading router %s" % rname)
+        router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
 
     # Initialize all routers.
     tgen.start_router()