From d4718a9bc8f019c14517a21caa85d85476cf79ac Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Wed, 14 May 2025 11:09:12 +0200 Subject: [PATCH] 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 On-behalf-of: SAP philipp.schuster@sap.com --- tests/integration.rs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index d362eb6f9..8b7450087 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -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)