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 <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford 2025-10-21 18:05:56 +01:00 committed by Bo Chen
parent 3ed44c41a6
commit 1b4b4fb0c2

View file

@ -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::<u32>()
.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::<u32>()
.unwrap_or_default(),
3
);
});
kill_child(&mut child);