summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorNicolas Vollmar <nvollmar@gmail.com>2024-12-01 16:25:05 +0100
committerNicolas Vollmar <nvollmar@gmail.com>2024-12-08 11:04:58 +0100
commitf9ddf3f68f42080efc471e934d6bdaa1fec17459 (patch)
tree6fee3bd729261f52a64fef2008ab72c3ba101151 /smoketest
parentb56673ccdc0c304c8e9c12a9274a6903d45103a6 (diff)
downloadvyos-1x-f9ddf3f68f42080efc471e934d6bdaa1fec17459.tar.gz
vyos-1x-f9ddf3f68f42080efc471e934d6bdaa1fec17459.zip
T6927: adds option to set container name server
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_container.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_container.py b/smoketest/scripts/cli/test_container.py
index 0541384da..db67add31 100755
--- a/smoketest/scripts/cli/test_container.py
+++ b/smoketest/scripts/cli/test_container.py
@@ -96,6 +96,18 @@ class TestContainer(VyOSUnitTestSHIM.TestCase):
tmp = cmd(f'sudo podman exec -it {cont_name} sysctl kernel.msgmax')
self.assertEqual(tmp, 'kernel.msgmax = 4096')
+ def test_name_server(self):
+ cont_name = 'dns-test'
+ name_server = '192.168.0.1'
+ self.cli_set(base_path + ['name', cont_name, 'allow-host-networks'])
+ self.cli_set(base_path + ['name', cont_name, 'image', cont_image])
+ self.cli_set(base_path + ['name', cont_name, 'name-server', name_server])
+
+ self.cli_commit()
+
+ n = cmd_to_json(f'sudo podman inspect {cont_name}')
+ self.assertEqual(n['HostConfig']['Dns'][0], name_server)
+
def test_cpu_limit(self):
cont_name = 'c2'