mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user