Skip to content

Commit

Permalink
test: harden test_dhcp.py::test_noble_and_newer_force_client
Browse files Browse the repository at this point in the history
Update apt sources and ensure target dhcp client is correctly installed.
  • Loading branch information
aciba90 authored and blackboxsw committed Feb 13, 2024
1 parent 9c4b799 commit 7d605ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/integration_tests/net/test_dhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def test_noble_and_newer_uses_dhcpcd_by_default(self, client):
)
def test_noble_and_newer_force_client(self, client, dhcp_client, package):
"""force noble to use dhcpcd and test that it worked"""
client.execute(f"apt install -yq {package}")
client.execute(
assert client.execute(f"apt update && apt install -yq {package}").ok
assert client.execute(
"sed -i 's|"
"dhcp_client_priority.*$"
f"|dhcp_client_priority: [{dhcp_client}]"
"|' /etc/cloud/cloud.cfg"
)
).ok
client.execute("cloud-init clean --logs")
client.restart()
log = client.read_from_file("/var/log/cloud-init.log")
Expand Down

0 comments on commit 7d605ea

Please sign in to comment.