summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp_dont_capability_negotiate
diff options
context:
space:
mode:
authorFrancois Dumontet <francois.dumontet@6wind.com>2024-01-22 14:19:32 +0100
committerFrancois Dumontet <francois.dumontet@6wind.com>2024-02-02 11:31:47 +0100
commit220c0635a85d4955883135459954782c5755270c (patch)
tree1562ba76d54be668a95698cf53201613aae9e1ff /tests/topotests/bgp_dont_capability_negotiate
parente146ea53ef5a8f33d9bdb2f79410682fe710e37c (diff)
tests: improve topotest bgp_dont_capability_negotiate
add some steps for testing of add [no]neighbor capability fqdn command support. Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
Diffstat (limited to 'tests/topotests/bgp_dont_capability_negotiate')
-rw-r--r--tests/topotests/bgp_dont_capability_negotiate/test_bgp_dont_capability_negotiate.py45
1 files changed, 44 insertions, 1 deletions
diff --git a/tests/topotests/bgp_dont_capability_negotiate/test_bgp_dont_capability_negotiate.py b/tests/topotests/bgp_dont_capability_negotiate/test_bgp_dont_capability_negotiate.py
index ab71f87a04..9a0f5621dc 100644
--- a/tests/topotests/bgp_dont_capability_negotiate/test_bgp_dont_capability_negotiate.py
+++ b/tests/topotests/bgp_dont_capability_negotiate/test_bgp_dont_capability_negotiate.py
@@ -122,8 +122,9 @@ def test_bgp_check_fqdn():
step("Wait to converge")
test_func = functools.partial(bgp_converge, r1)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
- assert result is None, "Can't converge with dont-capability-negotiate"
+ assert result is None, "Can't converge with all capabilities"
+ step("Make sure FQDN capability is set")
test_func = functools.partial(_bgp_check_fqdn, "r2")
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "FQDN capability enabled, but r1 can't see it"
@@ -150,6 +151,48 @@ def test_bgp_check_fqdn():
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "FQDN capability disabled, but we still have a hostname"
+ step("Re-enable sending any capability from r2")
+ r2.vtysh_cmd(
+ """
+ configure terminal
+ router bgp 65002
+ address-family ipv4 unicast
+ no neighbor 192.168.1.1 dont-capability-negotiate
+ end
+ clear bgp 192.168.1.1
+ """
+ )
+ step("Wait to converge")
+ tgen = get_topogen()
+ test_func = functools.partial(bgp_converge, r1)
+ _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+ assert result is None, "Can't converge with all capabilities re enabled"
+
+ step("Make sure FQDN capability is r2")
+ test_func = functools.partial(_bgp_check_fqdn, "r2")
+ _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+ assert result is None, "FQDN capability enabled, but r1 can't see it"
+
+ step("Disable sending fqdn capability")
+ r2.vtysh_cmd(
+ """
+ configure terminal
+ router bgp 65002
+ no neighbor 192.168.1.1 capability fqdn
+ end
+ clear bgp 192.168.1.1
+ """
+ )
+ step("Wait to converge")
+ tgen = get_topogen()
+ test_func = functools.partial(bgp_converge, r1)
+ _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+ assert result is None, "Can't converge with no capability fqdn"
+
+ step("Make sure FQDN capability is reset")
+ test_func = functools.partial(_bgp_check_fqdn)
+ _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+ assert result is None, "FQDN capability disabled, but we still have a hostname"
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]