canonical / canonical/cloud-init
Integration test failure: test_ovs_member_interfaces_not_excluded
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
[tests/integration_tests/bugs/test_lp1898997.py::TestInterfaceListingWithOpenvSwitch::test_ovs_member_interfaces_not_excluded](https://github.com/canonical/cloud-init/blob/main/tests/integration_tests/bugs/test_lp1898997.py) is currently failing on Ubuntu Lunar under LXD VMs.
```
gateway = client.execute(
"ip -4 route show default | awk '{ print $3 }'"
)
```
in unexpectedly returning an empty string causing the assert on the line after to fail.
The test config indicates that ovs-br interface should get a dhcp4 address, yet it is not getting one:
```
root@cloudinit-0815-152252wjsu05rn:~# ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp5s0: mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000
link/ether 02:00:00:06:f5:d2 brd ff:ff:ff:ff:ff:ff
3: ovs-system: mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether ba:a3:17:61:15:df brd ff:ff:ff:ff:ff:ff
4: ovs-br: mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 22:6c:90:99:14:46 brd ff:ff:ff:ff:ff:ff
inet6 fd42:eaab:10a1:ad48:206c:90ff:fe99:1446/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fed9:81c/64 scope link
valid_lft forever preferred_lft forever
```
A [journal snippet](https://paste.ubuntu.com/p/8j7StkZxNS/) shows networkd failing to find the `ovs-br` device:
`Aug 15 15:36:12 cloudinit-0815-152252wjsu05rn systemd-networkd[309]: /run/systemd/network/10-netplan-enp5s0.network: ovs-br NetDev could not be found, ignoring assignment`
If I manually run `netplan apply` everything works as expected.
I couldn't find anything out of place in the cloud-init logs:
```
2023-08-15 15:23:29,719 - networking.py[DEBUG]: net: all expected physical devices present
2023-08-15 15:23:29,719 - stages.py[DEBUG]: applying net config names for {'bridges': {'ovs-br': {'dhcp4': True, 'interfaces': ['enp5s0'], 'macaddress': '52:54:00:d9:08:1c', 'mtu': 1500, 'openvswitch': {}}}, 'ethernets': {'enp5s0': {'mtu': 1500, 'set-name': 'enp5s0', 'match': {'macaddress': '02:00:00:06:f5:d2'}}}, 'version': 2}
```
and the problem that originally caused https://github.com/canonical/cloud-init/issues/3792 is not happening here.
`tests/integration_tests/bugs/test_lp1912844.py::test_get_interfaces_by_mac_doesnt_traceback` is failing similarly. The call in the test works fine, but the interface isn't coming up so pycloudlib thinks the instance is down.
Since the issue appears to be unrelated to cloud-init, I suggest we skip/xfail the tests until the root cause is fixed.
Contributor guide
Assessment
This issue has not been assessed yet.