arch: move test cases to vmm crate

This saves us from adding a "kvm" feature to arch crate merely for the
purpose of running tests.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2020-07-08 12:48:46 +00:00
committed by Samuel Ortiz
parent 598eaf9f86
commit d80e383dbb
8 changed files with 277 additions and 259 deletions

View File

@@ -432,3 +432,17 @@ pub mod kvm {
}
}
}
#[cfg(target_arch = "aarch64")]
#[cfg(test)]
mod tests {
use arch::aarch64::gic::create_gic;
#[test]
fn test_create_gic() {
let hv = hypervisor::new().unwrap();
let vm = hv.create_vm().unwrap();
assert!(create_gic(&vm, 1, false).is_ok());
}
}