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

tests: ethernets: Add ipv6-address-generation integration tests #509

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

tatokis
Copy link
Contributor

@tatokis tatokis commented Aug 20, 2024

Description

These tests validate the Stable Privacy and Modified EUI-64 IPv6 address generation methods under both NetworkManager and systemd-networkd.

Checklist

  • Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

@slyon slyon added the community This PR has been proposed by somebody outside of the Netplan team and roadmap commitments. label Aug 20, 2024
@tatokis tatokis marked this pull request as draft August 20, 2024 21:29
@tatokis
Copy link
Contributor Author

tatokis commented Aug 20, 2024

The CI caught an issue I hadn't thought of: It generated a MAC address with a leading zero and that resulted in the test failing. I'll fix it.

These tests validate the Stable Privacy and Modified EUI-64 IPv6 address
generation methods under both NetworkManager and systemd-networkd.
@tatokis tatokis marked this pull request as ready for review August 22, 2024 09:59
@slyon slyon self-requested a review August 26, 2024 12:57
Copy link
Collaborator

@slyon slyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is a very valuable contribution!

I left some small nitpicks as inline-comments. Otherwise, LGTM and the tests are green in the CI, too!

tests/integration/ethernets.py Outdated Show resolved Hide resolved
tests/integration/ethernets.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@slyon slyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tatokis I took the freedom to sparkle it with some comments and also move the EUI-64 calculation method into integration/base.py, so it can be used from both test methods, without code duplication. So this should now be good for merging (after CI passes again).

Interestingly, while testing locally inside an Ubuntu Oracular (devel) container, the test_ip6_eui64 test failed for the systemd-networkd backend. Do you have any explanation for that? (It might as well have been my local test environment being bonkers.)

======================================================================
FAIL: test_ip6_eui64 (__main__.TestNetworkd.test_ip6_eui64)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest.t7IWGx/build.0JU/real-tree/tests/integration/ethernets.py", line 256, in test_ip6_eui64
    self.assert_iface_up(self.dev_e_client, [f'inet6 {eui_addr.compressed}/64'])
  File "/tmp/autopkgtest.t7IWGx/build.0JU/real-tree/tests/integration/base.py", line 337, in assert_iface_up
    out = self.assert_iface(iface, expected_ip_a, unexpected_ip_a)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/autopkgtest.t7IWGx/build.0JU/real-tree/tests/integration/base.py", line 327, in assert_iface
    self.assertRegex(out, r, out)
AssertionError: Regex didn't match: 'inet6 2600::28ae:72ff:fe0a:5fe/64' not found in '84: eth42@veth42: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000\n    link/ether 2a:ae:72:0a:05:fe brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 68 maxmtu 65535 \n    veth numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 tso_max_size 524280 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro_ipv4_max_size 65536 \n    inet6 2600::13/128 scope global dynamic noprefixroute \n       valid_lft 86395sec preferred_lft 86395sec\n    inet6 fe80::28ae:72ff:fe0a:5fe/64 scope link proto kernel_ll \n       valid_lft forever preferred_lft forever\n' : 84: eth42@veth42: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 2a:ae:72:0a:05:fe brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 68 maxmtu 65535 
    veth numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 tso_max_size 524280 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro_ipv4_max_size 65536 
    inet6 2600::13/128 scope global dynamic noprefixroute 
       valid_lft 86395sec preferred_lft 86395sec
    inet6 fe80::28ae:72ff:fe0a:5fe/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

Edit: CI passed on Debian testing (using systemd v256, like Oracular). So the issue seems to be more specific to Oracular or my local environment.

@slyon slyon merged commit c5a3e12 into canonical:main Aug 28, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community This PR has been proposed by somebody outside of the Netplan team and roadmap commitments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants