crosvm/integration_tests/tests/backcompat.rs
Daniel Verkamp 7c6d8bec3f health-check: enforce blank line after copyright
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>
2022-09-13 22:24:35 +00:00

32 lines
1.1 KiB
Rust

// Copyright 2022 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;
// Tests for possible backwards compatibility issues.
//
// There is no backwards compatibility policy yet, these are just "change detector" tests. If you
// break a test, make sure the change is intended and then ask in go/crosvm-chat to see if anyone
// objects to updating the golden file.
// Many changes to PCI devices can cause issues, e.g. some users depend on crosvm always choosing
// the same PCI slots for particular devices.
#[test]
fn backcompat_test_simple_lspci() {
let mut vm = TestVm::new(Config::new()).unwrap();
let expected = include_str!("goldens/backcompat_test_simple_lspci.txt").trim();
let result = vm
.exec_in_guest("lspci -n")
.unwrap()
.trim()
.replace("\r", "");
assert_eq!(
expected,
result,
"PCI Devices changed:\n<<< Expected <<<\n{}\n<<<<<<<<<<<<<<<<\n>>> Got >>>\n{}\n>>>>>>>>>>>>>>>>\n",
expected, result
);
}