2022-02-28 16:26:43 -07:00
|
|
|
"""
|
|
|
|
|
Integration tests for exercising docker-py against Podman Service.
|
|
|
|
|
"""
|
2020-11-03 13:15:16 -07:00
|
|
|
|
2022-02-28 16:26:43 -07:00
|
|
|
# pylint: disable=no-name-in-module,import-error,wrong-import-order
|
|
|
|
|
from test.python.docker import constant
|
2021-03-01 10:55:20 -07:00
|
|
|
from test.python.docker.compat import common
|
2020-11-03 13:15:16 -07:00
|
|
|
|
|
|
|
|
|
2022-02-28 16:26:43 -07:00
|
|
|
# pylint: disable=missing-function-docstring
|
|
|
|
|
class TestSystem(common.DockerTestCase):
|
|
|
|
|
"""TestCase for exercising Podman system services."""
|
2020-11-03 13:15:16 -07:00
|
|
|
|
2022-02-28 16:26:43 -07:00
|
|
|
def test_info(self):
|
|
|
|
|
info = self.docker.info()
|
2022-01-14 17:08:52 +01:00
|
|
|
self.assertIsNotNone(info)
|
|
|
|
|
self.assertEqual(info["RegistryConfig"]["IndexConfigs"]["localhost:5000"]["Secure"], False)
|
2022-02-28 16:26:43 -07:00
|
|
|
self.assertEqual(
|
|
|
|
|
info["RegistryConfig"]["IndexConfigs"]["localhost:5000"]["Mirrors"],
|
|
|
|
|
["mirror.localhost:5000"],
|
|
|
|
|
)
|
2020-11-03 13:15:16 -07:00
|
|
|
|
|
|
|
|
def test_info_container_details(self):
|
2022-02-28 16:26:43 -07:00
|
|
|
info = self.docker.info()
|
2020-11-03 13:15:16 -07:00
|
|
|
self.assertEqual(info["Containers"], 1)
|
2022-02-28 16:26:43 -07:00
|
|
|
self.docker.containers.create(image=constant.ALPINE)
|
|
|
|
|
info = self.docker.info()
|
2020-11-03 13:15:16 -07:00
|
|
|
self.assertEqual(info["Containers"], 2)
|
|
|
|
|
|
|
|
|
|
def test_version(self):
|
2022-02-28 16:26:43 -07:00
|
|
|
version = self.docker.version()
|
2020-11-11 16:47:05 -07:00
|
|
|
self.assertIsNotNone(version["Platform"]["Name"])
|