summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/topotests/bgp_dynamic_capability/r1/frr.conf (renamed from tests/topotests/bgp_dynamic_capability/r1/bgpd.conf)3
-rw-r--r--tests/topotests/bgp_dynamic_capability/r1/zebra.conf4
-rw-r--r--tests/topotests/bgp_dynamic_capability/r2/frr.conf (renamed from tests/topotests/bgp_dynamic_capability/r2/bgpd.conf)10
-rw-r--r--tests/topotests/bgp_dynamic_capability/r2/zebra.conf4
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py29
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py20
-rw-r--r--tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py20
7 files changed, 47 insertions, 43 deletions
diff --git a/tests/topotests/bgp_dynamic_capability/r1/bgpd.conf b/tests/topotests/bgp_dynamic_capability/r1/frr.conf
index 3d2c611775..50280a9126 100644
--- a/tests/topotests/bgp_dynamic_capability/r1/bgpd.conf
+++ b/tests/topotests/bgp_dynamic_capability/r1/frr.conf
@@ -1,6 +1,9 @@
!
!debug bgp neighbor
!
+int r1-eth0
+ ip address 192.168.1.1/24
+!
router bgp 65001
no bgp ebgp-requires-policy
bgp graceful-restart
diff --git a/tests/topotests/bgp_dynamic_capability/r1/zebra.conf b/tests/topotests/bgp_dynamic_capability/r1/zebra.conf
deleted file mode 100644
index b29940f46a..0000000000
--- a/tests/topotests/bgp_dynamic_capability/r1/zebra.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-!
-int r1-eth0
- ip address 192.168.1.1/24
-!
diff --git a/tests/topotests/bgp_dynamic_capability/r2/bgpd.conf b/tests/topotests/bgp_dynamic_capability/r2/frr.conf
index 46f0b21a14..16b83a5c58 100644
--- a/tests/topotests/bgp_dynamic_capability/r2/bgpd.conf
+++ b/tests/topotests/bgp_dynamic_capability/r2/frr.conf
@@ -1,6 +1,12 @@
!
!debug bgp neighbor
!
+int lo
+ ip address 10.10.10.10/32
+!
+int r2-eth0
+ ip address 192.168.1.2/24
+!
router bgp 65002
bgp graceful-restart
bgp long-lived stale-time 20
@@ -9,4 +15,8 @@ router bgp 65002
neighbor 192.168.1.1 timers 1 3
neighbor 192.168.1.1 timers connect 1
neighbor 192.168.1.1 capability dynamic
+ !
+ address-family ipv4 unicast
+ redistribute connected
+ exit-address-family
!
diff --git a/tests/topotests/bgp_dynamic_capability/r2/zebra.conf b/tests/topotests/bgp_dynamic_capability/r2/zebra.conf
deleted file mode 100644
index cffe827363..0000000000
--- a/tests/topotests/bgp_dynamic_capability/r2/zebra.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-!
-int r2-eth0
- ip address 192.168.1.2/24
-!
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py
index 846a68ea27..db1eb2723b 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_graceful_restart.py
@@ -38,13 +38,8 @@ def setup_module(mod):
router_list = tgen.routers()
- for i, (rname, router) in enumerate(router_list.items(), 1):
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
- router.load_config(
- TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
- )
+ for _, (rname, router) in enumerate(router_list.items(), 1):
+ router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
tgen.start_router()
@@ -85,8 +80,6 @@ def test_bgp_dynamic_capability_graceful_restart():
}
},
},
- "connectionsEstablished": 1,
- "connectionsDropped": 0,
}
}
return topotest.json_cmp(output, expected)
@@ -101,6 +94,9 @@ def test_bgp_dynamic_capability_graceful_restart():
"Change Graceful-Restart restart-time, LLGR stale-time and check if they changed dynamically"
)
+ # Clear message stats to check if we receive a notification or not after we
+ # change the settings fo LLGR.
+ r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r2.vtysh_cmd(
"""
configure terminal
@@ -132,8 +128,10 @@ def test_bgp_dynamic_capability_graceful_restart():
}
},
},
- "connectionsEstablished": 1,
- "connectionsDropped": 0,
+ "messageStats": {
+ "notificationsRecv": 0,
+ "capabilityRecv": 2,
+ },
}
}
return topotest.json_cmp(output, expected)
@@ -150,6 +148,9 @@ def test_bgp_dynamic_capability_graceful_restart():
"Disable Graceful-Restart notification support, and check if it's changed dynamically"
)
+ # Clear message stats to check if we receive a notification or not after we
+ # change the settings fo LLGR.
+ r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r2.vtysh_cmd(
"""
configure terminal
@@ -180,8 +181,10 @@ def test_bgp_dynamic_capability_graceful_restart():
}
},
},
- "connectionsEstablished": 1,
- "connectionsDropped": 0,
+ "messageStats": {
+ "notificationsRecv": 0,
+ "capabilityRecv": 1,
+ },
}
}
return topotest.json_cmp(output, expected)
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py
index 9f37440566..da45110e39 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_role.py
@@ -36,13 +36,8 @@ def setup_module(mod):
router_list = tgen.routers()
- for i, (rname, router) in enumerate(router_list.items(), 1):
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
- router.load_config(
- TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
- )
+ for _, (rname, router) in enumerate(router_list.items(), 1):
+ router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
tgen.start_router()
@@ -71,8 +66,6 @@ def test_bgp_dynamic_capability_role():
"neighborCapabilities": {
"dynamic": "advertisedAndReceived",
},
- "connectionsEstablished": 1,
- "connectionsDropped": 0,
}
}
return topotest.json_cmp(output, expected)
@@ -85,6 +78,9 @@ def test_bgp_dynamic_capability_role():
step("Set local-role and check if it's exchanged dynamically")
+ # Clear message stats to check if we receive a notification or not after we
+ # change the settings fo LLGR.
+ r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r1.vtysh_cmd(
"""
configure terminal
@@ -112,8 +108,10 @@ def test_bgp_dynamic_capability_role():
"dynamic": "advertisedAndReceived",
"role": "advertisedAndReceived",
},
- "connectionsEstablished": 1,
- "connectionsDropped": 0,
+ "messageStats": {
+ "notificationsRecv": 0,
+ "capabilityRecv": 1,
+ },
}
}
return topotest.json_cmp(output, expected)
diff --git a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py
index eb81ffeb69..d1069a876b 100644
--- a/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py
+++ b/tests/topotests/bgp_dynamic_capability/test_bgp_dynamic_capability_software_version.py
@@ -36,13 +36,8 @@ def setup_module(mod):
router_list = tgen.routers()
- for i, (rname, router) in enumerate(router_list.items(), 1):
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
- router.load_config(
- TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
- )
+ for _, (rname, router) in enumerate(router_list.items(), 1):
+ router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
tgen.start_router()
@@ -73,8 +68,6 @@ def test_bgp_dynamic_capability_software_version():
"receivedSoftwareVersion": None,
},
},
- "connectionsEstablished": 1,
- "connectionsDropped": 0,
}
}
return topotest.json_cmp(output, expected)
@@ -87,6 +80,9 @@ def test_bgp_dynamic_capability_software_version():
step("Enable software version capability and check if it's exchanged dynamically")
+ # Clear message stats to check if we receive a notification or not after we
+ # change the settings fo LLGR.
+ r1.vtysh_cmd("clear bgp 192.168.1.2 message-stats")
r1.vtysh_cmd(
"""
configure terminal
@@ -133,8 +129,10 @@ def test_bgp_dynamic_capability_software_version():
"receivedSoftwareVersion": rcv,
},
},
- "connectionsEstablished": 1,
- "connectionsDropped": 0,
+ "messageStats": {
+ "notificationsRecv": 0,
+ "capabilityRecv": 1,
+ },
}
}
return topotest.json_cmp(output, expected)