kvm: add tests for get_supported_cpuid() and get_emulated_cpuid()

TEST=cargo test -p kvm
BUG=None

Change-Id: I2af245cb94d68faf091bf6788842c1932240df3d
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/947320
Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
Dmitry Torokhov 2018-03-02 10:12:30 -08:00 committed by chrome-bot
parent 532a94c1c8
commit 8da6543e74

View file

@ -1095,6 +1095,20 @@ mod tests {
assert!(!vm.check_extension(Cap::S390UserSigp));
}
#[test]
fn get_supported_cpuid() {
let kvm = Kvm::new().unwrap();
let mut cpuid = kvm.get_supported_cpuid().unwrap();
let cpuid_entries = cpuid.mut_entries_slice();
assert!(cpuid_entries.len() > 0);
}
#[test]
fn get_emulated_cpuid() {
let kvm = Kvm::new().unwrap();
kvm.get_emulated_cpuid().unwrap();
}
#[test]
fn add_memory() {
let kvm = Kvm::new().unwrap();