summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2025-03-26 11:14:57 -0400
committerDonald Sharp <sharpd@nvidia.com>2025-03-26 11:14:57 -0400
commite23d2f197c27dd54bd0ea954bd7e11566aed8611 (patch)
treeff4312188fee503115b6d620437ee0b1fa29a3c2 /tests
parent8ca4376e01a78075bc112b1c10717d3dc29fcae6 (diff)
tests: Modify simple_snmp_test to use frr.conf
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/topotests/simple_snmp_test/r1/bgpd.conf5
-rw-r--r--tests/topotests/simple_snmp_test/r1/frr.conf77
-rw-r--r--tests/topotests/simple_snmp_test/r1/isisd.conf48
-rw-r--r--tests/topotests/simple_snmp_test/r1/ospf6d.conf12
-rw-r--r--tests/topotests/simple_snmp_test/r1/ospfd.conf11
-rw-r--r--tests/topotests/simple_snmp_test/r1/ripd.conf8
-rw-r--r--tests/topotests/simple_snmp_test/r1/zebra.conf23
-rwxr-xr-xtests/topotests/simple_snmp_test/test_simple_snmp.py52
8 files changed, 93 insertions, 143 deletions
diff --git a/tests/topotests/simple_snmp_test/r1/bgpd.conf b/tests/topotests/simple_snmp_test/r1/bgpd.conf
deleted file mode 100644
index bcdf1c4f7e..0000000000
--- a/tests/topotests/simple_snmp_test/r1/bgpd.conf
+++ /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
index 0000000000..0b66a1f7b2
--- /dev/null
+++ b/tests/topotests/simple_snmp_test/r1/frr.conf
@@ -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
index c53d2509e2..0000000000
--- a/tests/topotests/simple_snmp_test/r1/isisd.conf
+++ /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
index e81151710b..0000000000
--- a/tests/topotests/simple_snmp_test/r1/ospf6d.conf
+++ /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
index cc0d9e52c2..0000000000
--- a/tests/topotests/simple_snmp_test/r1/ospfd.conf
+++ /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
index 71cdb058cf..0000000000
--- a/tests/topotests/simple_snmp_test/r1/ripd.conf
+++ /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
index 6483a661ce..0000000000
--- a/tests/topotests/simple_snmp_test/r1/zebra.conf
+++ /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
diff --git a/tests/topotests/simple_snmp_test/test_simple_snmp.py b/tests/topotests/simple_snmp_test/test_simple_snmp.py
index c74ffcc2db..24c6a5cb53 100755
--- a/tests/topotests/simple_snmp_test/test_simple_snmp.py
+++ b/tests/topotests/simple_snmp_test/test_simple_snmp.py
@@ -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)")