mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: Replace manual losetup with create_loop_device() call
Use the ioctl based create_loop_device() helper instead of shelling out to losetup in the file backed 4K alignment test. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
4772235952
commit
e38f00644d
@@ -3529,12 +3529,7 @@ mod common_parallel {
|
||||
"truncate failed"
|
||||
);
|
||||
|
||||
let loop_dev = exec_host_command_output(&format!(
|
||||
"losetup --find --show --sector-size 4096 {}",
|
||||
fs_img_path.to_str().unwrap()
|
||||
));
|
||||
assert!(loop_dev.status.success(), "losetup failed");
|
||||
let loop_dev_path = String::from_utf8_lossy(&loop_dev.stdout).trim().to_string();
|
||||
let loop_dev_path = create_loop_device(fs_img_path.to_str().unwrap(), 4096, 5);
|
||||
|
||||
assert!(
|
||||
exec_host_command_output(&format!("mkfs.ext4 -q {loop_dev_path}"))
|
||||
|
||||
Reference in New Issue
Block a user