From 1b4b4fb0c2f7fcf4cfb379fb169a483738dd018d Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 21 Oct 2025 18:05:56 +0100 Subject: [PATCH] tests: Validate secondary network connection in test_net_hotplug Test that additional network interface by SSHing in using that secondary IP. Signed-off-by: Rob Bradford --- tests/integration.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index 263071fda..6c42e0496 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -6132,6 +6132,21 @@ mod common_parallel { 3 ); + // Test the same using the added network interface's IP + assert_eq!( + ssh_command_ip( + "ip -o link | wc -l", + &guest.network.guest_ip1, + DEFAULT_SSH_RETRIES, + DEFAULT_SSH_TIMEOUT + ) + .unwrap() + .trim() + .parse::() + .unwrap_or_default(), + 3 + ); + // Remove network assert!(remote_command(&api_socket, "remove-device", Some("test0"),)); thread::sleep(std::time::Duration::new(5, 0)); @@ -6192,6 +6207,21 @@ mod common_parallel { .unwrap_or_default(), 3 ); + + // Test the same using the added network interface's IP + assert_eq!( + ssh_command_ip( + "ip -o link | wc -l", + &guest.network.guest_ip1, + DEFAULT_SSH_RETRIES, + DEFAULT_SSH_TIMEOUT + ) + .unwrap() + .trim() + .parse::() + .unwrap_or_default(), + 3 + ); }); kill_child(&mut child);