diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-09 15:57:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-09 15:57:49 +0200 |
commit | 6183ad90fdf4b897fec2c5ccddd5a0e67b1d88da (patch) | |
tree | e4325bb1cd12ca10e2f2862e61ebe18e086f658e /smoketest | |
parent | 9a92c365faf9ef6a8ce30e003d05dc9a52d9b788 (diff) | |
parent | aface21a83f54e0f1a60549589d6ad2caa40f473 (diff) | |
download | vyos-1x-6183ad90fdf4b897fec2c5ccddd5a0e67b1d88da.tar.gz vyos-1x-6183ad90fdf4b897fec2c5ccddd5a0e67b1d88da.zip |
Merge pull request #4040 from vyos/mergify/bp/circinus/pr-4034
container: T6702: re-add missing UNIX API socket (backport #4034)
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_container.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_container.py b/smoketest/scripts/cli/test_container.py index 3dd97a175..5e33eba40 100755 --- a/smoketest/scripts/cli/test_container.py +++ b/smoketest/scripts/cli/test_container.py @@ -230,5 +230,23 @@ class TestContainer(VyOSUnitTestSHIM.TestCase): tmp = cmd(f'sudo podman exec -it {cont_name} id -g') self.assertEqual(tmp, gid) + def test_api_socket(self): + base_name = 'api-test' + container_list = range(1, 5) + + for ii in container_list: + name = f'{base_name}-{ii}' + self.cli_set(base_path + ['name', name, 'image', cont_image]) + self.cli_set(base_path + ['name', name, 'allow-host-networks']) + + self.cli_commit() + + # Query API about running containers + tmp = cmd("sudo curl --unix-socket /run/podman/podman.sock -H 'content-type: application/json' -sf http://localhost/containers/json") + tmp = json.loads(tmp) + + # We expect the same amount of containers from the API that we started above + self.assertEqual(len(container_list), len(tmp)) + if __name__ == '__main__': unittest.main(verbosity=2) |