summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-05 21:36:49 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-05 21:36:49 +0200
commit259d0cd0d0296726d02f4613de20cadb5505ea7c (patch)
tree1d0544cf999421c7ee12718b0d6eec7e96e0621f /smoketest
parent56c6bd3d517e2bac5e4adf3f813c17079547c002 (diff)
downloadvyos-1x-259d0cd0d0296726d02f4613de20cadb5505ea7c.tar.gz
vyos-1x-259d0cd0d0296726d02f4613de20cadb5505ea7c.zip
smoketest: dns: T3277: add testcase for "serve rfc1918" zones
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_service_dns_forwarding.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_service_dns_forwarding.py b/smoketest/scripts/cli/test_service_dns_forwarding.py
index 28336fd43..45ca618cb 100755
--- a/smoketest/scripts/cli/test_service_dns_forwarding.py
+++ b/smoketest/scripts/cli/test_service_dns_forwarding.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2020 VyOS maintainers and contributors
+# Copyright (C) 2019-2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -97,6 +97,10 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase):
tmp = get_config_value('export-etc-hosts')
self.assertEqual(tmp, 'no')
+ # RFC1918 addresses are looked up by default
+ tmp = get_config_value('serve-rfc1918')
+ self.assertEqual(tmp, 'yes')
+
# Check for running process
self.assertTrue(process_named_running(PROCESS_NAME))
@@ -186,6 +190,24 @@ class TestServicePowerDNS(VyOSUnitTestSHIM.TestCase):
# Check for running process
self.assertTrue(process_named_running(PROCESS_NAME))
+ def test_no_rfc1918_forwarding(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 + ['no-serve-rfc1918'])
+
+ # commit changes
+ self.cli_commit()
+
+ # verify configuration
+ tmp = get_config_value('serve-rfc1918')
+ self.assertEqual(tmp, 'no')
+
+ # Check for running process
+ self.assertTrue(process_named_running(PROCESS_NAME))
+
if __name__ == '__main__':
unittest.main(verbosity=2)