]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
nvme/rc: log error if stale configuration is found
authorDaniel Wagner <dwagner@suse.de>
Tue, 26 Mar 2024 13:13:45 +0000 (14:13 +0100)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 29 Mar 2024 05:36:25 +0000 (14:36 +0900)
It's possible that a previous run of blktest left some stale
configuration left. E.g. when the module unload doesn't work (the bug
might in the kernel we are testing). In this case error out and avoid
confusion.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/nvme/rc

index 865c8c35115997e4c9f65b1bf26d387891a54b64..e67bb846ab77957f19e66da3fae4f6fe08de0330 100644 (file)
@@ -658,6 +658,11 @@ _create_nvmet_host() {
        local nvmet_ctrlkey="$4"
        local host_path="${NVMET_CFS}/hosts/${nvmet_hostnqn}"
 
+       if [[ -d "${host_path}" ]]; then
+               echo "FAIL target setup failed. stale host configuration found"
+               return 1;
+       fi
+
        mkdir "${host_path}"
        _add_nvmet_allow_hosts "${nvmet_subsystem}" "${nvmet_hostnqn}"
        if [[ "${nvmet_hostkey}" ]] ; then