]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Modify simple_snmp_test to use frr.conf 18508/head
authorDonald Sharp <sharpd@nvidia.com>
Wed, 26 Mar 2025 15:14:57 +0000 (11:14 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 26 Mar 2025 15:14:57 +0000 (11:14 -0400)
The simple_snmp_test was not properly testing
the rip snmp code because of weirdness w/ mgmtd
and non-integrated configs.  Modify the whole
test to use a integrated config and voila
ripd is talking snmp again in the test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests/topotests/simple_snmp_test/r1/bgpd.conf [deleted file]
tests/topotests/simple_snmp_test/r1/frr.conf [new file with mode: 0644]
tests/topotests/simple_snmp_test/r1/isisd.conf [deleted file]
tests/topotests/simple_snmp_test/r1/ospf6d.conf [deleted file]
tests/topotests/simple_snmp_test/r1/ospfd.conf [deleted file]
tests/topotests/simple_snmp_test/r1/ripd.conf [deleted file]
tests/topotests/simple_snmp_test/r1/zebra.conf [deleted file]
tests/topotests/simple_snmp_test/test_simple_snmp.py

diff --git a/tests/topotests/simple_snmp_test/r1/bgpd.conf b/tests/topotests/simple_snmp_test/r1/bgpd.conf
deleted file mode 100644 (file)
index bcdf1c4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-!
-router bgp 100
- bgp router-id 1.1.1.1
-
-agentx
diff --git a/tests/topotests/simple_snmp_test/r1/frr.conf b/tests/topotests/simple_snmp_test/r1/frr.conf
new file mode 100644 (file)
index 0000000..0b66a1f
--- /dev/null
@@ -0,0 +1,77 @@
+hostname r1
+log timestamp precision 6
+agentx
+!
+interface lo
+ ip address 1.1.1.1/32
+ ip router isis ISIS1
+ ipv6 address 2000:1:1:1::1/128
+ ipv6 router isis ISIS1
+ isis circuit-type level-1
+ isis passive
+ no isis hello padding
+exit
+!
+interface r1-eth0
+ ip address 192.168.12.12/24
+ ip ospf area 0.0.0.0
+ ip router isis ISIS1
+ ipv6 address 2000:1:1:12::12/64
+ ipv6 ospf6 area 0.0.0.0
+ ipv6 router isis ISIS1
+ isis circuit-type level-1
+ isis hello-interval 1
+ isis network point-to-point
+ no isis hello padding
+exit
+!
+interface r1-eth1
+ ip address 192.168.13.13/24
+ ip ospf area 0.0.0.0
+ ip router isis ISIS1
+ ipv6 address 2000:1:1:13::13/64
+ ipv6 ospf6 area 0.0.0.0
+ ipv6 router isis ISIS1
+ isis circuit-type level-1
+ isis hello-interval 1
+ isis network point-to-point
+ no isis hello padding
+exit
+!
+interface r1-eth2
+ ip address 192.168.14.14/24
+ ip ospf area 0.0.0.0
+ ip router isis ISIS1
+ ipv6 address 2000:1:1:14::14/64
+ ipv6 ospf6 area 0.0.0.0
+ ipv6 router isis ISIS1
+ isis circuit-type level-1
+ isis hello-interval 1
+ isis network point-to-point
+ no isis hello padding
+exit
+!
+router rip
+ network 0.0.0.0/0
+ redistribute local
+exit
+!
+router bgp 100
+ bgp router-id 1.1.1.1
+exit
+!
+router ospf
+ redistribute local
+exit
+!
+router ospf6
+ redistribute local
+exit
+!
+router isis ISIS1
+ is-type level-1
+ net 01.1111.0000.0000.0001.00
+ topology ipv6-unicast
+exit
+!
+end
diff --git a/tests/topotests/simple_snmp_test/r1/isisd.conf b/tests/topotests/simple_snmp_test/r1/isisd.conf
deleted file mode 100644 (file)
index c53d250..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-log stdout debugging
-!
-! debug isis route-events
-! debug isis events
-!
-agentx
-!
-interface r1-eth0
-  ip router isis ISIS1
-  ipv6 router isis ISIS1
-  isis circuit-type level-1
-  no isis hello padding
-  isis hello-interval 1
-  isis hello-multiplier 10
-  isis network point-to-point
-!
-interface r1-eth1
-  ip router isis ISIS1
-  ipv6 router isis ISIS1
-  isis circuit-type level-1
-  no isis hello padding
-  isis hello-interval 1
-  isis hello-multiplier 10
-  isis network point-to-point
-!
-interface r1-eth2
-  ip router isis ISIS1
-  ipv6 router isis ISIS1
-  isis circuit-type level-1
-  no isis hello padding
-  isis hello-interval 1
-  isis hello-multiplier 10
-  isis network point-to-point
-!
-interface lo
-  ip router isis ISIS1
-  ipv6 router isis ISIS1
-  isis circuit-type level-1
-  isis passive
-  no isis hello padding
-!
-router isis ISIS1
- net 01.1111.0000.0000.0001.00
- is-type level-1
- topology ipv6-unicast
-!
-line vty
-!
diff --git a/tests/topotests/simple_snmp_test/r1/ospf6d.conf b/tests/topotests/simple_snmp_test/r1/ospf6d.conf
deleted file mode 100644 (file)
index e811517..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-agentx
-
-int r1-eth0
-  ipv6 ospf6 area 0.0.0.0
-
-int r1-eth1
-  ipv6 ospf6 area 0.0.0.0
-int r1-eth2
-  ipv6 ospf6 area 0.0.0.0
-
-router ospf6
-  redistribute local
\ No newline at end of file
diff --git a/tests/topotests/simple_snmp_test/r1/ospfd.conf b/tests/topotests/simple_snmp_test/r1/ospfd.conf
deleted file mode 100644 (file)
index cc0d9e5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-agentx
-
-int r1-eth0
-  ip ospf area 0.0.0.0
-int r1-eth1
-  ip ospf area 0.0.0.0
-int r1-eth2
-  ip ospf area 0.0.0.0
-
-router ospf
-  redistribute local
\ No newline at end of file
diff --git a/tests/topotests/simple_snmp_test/r1/ripd.conf b/tests/topotests/simple_snmp_test/r1/ripd.conf
deleted file mode 100644 (file)
index 71cdb05..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-!
-!
-router rip
-  network 0.0.0.0/0
-  redistribute local
-!
-agentx
-!
\ No newline at end of file
diff --git a/tests/topotests/simple_snmp_test/r1/zebra.conf b/tests/topotests/simple_snmp_test/r1/zebra.conf
deleted file mode 100644 (file)
index 6483a66..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-log file zebra.log
-!
-agentx
-!
-interface r1-eth0
- ip address 192.168.12.12/24
- ipv6 address 2000:1:1:12::12/64 
-!
-interface r1-eth1
- ip address 192.168.13.13/24
- ipv6 address 2000:1:1:13::13/64 
-!
-interface r1-eth2
- ip address 192.168.14.14/24
- ipv6 address 2000:1:1:14::14/64 
-!
-!
-interface lo
- ip address 1.1.1.1/32
- ipv6 address 2000:1:1:1::1/128
-!
-!
-line vty
index c74ffcc2db5c4dfbd26f1ed3de86d0a4f0b46edb..24c6a5cb53a6a5cfae9ccf4cbf6bcc3c65ab4584 100755 (executable)
@@ -59,41 +59,21 @@ def setup_module(mod):
 
     # For all registered routers, load the zebra configuration file
     for rname, router in router_list.items():
-        router.load_config(
-            TopoRouter.RD_ZEBRA,
-            os.path.join(CWD, "{}/zebra.conf".format(rname)),
-            "-M snmp",
-        )
-        router.load_config(
-            TopoRouter.RD_ISIS,
-            os.path.join(CWD, "{}/isisd.conf".format(rname)),
-            "-M snmp",
-        )
-        router.load_config(
-            TopoRouter.RD_BGP,
-            os.path.join(CWD, "{}/bgpd.conf".format(rname)),
-            "-M snmp",
-        )
-        router.load_config(
-            TopoRouter.RD_RIP,
-            os.path.join(CWD, "{}/ripd.conf".format(rname)),
-            "-M snmp",
-        )
-        router.load_config(
-            TopoRouter.RD_OSPF,
-            os.path.join(CWD, "{}/ospfd.conf".format(rname)),
-            "-M snmp",
-        )
-        router.load_config(
-            TopoRouter.RD_OSPF6,
-            os.path.join(CWD, "{}/ospf6d.conf".format(rname)),
-            "-M snmp",
-        )
-        router.load_config(
-            TopoRouter.RD_SNMP,
-            os.path.join(CWD, "{}/snmpd.conf".format(rname)),
-            "-Le -Ivacm_conf,usmConf,iquery -V -DAgentX,trap",
+        router.load_frr_config(
+            os.path.join(CWD, "{}/frr.conf".format(rname)),
+            [
+                (TopoRouter.RD_ZEBRA, "-M snmp"),
+                (TopoRouter.RD_ISIS, "-M snmp"),
+                (TopoRouter.RD_BGP, "-M snmp"),
+                (TopoRouter.RD_RIP, "-M snmp"),
+                (TopoRouter.RD_OSPF, "-M snmp"),
+                (TopoRouter.RD_OSPF6, "-M snmp"),
+            ],
         )
+        router.load_config(TopoRouter.RD_SNMP,
+                           os.path.join(CWD, "{}/snmpd.conf".format(rname)),
+                           "-Le -Ivacm_conf,usmConf,iquery -V -DAgentX,trap")
+
 
     # After loading the configurations, this function loads configured daemons.
     tgen.start_router()
@@ -138,8 +118,8 @@ def test_r1_bgp_version():
     )
 
     assert r1_snmp.test_oid("ISIS-MIB::isisSysVersion", "one(1)")
-    # rip is not auto-loading agentx from mgmtd
-    assert r1_snmp.test_oid("RIPv2-MIB::rip2GlobalQueries", "0")
+
+    assert r1_snmp.test_oid("RIPv2-MIB::rip2GlobalQueries", "0")
 
     assert r1_snmp.test_oid("OSPF-MIB::ospfVersionNumber", "version2(2)")
     assert r1_snmp.test_oid("OSPFV3-MIB::ospfv3VersionNumber", "version3(3)")