mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
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:
parent
86148a9ceb
commit
ddf9b82855
2 changed files with 5 additions and 5 deletions
|
@ -37,10 +37,10 @@ fn prepare_disk_img() -> NamedTempFile {
|
||||||
#[test]
|
#[test]
|
||||||
fn mount_block() {
|
fn mount_block() {
|
||||||
let disk = prepare_disk_img();
|
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}");
|
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();
|
let mut vm = TestVm::new(config).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
vm.exec_in_guest("mount -t ext4 /dev/vdb /mnt && echo 42")
|
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();
|
let disk_path = disk.path().to_str().unwrap().to_string();
|
||||||
println!("disk={disk_path}");
|
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();
|
let mut vm = TestVm::new(config).unwrap();
|
||||||
|
|
||||||
// Check the initial block device size.
|
// Check the initial block device size.
|
||||||
|
|
|
@ -288,12 +288,12 @@ impl TestVm {
|
||||||
/// Configures the VM rootfs to load from the guest_under_test assets.
|
/// Configures the VM rootfs to load from the guest_under_test assets.
|
||||||
fn configure_rootfs(command: &mut Command, o_direct: bool) {
|
fn configure_rootfs(command: &mut Command, o_direct: bool) {
|
||||||
let rootfs_and_option = format!(
|
let rootfs_and_option = format!(
|
||||||
"{}{}",
|
"{}{},ro,root",
|
||||||
rootfs_path().to_str().unwrap(),
|
rootfs_path().to_str().unwrap(),
|
||||||
if o_direct { ",o_direct=true" } else { "" }
|
if o_direct { ",o_direct=true" } else { "" }
|
||||||
);
|
);
|
||||||
command
|
command
|
||||||
.args(&["--root", &rootfs_and_option])
|
.args(&["--block", &rootfs_and_option])
|
||||||
.args(&["--params", "init=/bin/delegate"]);
|
.args(&["--params", "init=/bin/delegate"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue