summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-07 17:54:50 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-02-08 21:57:03 +0000
commit402aba6cdb4e5a2e19edfd1a8c4bda6624bfb6e4 (patch)
treec12e76e2c053395bf9d64d6322dce71dd6670b8a
parenta2f58cd50cf911e1ac9b4fb0646ab49522bee985 (diff)
downloadvyos-1x-402aba6cdb4e5a2e19edfd1a8c4bda6624bfb6e4.tar.gz
vyos-1x-402aba6cdb4e5a2e19edfd1a8c4bda6624bfb6e4.zip
rpki: T6023: add support for CLI knobs expire-interval and retry-interval
(cherry picked from commit 17894f6f5d97df7d3ac1cf37ce0e1a96b8fa8e8b)
-rw-r--r--data/templates/frr/rpki.frr.j26
-rw-r--r--interface-definitions/protocols_rpki.xml.in30
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_rpki.py25
3 files changed, 48 insertions, 13 deletions
diff --git a/data/templates/frr/rpki.frr.j2 b/data/templates/frr/rpki.frr.j2
index 384cbbe52..59724102c 100644
--- a/data/templates/frr/rpki.frr.j2
+++ b/data/templates/frr/rpki.frr.j2
@@ -11,8 +11,14 @@ rpki
{% endif %}
{% endfor %}
{% endif %}
+{% if expire_interval is vyos_defined %}
+ rpki expire_interval {{ expire_interval }}
+{% endif %}
{% if polling_period is vyos_defined %}
rpki polling_period {{ polling_period }}
{% endif %}
+{% if retry_interval is vyos_defined %}
+ rpki retry_interval {{ retry_interval }}
+{% endif %}
exit
!
diff --git a/interface-definitions/protocols_rpki.xml.in b/interface-definitions/protocols_rpki.xml.in
index 6a38b2961..a2a0a2799 100644
--- a/interface-definitions/protocols_rpki.xml.in
+++ b/interface-definitions/protocols_rpki.xml.in
@@ -67,12 +67,25 @@
</node>
</children>
</tagNode>
+ <leafNode name="expire-interval">
+ <properties>
+ <help>Interval to wait before expiring the cache</help>
+ <valueHelp>
+ <format>u32:600-172800</format>
+ <description>Interval in seconds</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 600-172800"/>
+ </constraint>
+ </properties>
+ <defaultValue>7200</defaultValue>
+ </leafNode>
<leafNode name="polling-period">
<properties>
- <help>RPKI cache polling period</help>
+ <help>Cache polling interval</help>
<valueHelp>
<format>u32:1-86400</format>
- <description>Polling period in seconds</description>
+ <description>Interval in seconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-86400"/>
@@ -80,6 +93,19 @@
</properties>
<defaultValue>300</defaultValue>
</leafNode>
+ <leafNode name="retry-interval">
+ <properties>
+ <help>Retry interval to connect to the cache server</help>
+ <valueHelp>
+ <format>u32:1-7200</format>
+ <description>Interval in seconds</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-7200"/>
+ </constraint>
+ </properties>
+ <defaultValue>600</defaultValue>
+ </leafNode>
</children>
</node>
</children>
diff --git a/smoketest/scripts/cli/test_protocols_rpki.py b/smoketest/scripts/cli/test_protocols_rpki.py
index b43c626c4..c52c0dd76 100755
--- a/smoketest/scripts/cli/test_protocols_rpki.py
+++ b/smoketest/scripts/cli/test_protocols_rpki.py
@@ -52,27 +52,28 @@ class TestProtocolsRPKI(VyOSUnitTestSHIM.TestCase):
self.assertEqual(self.daemon_pid, process_named_running(PROCESS_NAME))
def test_rpki(self):
- polling = '7200'
+ expire_interval = '3600'
+ polling_period = '600'
+ retry_interval = '300'
cache = {
'192.0.2.1' : {
'port' : '8080',
- 'preference' : '1'
- },
- '192.0.2.2' : {
- 'port' : '9090',
- 'preference' : '2'
+ 'preference' : '10'
},
'2001:db8::1' : {
'port' : '1234',
- 'preference' : '3'
+ 'preference' : '30'
},
- '2001:db8::2' : {
+ 'rpki.vyos.net' : {
'port' : '5678',
- 'preference' : '4'
+ 'preference' : '40'
},
}
- self.cli_set(base_path + ['polling-period', polling])
+ self.cli_set(base_path + ['expire-interval', expire_interval])
+ self.cli_set(base_path + ['polling-period', polling_period])
+ self.cli_set(base_path + ['retry-interval', retry_interval])
+
for peer, peer_config in cache.items():
self.cli_set(base_path + ['cache', peer, 'port', peer_config['port']])
self.cli_set(base_path + ['cache', peer, 'preference', peer_config['preference']])
@@ -82,7 +83,9 @@ class TestProtocolsRPKI(VyOSUnitTestSHIM.TestCase):
# Verify FRR configuration
frrconfig = self.getFRRconfig('rpki')
- self.assertIn(f'rpki polling_period {polling}', frrconfig)
+ self.assertIn(f'rpki expire_interval {expire_interval}', frrconfig)
+ self.assertIn(f'rpki polling_period {polling_period}', frrconfig)
+ self.assertIn(f'rpki retry_interval {retry_interval}', frrconfig)
for peer, peer_config in cache.items():
port = peer_config['port']