mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 12:09:31 +00:00
While we are tweaking all of the copyright headers, let's take the opportunity to ensure there is always a blank line after the copyright header for consistency. (Almost all files already follow this style.) This includes a slightly ugly regex to allow the end of a C-style comment block after the end of the copyright: /* * Example comment block */ <-- this line Change-Id: Idfd0855861e5ecb3d33afae942fdba908af0dcff Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3892521 Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dennis Kempin <denniskempin@google.com>
29 lines
866 B
Rust
29 lines
866 B
Rust
// Copyright 2020 The ChromiumOS Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
pub mod fixture;
|
|
use fixture::Config;
|
|
use fixture::TestVm;
|
|
|
|
#[test]
|
|
fn boot_test_vm() {
|
|
let mut vm = TestVm::new(Config::new()).unwrap();
|
|
assert_eq!(vm.exec_in_guest("echo 42").unwrap().trim(), "42");
|
|
}
|
|
|
|
#[test]
|
|
fn boot_test_vm_odirect() {
|
|
let mut vm = TestVm::new(Config::new().o_direct()).unwrap();
|
|
assert_eq!(vm.exec_in_guest("echo 42").unwrap().trim(), "42");
|
|
}
|
|
|
|
#[test]
|
|
fn boot_test_suspend_resume() {
|
|
// There is no easy way for us to check if the VM is actually suspended. But at
|
|
// least exercise the code-path.
|
|
let mut vm = TestVm::new(Config::new()).unwrap();
|
|
vm.suspend().unwrap();
|
|
vm.resume().unwrap();
|
|
assert_eq!(vm.exec_in_guest("echo 42").unwrap().trim(), "42");
|
|
}
|