summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_service_dns_forwarding.py32
1 files changed, 21 insertions, 11 deletions
diff --git a/smoketest/scripts/cli/test_service_dns_forwarding.py b/smoketest/scripts/cli/test_service_dns_forwarding.py
index 117b11a8a..65b676451 100755
--- a/smoketest/scripts/cli/test_service_dns_forwarding.py
+++ b/smoketest/scripts/cli/test_service_dns_forwarding.py
@@ -62,7 +62,6 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase):
# Check basic DNS forwarding settings
cache_size = '20'
negative_ttl = '120'
- dns_prefix = '64:ff9b::/96'
self.cli_set(base_path + ['cache-size', cache_size])
self.cli_set(base_path + ['negative-ttl', negative_ttl])
@@ -79,12 +78,6 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase):
for address in listen_adress:
self.cli_set(base_path + ['listen-address', address])
- # Check dns64-prefix - must be prefix /96
- self.cli_set(base_path + ['dns64-prefix', '2001:db8:aabb::/64'])
- with self.assertRaises(ConfigSessionError):
- self.cli_commit()
- self.cli_set(base_path + ['dns64-prefix', dns_prefix])
-
# configure DNSSEC
self.cli_set(base_path + ['dnssec', 'validate'])
@@ -118,10 +111,6 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase):
tmp = get_config_value('serve-rfc1918')
self.assertEqual(tmp, 'yes')
- # dns64-prefix
- tmp = get_config_value('dns64-prefix')
- self.assertEqual(tmp, dns_prefix)
-
def test_dnssec(self):
# DNSSEC option testing
@@ -214,5 +203,26 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase):
tmp = get_config_value('serve-rfc1918')
self.assertEqual(tmp, 'no')
+ def test_dns64(self):
+ dns_prefix = '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])
+
+ # Check dns64-prefix - must be prefix /96
+ self.cli_set(base_path + ['dns64-prefix', '2001:db8:aabb::/64'])
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+ self.cli_set(base_path + ['dns64-prefix', dns_prefix])
+
+ # commit changes
+ self.cli_commit()
+
+ # verify dns64-prefix configuration
+ tmp = get_config_value('dns64-prefix')
+ self.assertEqual(tmp, dns_prefix)
+
if __name__ == '__main__':
unittest.main(verbosity=2)