From abf212ea6af610437d966280b0835f56f951e5e5 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 27 Apr 2023 15:41:45 +0200 Subject: [PATCH] test/spdkcli: Wait until spdkcli_clear_config settled Similarly to https://review.spdk.io/gerrit/c/spdk/spdk/+/17559, this part may also be affected by: Error in cmd: load_config /root/spdk/test/spdkcli/config.json ( load_config /root/spdk/test/spdkcli/config.json request: { "action_on_timeout": "none", "timeout_us": 0, "timeout_admin_us": 0, "keep_alive_timeout_ms": 10000, "transport_retry_count": 4, "arbitration_burst": 0, "low_priority_weight": 0, "medium_priority_weight": 0, "high_priority_weight": 0, "nvme_adminq_poll_period_us": 10000, "nvme_ioq_poll_period_us": 0, "io_queue_requests": 1024, "delay_cmd_submit": true, "bdev_retry_count": 3, "transport_ack_timeout": 0, "ctrlr_loss_timeout_sec": 0, "reconnect_delay_sec": 0, "fast_io_fail_timeout_sec": 0, "generate_uuids": false, "transport_tos": 0, "io_path_stat": false, "method": "bdev_nvme_set_options", "req_id": 31 } Got JSON-RPC error response response: { "code": -1, "message": "RPC not permitted with nvme controllers already attached" } so make sure the nvme controller was fully detached. Change-Id: Iaebed7b640d96fbabfc694dfebc5a725902caad2 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17850 Reviewed-by: Konrad Sztyber Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris --- test/spdkcli/vhost.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/spdkcli/vhost.sh b/test/spdkcli/vhost.sh index 5901916ea..41b7c6744 100755 --- a/test/spdkcli/vhost.sh +++ b/test/spdkcli/vhost.sh @@ -122,6 +122,10 @@ $spdkcli_job "'vhost/scsi/vhost_scsi2 remove_target 2' 'Nvme0n1p3' " timing_exit spdkcli_clear_config +# Make sure we wait long enough for the nvme ctrl to disappear, otherwise +# we are at risk of hitting -EPERM while loading bdev configuration. +xtrace_disable_per_cmd wait_for_all_nvme_ctrls_to_detach + timing_enter spdkcli_load_config $spdkcli_job "'load_config $testdir/config.json' '/lvol_stores create lvs0 Malloc0' 'lvs0' True