integration_tests: use --block for disk options

As disk, rwdisk, root and rwroot are deprecated, switch to the unified
block command-line option.

BUG=None
TEST=cargo test -p integration_tests

Change-Id: I95109853f4b66bdd611c13c8eea92644f1892079
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3990101
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
Alexandre Courbot 2022-10-26 18:13:38 +09:00 committed by crosvm LUCI
parent 86148a9ceb
commit ddf9b82855
2 changed files with 5 additions and 5 deletions

View file

@ -37,10 +37,10 @@ fn prepare_disk_img() -> NamedTempFile {
#[test]
fn mount_block() {
let disk = prepare_disk_img();
let disk_path = disk.path().to_str().unwrap().to_string();
let disk_path = disk.path().to_str().unwrap();
println!("disk={disk_path}");
let config = Config::new().extra_args(vec!["--rwdisk".to_string(), disk_path]);
let config = Config::new().extra_args(vec!["--block".to_string(), format!("{},ro", disk_path)]);
let mut vm = TestVm::new(config).unwrap();
assert_eq!(
vm.exec_in_guest("mount -t ext4 /dev/vdb /mnt && echo 42")
@ -56,7 +56,7 @@ fn resize() {
let disk_path = disk.path().to_str().unwrap().to_string();
println!("disk={disk_path}");
let config = Config::new().extra_args(vec!["--rwdisk".to_string(), disk_path]);
let config = Config::new().extra_args(vec!["--block".to_string(), disk_path]);
let mut vm = TestVm::new(config).unwrap();
// Check the initial block device size.

View file

@ -288,12 +288,12 @@ impl TestVm {
/// Configures the VM rootfs to load from the guest_under_test assets.
fn configure_rootfs(command: &mut Command, o_direct: bool) {
let rootfs_and_option = format!(
"{}{}",
"{}{},ro,root",
rootfs_path().to_str().unwrap(),
if o_direct { ",o_direct=true" } else { "" }
);
command
.args(&["--root", &rootfs_and_option])
.args(&["--block", &rootfs_and_option])
.args(&["--params", "init=/bin/delegate"]);
}