diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-07-07 12:35:46 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-07-07 12:40:34 +0200 |
commit | c1d0f849d7b35765d500833028e966df2399a478 (patch) | |
tree | 3a812ae24761ec77326474e37402029ed211ec11 | |
parent | 358673e9e0ab072ffa77e1aa01e716ce72f19589 (diff) | |
download | vyos-1x-c1d0f849d7b35765d500833028e966df2399a478.tar.gz vyos-1x-c1d0f849d7b35765d500833028e966df2399a478.zip |
smoketest: dns: T4509: use dedicated 6to4 testcase
(cherry picked from commit 82945a7ff0899295776b5a4bc009fe6513bcdbda)
-rwxr-xr-x | smoketest/scripts/cli/test_service_dns_forwarding.py | 32 |
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 ed9290a6c..ccbdd16ba 100755 --- a/smoketest/scripts/cli/test_service_dns_forwarding.py +++ b/smoketest/scripts/cli/test_service_dns_forwarding.py @@ -59,7 +59,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]) @@ -76,12 +75,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']) @@ -111,10 +104,6 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase): tmp = get_config_value('export-etc-hosts') self.assertEqual(tmp, 'no') - # dns64-prefix - tmp = get_config_value('dns64-prefix') - self.assertEqual(tmp, dns_prefix) - def test_dnssec(self): # DNSSEC option testing @@ -192,5 +181,26 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase): if domain == domains[1]: self.assertIn(f'addNTA("{domain}", "static")', hosts_conf) + 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) |