summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-14 10:09:50 +0100
committerChristian Poessinger <christian@poessinger.com>2021-02-14 10:09:50 +0100
commitd468102e66ff7ed784d794e6884983669bba108e (patch)
tree0890ccf753d54e8560f5520cebca9a8a39bbbed7
parent0c814f19cdc81360005055dbf24b627ba6449877 (diff)
downloadvyos-1x-d468102e66ff7ed784d794e6884983669bba108e.tar.gz
vyos-1x-d468102e66ff7ed784d794e6884983669bba108e.zip
bgp: T3308: add graceful-shutdown option
-rw-r--r--data/templates/frr/bgp.frr.tmpl3
-rw-r--r--interface-definitions/protocols-bgp.xml.in6
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py5
3 files changed, 14 insertions, 0 deletions
diff --git a/data/templates/frr/bgp.frr.tmpl b/data/templates/frr/bgp.frr.tmpl
index 792146be0..8db6015d0 100644
--- a/data/templates/frr/bgp.frr.tmpl
+++ b/data/templates/frr/bgp.frr.tmpl
@@ -340,6 +340,9 @@ router bgp {{ asn }}
{% if parameters.graceful_restart is defined %}
bgp graceful-restart {{ 'stalepath-time ' + parameters.graceful_restart.stalepath_time if parameters.graceful_restart.stalepath_time is defined }}
{% endif %}
+{% if parameters.graceful_shutdown is defined %}
+ bgp graceful-shutdown
+{% endif %}
{% if parameters.log_neighbor_changes is defined %}
bgp log-neighbor-changes
{% endif %}
diff --git a/interface-definitions/protocols-bgp.xml.in b/interface-definitions/protocols-bgp.xml.in
index 13caa7b63..d7bc86aff 100644
--- a/interface-definitions/protocols-bgp.xml.in
+++ b/interface-definitions/protocols-bgp.xml.in
@@ -852,6 +852,12 @@
</leafNode>
</children>
</node>
+ <leafNode name="graceful-shutdown">
+ <properties>
+ <help>Graceful shutdown</help>
+ <valueless/>
+ </properties>
+ </leafNode>
<leafNode name="log-neighbor-changes">
<properties>
<help>Log neighbor up/down changes and reset reason</help>
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 30d98976d..8bbf0a5d1 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -166,6 +166,7 @@ class TestProtocolsBGP(unittest.TestCase):
def test_bgp_01_simple(self):
router_id = '127.0.0.1'
local_pref = '500'
+ stalepath_time = '60'
self.session.set(base_path + ['parameters', 'router-id', router_id])
self.session.set(base_path + ['parameters', 'log-neighbor-changes'])
@@ -173,6 +174,8 @@ class TestProtocolsBGP(unittest.TestCase):
self.session.set(base_path + ['parameters', 'default', 'local-pref', local_pref])
# Deactivate IPv4 unicast for a peer by default
self.session.set(base_path + ['parameters', 'default', 'no-ipv4-unicast'])
+ self.session.set(base_path + ['parameters', 'graceful-restart', 'stalepath-time', stalepath_time])
+ self.session.set(base_path + ['parameters', 'graceful-shutdown'])
# commit changes
self.session.commit()
@@ -184,6 +187,8 @@ class TestProtocolsBGP(unittest.TestCase):
self.assertIn(f' bgp log-neighbor-changes', frrconfig)
self.assertIn(f' bgp default local-preference {local_pref}', frrconfig)
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)
def test_bgp_02_neighbors(self):