Skip to content

Commit

Permalink
Add test of container create with DNS option
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Rodák <[email protected]>
  • Loading branch information
Honny1 committed Aug 9, 2024
1 parent f6c3d25 commit 03f24a5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions podman/tests/integration/test_container_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,32 @@ def test_container_ports(self):
)
)

def test_container_dns_option(self):
expected_dns_opt = ['edns0']

container = self.client.containers.create(
self.alpine_image,
command=["cat", "/etc/resolv.conf"],
dns_opt=expected_dns_opt
)
self.containers.append(container)

with self.subTest("Check HostConfig"):
self.assertEqual(
container.attrs.get('HostConfig', {}).get('DnsOptions'),
expected_dns_opt
)

with self.subTest("Check content of /etc/resolv.conf"):
container.start()
container.wait()
self.assertTrue(
all([
opt in b"\n".join(container.logs()).decode()
for opt in expected_dns_opt
])
)

def test_container_healthchecks(self):
"""Test passing various healthcheck options"""
parameters = {
Expand Down

0 comments on commit 03f24a5

Please sign in to comment.