From 9703971ae73eec9baa6e7fbfc3c60fd4e86123e9 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 6 May 2026 10:45:55 +0100 Subject: [PATCH] tests: Use separate IP address for guest -> host notification This will allow an L2 guest to notify the L1 host. Signed-off-by: Rob Bradford --- test_data/cloud-init/ubuntu/ci/user-data | 2 +- test_infra/src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test_data/cloud-init/ubuntu/ci/user-data b/test_data/cloud-init/ubuntu/ci/user-data index 2538e1229..45105d53b 100644 --- a/test_data/cloud-init/ubuntu/ci/user-data +++ b/test_data/cloud-init/ubuntu/ci/user-data @@ -73,4 +73,4 @@ write_files: #!/bin/bash set -e - echo -n "@DEFAULT_TCP_LISTENER_MESSAGE" > /dev/tcp/@HOST_IP/@TCP_LISTENER_PORT + echo -n "@DEFAULT_TCP_LISTENER_MESSAGE" > /dev/tcp/@NOTIFY_IP/@TCP_LISTENER_PORT diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index 9f825da9f..19a76bb15 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -207,6 +207,7 @@ pub struct GuestNetworkConfig { pub l2_guest_mac2: String, pub l2_guest_mac3: String, pub tcp_listener_port: u16, + pub notify_ip: String, } pub const DEFAULT_TCP_LISTENER_MESSAGE: &str = "booted"; @@ -461,7 +462,7 @@ impl DiskConfig for UbuntuDiskConfig { "@DEFAULT_TCP_LISTENER_MESSAGE", DEFAULT_TCP_LISTENER_MESSAGE, ); - user_data_string = user_data_string.replace("@HOST_IP", &network.host_ip0); + user_data_string = user_data_string.replace("@NOTIFY_IP", &network.notify_ip); user_data_string = user_data_string.replace("@TCP_LISTENER_PORT", &network.tcp_listener_port.to_string()); @@ -1202,6 +1203,7 @@ impl Guest { l2_guest_mac2: format!("de:ad:be:ef:34:{id:02x}"), l2_guest_mac3: format!("de:ad:be:ef:56:{id:02x}"), tcp_listener_port: DEFAULT_TCP_LISTENER_PORT + id as u16, + notify_ip: format!("{class}.{id}.1"), }; disk_config.prepare_files(&tmp_dir, &network);