mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: fix parallel rw disk access
The new locking behavior uncovered that unfortunate test situation: Many tests running in parallel access the same disk image with rw permissions. Luckily, none of the tests actually writes to the disk. Therefore, we can set it to readonly=true. In case this changes, the test needs to be moved to the sequential test module. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
05968f5c2c
commit
d4718a9bc8
+22
-4
@@ -4445,7 +4445,7 @@ mod common_parallel {
|
|||||||
)
|
)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
format!("path={}", vfio_disk_path.to_str().unwrap()).as_str(),
|
format!("path={}", vfio_disk_path.to_str().unwrap()).as_str(),
|
||||||
format!("path={},iommu=on", blk_file_path.to_str().unwrap()).as_str(),
|
format!("path={},iommu=on,readonly=true", blk_file_path.to_str().unwrap()).as_str(),
|
||||||
])
|
])
|
||||||
.args([
|
.args([
|
||||||
"--cmdline",
|
"--cmdline",
|
||||||
@@ -5193,7 +5193,13 @@ mod common_parallel {
|
|||||||
assert!(!remote_command(
|
assert!(!remote_command(
|
||||||
&api_socket,
|
&api_socket,
|
||||||
"add-disk",
|
"add-disk",
|
||||||
Some(format!("path={},id=test0", blk_file_path.to_str().unwrap()).as_str()),
|
Some(
|
||||||
|
format!(
|
||||||
|
"path={},id=test0,readonly=true",
|
||||||
|
blk_file_path.to_str().unwrap()
|
||||||
|
)
|
||||||
|
.as_str()
|
||||||
|
),
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -5255,7 +5261,13 @@ mod common_parallel {
|
|||||||
let (cmd_success, cmd_output) = remote_command_w_output(
|
let (cmd_success, cmd_output) = remote_command_w_output(
|
||||||
&api_socket,
|
&api_socket,
|
||||||
"add-disk",
|
"add-disk",
|
||||||
Some(format!("path={},id=test0", blk_file_path.to_str().unwrap()).as_str()),
|
Some(
|
||||||
|
format!(
|
||||||
|
"path={},id=test0,readonly=true",
|
||||||
|
blk_file_path.to_str().unwrap()
|
||||||
|
)
|
||||||
|
.as_str(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
assert!(cmd_success);
|
assert!(cmd_success);
|
||||||
assert!(String::from_utf8_lossy(&cmd_output)
|
assert!(String::from_utf8_lossy(&cmd_output)
|
||||||
@@ -5296,7 +5308,13 @@ mod common_parallel {
|
|||||||
let (cmd_success, cmd_output) = remote_command_w_output(
|
let (cmd_success, cmd_output) = remote_command_w_output(
|
||||||
&api_socket,
|
&api_socket,
|
||||||
"add-disk",
|
"add-disk",
|
||||||
Some(format!("path={},id=test0", blk_file_path.to_str().unwrap()).as_str()),
|
Some(
|
||||||
|
format!(
|
||||||
|
"path={},id=test0,readonly=true",
|
||||||
|
blk_file_path.to_str().unwrap()
|
||||||
|
)
|
||||||
|
.as_str(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
assert!(cmd_success);
|
assert!(cmd_success);
|
||||||
assert!(String::from_utf8_lossy(&cmd_output)
|
assert!(String::from_utf8_lossy(&cmd_output)
|
||||||
|
|||||||
Reference in New Issue
Block a user