Skip to content

Commit

Permalink
test: fix upgrade dhcp6 on ec2 (#5131)
Browse files Browse the repository at this point in the history
After [0, 1], dhcp6 is going to be always false after upgrading
cloud-init. Correct this in the integration test.

Refs:
[0] #3980
[1] https://bugs.launchpad.net/cloud-init/+bug/1976526
  • Loading branch information
aciba90 committed Apr 2, 2024
1 parent 7777102 commit 9758673
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/integration_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ def test_clean_boot_of_upgraded_package(session_cloud: IntegrationCloud):
for values in post_network["network"]["ethernets"].values():
values.pop("dhcp6")
assert yaml.dump(pre_network) == yaml.dump(post_network)
elif PLATFORM == "ec2":
# After GH-3980, EC2 does not enable dhcp6 anymore. This block can
# be removed after the base cloud-init version is 24.1.
pre_network = yaml.load(pre_network, Loader=yaml.Loader)
post_network = yaml.load(post_network, Loader=yaml.Loader)
pre_network["network"]["ethernets"]["ens5"]["dhcp6"] = False
assert yaml.dump(pre_network) == yaml.dump(post_network)
else:
assert pre_network == post_network

Expand Down

0 comments on commit 9758673

Please sign in to comment.