diff options
author | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-13 18:18:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 18:18:14 +0300 |
commit | 7b9ac5278bedf4ced16a1d9923ac77683395e0c4 (patch) | |
tree | eeff332676c32634f18521ad69094a2c2c31b623 /smoketest | |
parent | fd191178a5e6887e7aaada1b87822c1cf54035ae (diff) | |
download | vyos-1x-7b9ac5278bedf4ced16a1d9923ac77683395e0c4.tar.gz vyos-1x-7b9ac5278bedf4ced16a1d9923ac77683395e0c4.zip |
container: T6701: add support to disable container network DNS support (#4052)
Add ability to set the container network with a disable-dns setting to disable
the DNS plugin that is on be default.
set container network <network> no-name-server
(cherry picked from commit 1d5625d572cc25a9d53247b7c41177f17845b052)
Co-authored-by: Dave Vogel <dave.vogel@fullpower.com>
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_container.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_container.py b/smoketest/scripts/cli/test_container.py index 5e33eba40..c03b9eb44 100755 --- a/smoketest/scripts/cli/test_container.py +++ b/smoketest/scripts/cli/test_container.py @@ -208,6 +208,22 @@ class TestContainer(VyOSUnitTestSHIM.TestCase): self.assertEqual(c['NetworkSettings']['Networks'][net_name]['Gateway'] , str(ip_interface(prefix4).ip + 1)) self.assertEqual(c['NetworkSettings']['Networks'][net_name]['IPAddress'] , str(ip_interface(prefix4).ip + ii)) + def test_no_name_server(self): + prefix = '192.0.2.0/24' + base_name = 'ipv4' + net_name = 'NET01' + + self.cli_set(base_path + ['network', net_name, 'prefix', prefix]) + self.cli_set(base_path + ['network', net_name, 'no-name-server']) + + name = f'{base_name}-2' + self.cli_set(base_path + ['name', name, 'image', cont_image]) + self.cli_set(base_path + ['name', name, 'network', net_name, 'address', str(ip_interface(prefix).ip + 2)]) + self.cli_commit() + + n = cmd_to_json(f'sudo podman network inspect {net_name}') + self.assertEqual(n['dns_enabled'], False) + def test_uid_gid(self): cont_name = 'uid-test' gid = '100' |