1 // Copyright 2020 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 mod fixture;
5 use fixture::TestVm;
6 
7 #[test]
boot_test_vm()8 fn boot_test_vm() {
9     let mut vm = TestVm::new(&[], false).unwrap();
10     assert_eq!(vm.exec_in_guest("echo 42").unwrap().trim(), "42");
11 }
12 
13 #[test]
boot_test_suspend_resume()14 fn boot_test_suspend_resume() {
15     // There is no easy way for us to check if the VM is actually suspended. But at
16     // least exercise the code-path.
17     let mut vm = TestVm::new(&[], false).unwrap();
18     vm.suspend().unwrap();
19     vm.resume().unwrap();
20     assert_eq!(vm.exec_in_guest("echo 42").unwrap().trim(), "42");
21 }
22