Skip to content

Commit

Permalink
Merge pull request #417 from Honny1/test_dns_option
Browse files Browse the repository at this point in the history
Add test of container create with  DNS option
  • Loading branch information
openshift-merge-bot[bot] authored Aug 12, 2024
2 parents f6c3d25 + 464dfd8 commit 4ebd99a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 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,26 @@ 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 4ebd99a

Please sign in to comment.