crosvm/e2e_tests/tests/boot.rs
Dennis Kempin 009cb53c76 Rename integration_tests to e2e_tests
Cargo already uses the term 'integration test' for tests living
in the tests/ directory of a crate.

To prevent confusion, rename our 'integration_tests' crate to
'e2e_tests'.

BUG=None
TEST=presubmit

Change-Id: Icfa819eaed08be54ab0f36092f1ba367f3f1ce88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004977
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2022-11-03 22:49:39 +00:00

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");
}