tests: clean up snapshot dir after restore

The snapshot_dir is not needed anymore fter the guest is restored.
Hence, remove it. This will potentially avoid transient failures caused
due to insufficient disk space.

Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
This commit is contained in:
Purna Pavan Chandra 2024-04-29 11:52:19 +00:00 committed by Rob Bradford
parent 1aeaee221d
commit 1a94c6c932

View File

@ -2344,7 +2344,10 @@ fn make_guest_panic(guest: &Guest) {
}
mod common_parallel {
use std::{fs::OpenOptions, io::SeekFrom};
use std::{
fs::{remove_dir_all, OpenOptions},
io::SeekFrom,
};
use crate::*;
@ -6229,6 +6232,9 @@ mod common_parallel {
&event_path_restored
));
// Remove the snapshot dir
let _ = remove_dir_all(snapshot_dir.as_str());
let r = std::panic::catch_unwind(|| {
// Resume the VM
assert!(remote_command(&api_socket_restored, "resume", None));