From 389f9e3779b8d9814a2a6d165f0f2fb5f6f72073 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 9 Sep 2019 13:53:18 +0100 Subject: [PATCH] tests: Check that the test binary cleanly terminated As part of the reboot test check that the binary cleanly terminated after the subsequent shutdown. Signed-off-by: Rob Bradford --- src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5009afdf1..5b7e16d06 100755 --- a/src/main.rs +++ b/src/main.rs @@ -2146,6 +2146,12 @@ mod tests { .ssh_command("sudo shutdown -h now") .unwrap_or_default(); + thread::sleep(std::time::Duration::new(20, 0)); + + // Check that the cloud-hypervisor binary actually terminated + if let Ok(status) = child.wait() { + aver_eq!(tb, status.success(), true); + } let _ = child.kill(); let _ = child.wait(); }); @@ -2208,7 +2214,12 @@ mod tests { aver_eq!(tb, reboot_count, 1); guest.ssh_command("sudo shutdown -h now")?; - thread::sleep(std::time::Duration::new(10, 0)); + thread::sleep(std::time::Duration::new(20, 0)); + + // Check that the cloud-hypervisor binary actually terminated + if let Ok(status) = child.wait() { + aver_eq!(tb, status.success(), true); + } let _ = child.kill(); let _ = child.wait(); Ok(())