mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 21:55:20 +00:00
tests: Enable watchdog test case on AArch64
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
parent
52f60188ca
commit
164d481683
@ -5459,7 +5459,6 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(target_arch = "x86_64")]
|
|
||||||
fn test_watchdog() {
|
fn test_watchdog() {
|
||||||
let mut focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
|
let mut focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
|
||||||
let guest = Guest::new(&mut focal);
|
let guest = Guest::new(&mut focal);
|
||||||
@ -5550,19 +5549,22 @@ mod tests {
|
|||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
assert_eq!(boot_count, 3);
|
assert_eq!(boot_count, 3);
|
||||||
|
|
||||||
// Now pause the VM and remain offline for 30s
|
#[cfg(target_arch = "x86_64")]
|
||||||
assert!(remote_command(&api_socket, "pause", None));
|
{
|
||||||
thread::sleep(std::time::Duration::new(30, 0));
|
// Now pause the VM and remain offline for 30s
|
||||||
assert!(remote_command(&api_socket, "resume", None));
|
assert!(remote_command(&api_socket, "pause", None));
|
||||||
|
thread::sleep(std::time::Duration::new(30, 0));
|
||||||
|
assert!(remote_command(&api_socket, "resume", None));
|
||||||
|
|
||||||
// Check no reboot
|
// Check no reboot
|
||||||
let boot_count = guest
|
let boot_count = guest
|
||||||
.ssh_command("sudo journalctl --list-boots | wc -l")
|
.ssh_command("sudo journalctl --list-boots | wc -l")
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.trim()
|
.trim()
|
||||||
.parse::<u32>()
|
.parse::<u32>()
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
assert_eq!(boot_count, 3);
|
assert_eq!(boot_count, 3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
|
Loading…
Reference in New Issue
Block a user