summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-12-12 21:24:09 +0100
committerGitHub <noreply@github.com>2024-12-12 21:24:09 +0100
commit4221687fc7a0482b13a79358f9b0d085ec0835f6 (patch)
treed5cb9c6cb62692aef2deb5f2deedf7586b60e422 /smoketest/scripts/cli
parent678c6cd00412cad5d788da210c6dfeae6e77907c (diff)
parent2de9fc6c1c0ee4fb814bb48cfe8b260453f80436 (diff)
downloadvyos-1x-4221687fc7a0482b13a79358f9b0d085ec0835f6.tar.gz
vyos-1x-4221687fc7a0482b13a79358f9b0d085ec0835f6.zip
Merge pull request #4232 from nvollmar/T6927
T6927: adds option to set container name server
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_container.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_container.py b/smoketest/scripts/cli/test_container.py
index 5d574ab7d..51559a7c6 100755
--- a/smoketest/scripts/cli/test_container.py
+++ b/smoketest/scripts/cli/test_container.py
@@ -98,11 +98,21 @@ class TestContainer(VyOSUnitTestSHIM.TestCase):
def test_name_server(self):
cont_name = 'dns-test'
+ net_name = 'net-test'
name_server = '192.168.0.1'
- self.cli_set(base_path + ['name', cont_name, 'allow-host-networks'])
+ prefix = '192.0.2.0/24'
+
+ self.cli_set(base_path + ['network', net_name, 'prefix', prefix])
+
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_set(base_path + ['name', cont_name, 'network', net_name, 'address', str(ip_interface(prefix).ip + 2)])
+ # verify() - name server has no effect when container network has dns enabled
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+
+ self.cli_set(base_path + ['network', net_name, 'no-name-server'])
self.cli_commit()
n = cmd_to_json(f'sudo podman inspect {cont_name}')