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:
Philipp Schuster 2025-05-14 11:09:12 +02:00 committed by Rob Bradford
parent 05968f5c2c
commit d4718a9bc8

View file

@ -4445,7 +4445,7 @@ mod common_parallel {
)
.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([
"--cmdline",
@ -5193,7 +5193,13 @@ mod common_parallel {
assert!(!remote_command(
&api_socket,
"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(
&api_socket,
"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!(String::from_utf8_lossy(&cmd_output)
@ -5296,7 +5308,13 @@ mod common_parallel {
let (cmd_success, cmd_output) = remote_command_w_output(
&api_socket,
"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!(String::from_utf8_lossy(&cmd_output)