summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorfvlaicu <19238716+fvlaicu@users.noreply.github.com>2024-01-06 14:02:11 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-01-06 12:02:29 +0000
commit132087a4b266deb197f86de3fc1131be7a07504c (patch)
tree9907c9c71ab63746955a49c3ff1f70e5dedc044d /smoketest/scripts/cli
parent09dea9fc44dc19181ce24cec42b49f19a4605a3e (diff)
downloadvyos-1x-132087a4b266deb197f86de3fc1131be7a07504c.tar.gz
vyos-1x-132087a4b266deb197f86de3fc1131be7a07504c.zip
dns: T5900: add dont-throttle-netmasks and serve-stale-extensions powerdns features
(cherry picked from commit 199ceb1f0a820c838dea6862371a3121b3d9f3a9)
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_service_dns_forwarding.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_dns_forwarding.py b/smoketest/scripts/cli/test_service_dns_forwarding.py
index bc50a4ffe..4f2f182e5 100755
--- a/smoketest/scripts/cli/test_service_dns_forwarding.py
+++ b/smoketest/scripts/cli/test_service_dns_forwarding.py
@@ -239,6 +239,44 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase):
tmp = get_config_value('dns64-prefix')
self.assertEqual(tmp, dns_prefix)
+ def test_exclude_throttle_adress(self):
+ exclude_throttle_adress_examples = [
+ '192.168.128.255',
+ '10.0.0.0/25',
+ '2001:db8:85a3:8d3:1319:8a2e:370:7348',
+ '64:ff9b::/96'
+ ]
+
+ for network in allow_from:
+ self.cli_set(base_path + ['allow-from', network])
+ for address in listen_adress:
+ self.cli_set(base_path + ['listen-address', address])
+
+ for exclude_throttle_adress in exclude_throttle_adress_examples:
+ self.cli_set(base_path + ['exclude-throttle-address', exclude_throttle_adress])
+
+ # commit changes
+ self.cli_commit()
+
+ # verify dont-throttle-netmasks configuration
+ tmp = get_config_value('exclude-throttle-address')
+ self.assertEqual(tmp, ','.join(exclude_throttle_adress_examples))
+
+ def test_serve_stale_extension(self):
+ for network in allow_from:
+ self.cli_set(base_path + ['allow-from', network])
+ for address in listen_adress:
+ self.cli_set(base_path + ['listen-address', address])
+
+ self.cli_set(base_path + ['serve-stale-extension', '20'])
+
+ # commit changes
+ self.cli_commit()
+
+ # verify configuration
+ tmp = get_config_value('serve-stale-extension')
+ self.assertEqual(tmp, '20')
+
def test_listening_port(self):
# We can listen on a different port compared to '53' but only one at a time
for port in ['1053', '5353']: