summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-27 10:32:01 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-27 10:32:01 +0100
commit2e9116e9661ce355dedf5f9d0a2afb1fdbedf786 (patch)
treef999edc1cd585a1d6ad0efe3b5ee9d8450fedcdf
parent374bd7b2c5609fe9ee280262395aa6e101a20d8d (diff)
downloadvyos-1x-2e9116e9661ce355dedf5f9d0a2afb1fdbedf786.tar.gz
vyos-1x-2e9116e9661ce355dedf5f9d0a2afb1fdbedf786.zip
ospf: T3753: adjust to CLI options new in FRR 8.0
-rw-r--r--data/templates/frr/ospfd.frr.tmpl13
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospf.py39
2 files changed, 14 insertions, 38 deletions
diff --git a/data/templates/frr/ospfd.frr.tmpl b/data/templates/frr/ospfd.frr.tmpl
index 90a6bbd56..f65bb6e74 100644
--- a/data/templates/frr/ospfd.frr.tmpl
+++ b/data/templates/frr/ospfd.frr.tmpl
@@ -49,6 +49,11 @@ interface {{ iface }} {{ 'vrf ' + vrf if vrf is defined and vrf is not none }}
{% if iface_config.network is defined and iface_config.network is not none %}
ip ospf network {{ iface_config.network }}
{% endif %}
+{% if passive_interface_exclude is defined and passive_interface_exclude is not none %}
+{% if iface in passive_interface_exclude %}
+ no ip ospf passive
+{% endif %}
+{% endif %}
!
{% endfor %}
{% endif %}
@@ -163,14 +168,6 @@ router ospf {{ 'vrf ' + vrf if vrf is defined and vrf is not none }}
passive-interface {{ interface }}
{% endfor %}
{% endif %}
-{% if passive_interface_exclude is defined and passive_interface_exclude is not none %}
-{% for interface in passive_interface_exclude if passive_interface_exclude is defined %}
-{% if interface.startswith('vlink') %}
-{% set interface = interface.upper() %}
-{% endif %}
- no passive-interface {{ interface }}
-{% endfor %}
-{% endif %}
{% if redistribute is defined and redistribute is not none %}
{% for protocol, protocols_options in redistribute.items() %}
{% if protocol == 'table' %}
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py
index 0529eefbd..65bfd1824 100755
--- a/smoketest/scripts/cli/test_protocols_ospf.py
+++ b/smoketest/scripts/cli/test_protocols_ospf.py
@@ -189,31 +189,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
for neighbor in neighbors:
self.assertIn(f' neighbor {neighbor} priority {priority} poll-interval {poll_interval}', frrconfig) # default
-
- def test_ospf_07_passive_interface(self):
- self.cli_set(base_path + ['passive-interface', 'default'])
- interfaces = Section.interfaces('ethernet')
- for interface in interfaces:
- self.cli_set(base_path + ['passive-interface-exclude', interface])
-
- # commit changes
- self.cli_commit()
-
- # Verify FRR ospfd configuration
- frrconfig = self.getFRRconfig('router ospf')
- try:
- self.assertIn(f'router ospf', frrconfig)
- self.assertIn(f' passive-interface default', frrconfig) # default
- for interface in interfaces:
- self.assertIn(f' no passive-interface {interface}', frrconfig) # default
- except:
- log.debug(frrconfig)
- log.debug(cmd('sudo dmesg'))
- log.debug(cmd('sudo cat /var/log/messages'))
- log.debug(cmd('vtysh -c "show run"'))
- self.fail('Now we can hopefully see why OSPF fails!')
-
- def test_ospf_08_redistribute(self):
+ def test_ospf_07_redistribute(self):
metric = '15'
metric_type = '1'
redistribute = ['bgp', 'connected', 'isis', 'kernel', 'rip', 'static']
@@ -238,7 +214,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
log.debug(cmd('vtysh -c "show run"'))
self.fail('Now we can hopefully see why OSPF fails!')
- def test_ospf_09_virtual_link(self):
+ def test_ospf_08_virtual_link(self):
networks = ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
area = '10'
shortcut = 'enable'
@@ -268,7 +244,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
self.assertIn(f' network {network} area {area}', frrconfig)
- def test_ospf_10_interface_configuration(self):
+ def test_ospf_09_interface_configuration(self):
interfaces = Section.interfaces('ethernet')
password = 'vyos1234'
bandwidth = '10000'
@@ -276,6 +252,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
network = 'point-to-point'
priority = '200'
+ self.cli_set(base_path + ['passive-interface', 'default'])
for interface in interfaces:
self.cli_set(base_path + ['interface', interface, 'authentication', 'plaintext-password', password])
self.cli_set(base_path + ['interface', interface, 'bandwidth', bandwidth])
@@ -284,6 +261,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
self.cli_set(base_path + ['interface', interface, 'mtu-ignore'])
self.cli_set(base_path + ['interface', interface, 'network', network])
self.cli_set(base_path + ['interface', interface, 'priority', priority])
+ self.cli_set(base_path + ['passive-interface-exclude', interface])
# commit changes
self.cli_commit()
@@ -297,10 +275,11 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
self.assertIn(f' ip ospf mtu-ignore', config)
self.assertIn(f' ip ospf network {network}', config)
self.assertIn(f' ip ospf priority {priority}', config)
+ self.assertIn(f' no ip ospf passive', config)
self.assertIn(f' bandwidth {bandwidth}', config)
- def test_ospf_11_vrfs(self):
+ def test_ospf_10_vrfs(self):
# It is safe to assume that when the basic VRF test works, all
# other OSPF related features work, as we entirely inherit the CLI
# templates and Jinja2 FRR template.
@@ -331,7 +310,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
self.cli_delete(['interfaces', 'ethernet', vrf_iface, 'vrf'])
- def test_ospf_12_zebra_route_map(self):
+ def test_ospf_11_zebra_route_map(self):
# Implemented because of T3328
self.cli_set(base_path + ['route-map', route_map])
# commit changes
@@ -351,7 +330,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
frrconfig = self.getFRRconfig(zebra_route_map)
self.assertNotIn(zebra_route_map, frrconfig)
- def test_ospf_13_interface_area(self):
+ def test_ospf_12_interface_area(self):
area = '0'
interfaces = Section.interfaces('ethernet')