Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test of container create with DNS option #417

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading