From cf8df2f3995d553e87257a6a748905f888d97941 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 27 Feb 2021 08:57:42 +0100 Subject: smoketest: bgp: T2100: fix "simple" testcase for ebgp-requires-policy Commit 4bf55f97 ("BGP: T2100: Adding RFC8212 option toggle.") added a CLI option to enable RFC8212 ebgp-requires-policy checks. The extended smoketests assumed that this will lead to an FRR configuration line of "bgp ebgp-requires-policy" - which is not the case as this is a default option and FRR hides default options from the config. In order to properly verify this functionality we must conduct the negative test and ensure the option is not present in the CLI at all. --- interface-definitions/protocols-bgp.xml.in | 2 +- smoketest/scripts/cli/test_protocols_bgp.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/interface-definitions/protocols-bgp.xml.in b/interface-definitions/protocols-bgp.xml.in index 46b913830..cc4f9d2b6 100644 --- a/interface-definitions/protocols-bgp.xml.in +++ b/interface-definitions/protocols-bgp.xml.in @@ -815,7 +815,7 @@ - Enable RFC8212 functionality + Require in and out policy for eBGP peers (RFC8212) diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py index 607dfc116..8d42fafc3 100755 --- a/smoketest/scripts/cli/test_protocols_bgp.py +++ b/smoketest/scripts/cli/test_protocols_bgp.py @@ -241,7 +241,7 @@ class TestProtocolsBGP(unittest.TestCase): self.assertIn(f' no bgp default ipv4-unicast', frrconfig) self.assertIn(f' bgp graceful-restart stalepath-time {stalepath_time}', frrconfig) self.assertIn(f' bgp graceful-shutdown', frrconfig) - self.assertIn(f' bgp ebgp-requires-policy', frrconfig) + self.assertNotIn(f'bgp ebgp-requires-policy', frrconfig) def test_bgp_02_neighbors(self): @@ -455,6 +455,9 @@ class TestProtocolsBGP(unittest.TestCase): frrconfig = getFRRBGPconfig() self.assertIn(f'router bgp {ASN}', frrconfig) self.assertIn(f' address-family ipv6 unicast', frrconfig) + # T2100: By default ebgp-requires-policy is disabled to keep VyOS + # 1.3 and 1.2 backwards compatibility + self.assertIn(f' no bgp ebgp-requires-policy', frrconfig) for redistribute in redistributes: # FRR calls this OSPF6 -- cgit v1.2.3