Thanks for the work here. I can confirm that systemd 245.4-4ubuntu-3.24 properly renders route metrics and fixes the routing issue that this bug refers to. Applying the following diff to cloud-init to install systemd's version from focal-proposed and make extra assertions results in the test passing, see attached log.
+ ip_route_show = client.execute("ip route show")
+ assert ip_route_show.ok, ip_route_show.stderr
+ for route in ip_route_show.splitlines():
+ assert "metric" in route, "Expected metric to be configured in route"
+
# Remove new NIC client.instance.remove_network_interface(secondary_priv_ip4) _wait_till_hotplug_complete(client, expected_runs=2)
# ping to primary NIC works
assert bastion.execute(f"ping -c1 {primary_priv_ip4}").ok
- assert bastion.execute(f"ping -c1 {primary_priv_ip6}").ok
+ assert bastion.execute(f"ping -c3 {primary_priv_ip6}").ok
Thanks for the work here. I can confirm that systemd 245.4-4ubuntu-3.24 properly renders route metrics and fixes the routing issue that this bug refers to. Applying the following diff to cloud-init to install systemd's version from focal-proposed and make extra assertions results in the test passing, see attached log.
```diff integration_ tests/modules/ test_hotplug. py b/tests/ integration_ tests/modules/ test_hotplug. py .82d4a2cd1 100644 integration_ tests/modules/ test_hotplug. py integration_ tests/modules/ test_hotplug. py nic_hotplug( setup_image, session_cloud: IntegrationCloud):
verify_ clean_log( log_content)
diff --git a/tests/
index 8c7bc7839.
--- a/tests/
+++ b/tests/
@@ -299,7 +299,6 @@ def test_multi_
-@pytest. mark.skipif( CURRENT_ RELEASE <= FOCAL, reason="See LP: #2055397") mark.skipif( PLATFORM != "ec2", reason="test is ec2 specific") nic_hotplug_ vpc(setup_ image, session_cloud: IntegrationCloud): nic_hotplug_ vpc(setup_ image, session_cloud: IntegrationCloud): cloud.launch(
user_ data=USER_ DATA cloud.launch( ) as bastion: archive. ubuntu. com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe' >> /etc/apt/ sources. list.d/ proposed- repositories. list" execute( "sudo apt update").ok execute( "sudo apt upgrade systemd -y").ok execute( "cloud- init clean --logs") cloud_init( client) addr(client)
primary_ priv_ip4 = ips_before[1].ip4
primary_ priv_ip6 = ips_before[1].ip6 nic_hotplug_ vpc(setup_ image, session_cloud: IntegrationCloud): execute( f"ping -c1 {secondary_ priv_ip4} ") execute( f"ping -c1 {primary_ priv_ip6} ") execute( f"ping -c3 {primary_ priv_ip6} ") execute( f"ping -c1 {secondary_ priv_ip6} ") execute( f"ping -c3 {secondary_ priv_ip6} ")
@pytest.
def test_multi_
"""Tests that additional secondary NICs are routable from local
@@ -308,6 +307,19 @@ def test_multi_
with session_
) as client, session_
+ assert client.execute("""\
+sudo sh -c "echo 'deb http://
+ """).ok
+ assert client.
+ assert client.
+ systemd_resp = client.execute("apt policy systemd | grep Installed | cut -d ':' -f 2 | tr -d ' '")
+ assert systemd_resp.ok
+ assert systemd_resp.stdout == "245.4-4ubuntu3.24"
+
+ assert client.
+ client.restart()
+ wait_for_
+
ips_before = _get_ip_
@@ -343,18 +355,23 @@ def test_multi_
assert r.ok, r.stdout
r = bastion.
assert r.ok, r.stdout
- r = bastion.
+ r = bastion.
assert r.ok, r.stdout
- r = bastion.
+ r = bastion.
assert r.ok, r.stdout
+ ip_route_show = client.execute("ip route show") show.stderr show.splitlines ():
client. instance. remove_ network_ interface( secondary_ priv_ip4)
_wait_ till_hotplug_ complete( client, expected_runs=2)
+ assert ip_route_show.ok, ip_route_
+ for route in ip_route_
+ assert "metric" in route, "Expected metric to be configured in route"
+
# Remove new NIC
# ping to primary NIC works execute( f"ping -c1 {primary_ priv_ip4} ").ok execute( f"ping -c1 {primary_ priv_ip6} ").ok execute( f"ping -c3 {primary_ priv_ip6} ").ok
assert bastion.
- assert bastion.
+ assert bastion.
```