diff mbox series

tools/testing/cxl: slow down the mock firmware transfer

Message ID 20231026-vv-fw_upd_test_fix-v1-1-a6345df5550b@intel.com
State Superseded
Headers show
Series tools/testing/cxl: slow down the mock firmware transfer | expand

Commit Message

Verma, Vishal L Oct. 26, 2023, 5:20 p.m. UTC
The cxl-cli unit test for firmware update does operations like starting
an asynchronous firmware update, making sure it is in progress, and
attempting to cancel it. In some cases, such as with no or minimal
dynamic debugging turned on, the firmware update completes too quickly,
not allowing the test to have a chance to verify it was in progress.
This caused a failure of the signature:

  expected fw_update_in_progress:true
  test/cxl-update-firmware.sh: failed at line 88

Fix this by adding a fixed delay (2ms) to each firmware transfer
request handled by the mocked interface.

Reported-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 tools/testing/cxl/test/mem.c | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa
change-id: 20231026-vv-fw_upd_test_fix-533e9a63f005

Best regards,

Comments

Dan Williams Oct. 26, 2023, 5:23 p.m. UTC | #1
Vishal Verma wrote:
> The cxl-cli unit test for firmware update does operations like starting
> an asynchronous firmware update, making sure it is in progress, and
> attempting to cancel it. In some cases, such as with no or minimal
> dynamic debugging turned on, the firmware update completes too quickly,
> not allowing the test to have a chance to verify it was in progress.
> This caused a failure of the signature:
> 
>   expected fw_update_in_progress:true
>   test/cxl-update-firmware.sh: failed at line 88
> 
> Fix this by adding a fixed delay (2ms) to each firmware transfer
> request handled by the mocked interface.
> 
> Reported-by: Dan Williams <dan.j.williams@intel.com>

Tested-by: Dan Williams <dan.j.williams@intel.com>

Thanks, Vishal!
diff mbox series

Patch

diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
index 464fc39ed277..a74da69876f2 100644
--- a/tools/testing/cxl/test/mem.c
+++ b/tools/testing/cxl/test/mem.c
@@ -1237,6 +1237,7 @@  static int mock_transfer_fw(struct cxl_mockmem_data *mdata,
 	}
 
 	memcpy(fw + offset, transfer->data, length);
+	udelay(2000);
 	return 0;
 }