summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-07-30 22:01:54 +0200
committerChristian Poessinger <christian@poessinger.com>2021-07-30 22:02:28 +0200
commitf89a0cfc7d0d908cbe1715b760b07926ffa3f7b9 (patch)
treee6ee3c725606dafeeba9301c71c01da584b33150 /smoketest
parent8cdfe151876781d03db3c2d0366f04875d7ab6d7 (diff)
downloadvyos-1x-f89a0cfc7d0d908cbe1715b760b07926ffa3f7b9.tar.gz
vyos-1x-f89a0cfc7d0d908cbe1715b760b07926ffa3f7b9.zip
router-advert: T2745: use template common coding style in for loops
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_service_router-advert.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/test_service_router-advert.py b/smoketest/scripts/cli/test_service_router-advert.py
index b19c49c6e..26b4626c2 100755
--- a/smoketest/scripts/cli/test_service_router-advert.py
+++ b/smoketest/scripts/cli/test_service_router-advert.py
@@ -43,11 +43,10 @@ class TestServiceRADVD(VyOSUnitTestSHIM.TestCase):
self.cli_delete(base_path)
self.cli_commit()
- def test_single(self):
+ def test_common(self):
self.cli_set(base_path + ['prefix', '::/64', 'no-on-link-flag'])
self.cli_set(base_path + ['prefix', '::/64', 'no-autonomous-flag'])
self.cli_set(base_path + ['prefix', '::/64', 'valid-lifetime', 'infinity'])
- self.cli_set(base_path + ['dnssl', '2001:db8::1234'])
self.cli_set(base_path + ['other-config-flag'])
# commit changes
@@ -92,5 +91,28 @@ class TestServiceRADVD(VyOSUnitTestSHIM.TestCase):
# Check for running process
self.assertTrue(process_named_running('radvd'))
+ def test_dns(self):
+ nameserver = ['2001:db8::1', '2001:db8::2']
+ dnssl = ['vyos.net', 'vyos.io']
+
+ self.cli_set(base_path + ['prefix', '::/64', 'valid-lifetime', 'infinity'])
+ self.cli_set(base_path + ['other-config-flag'])
+
+ for ns in nameserver:
+ self.cli_set(base_path + ['name-server', ns])
+ for sl in dnssl:
+ self.cli_set(base_path + ['dnssl', sl])
+
+ # commit changes
+ self.cli_commit()
+
+ config = read_file(RADVD_CONF)
+
+ tmp = 'RDNSS ' + ' '.join(nameserver) + ' {'
+ self.assertIn(tmp, config)
+
+ tmp = 'DNSSL ' + ' '.join(dnssl) + ' {'
+ self.assertIn(tmp, config)
+
if __name__ == '__main__':
unittest.main(verbosity=2)