// Copyright 2022 The ChromiumOS Authors1// Use of this source code is governed by a BSD-style license that can be2// found in the LICENSE file.34use fixture::vm::Config;5use fixture::vm::TestVm;67// Tests for possible backwards compatibility issues.8//9// There is no backwards compatibility policy yet, these are just "change detector" tests. If you10// break a test, make sure the change is intended and then ask in go/crosvm-chat to see if anyone11// objects to updating the golden file.1213// Many changes to PCI devices can cause issues, e.g. some users depend on crosvm always choosing14// the same PCI slots for particular devices.15#[test]16fn backcompat_test() {17let mut vm = TestVm::new(Config::new()).unwrap();18backcompat_test_simple_lspci(&mut vm);19}2021#[test]22fn backcompat_test_disable_sandbox() {23let mut vm = TestVm::new(Config::new().disable_sandbox()).unwrap();24backcompat_test_simple_lspci(&mut vm);25}2627fn backcompat_test_simple_lspci(vm: &mut TestVm) {28let expected = include_str!("goldens/backcompat_test_simple_lspci.txt").trim();29let result = vm30.exec_in_guest("lspci -n")31.unwrap()32.stdout33.trim()34.replace('\r', "");35assert_eq!(36expected,37result,38"PCI Devices changed:\n<<< Expected <<<\n{expected}\n<<<<<<<<<<<<<<<<\n>>> Got >>>\n{result}\n>>>>>>>>>>>>>>>>\n"39);40}414243