diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-12 21:24:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 21:24:09 +0100 |
commit | 4221687fc7a0482b13a79358f9b0d085ec0835f6 (patch) | |
tree | d5cb9c6cb62692aef2deb5f2deedf7586b60e422 /smoketest/scripts/cli | |
parent | 678c6cd00412cad5d788da210c6dfeae6e77907c (diff) | |
parent | 2de9fc6c1c0ee4fb814bb48cfe8b260453f80436 (diff) | |
download | vyos-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-x | smoketest/scripts/cli/test_container.py | 12 |
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}') |