diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 8841671616..dcfd229339 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -578,6 +578,7 @@ function iscsicleanup() { echo "Cleaning up iSCSI connection" iscsiadm -m node --logout || true iscsiadm -m node -o delete || true + rm -rf /var/lib/iscsi/nodes/* } function stop_iscsi_service() { diff --git a/test/iscsi_tgt/iscsi_tgt.sh b/test/iscsi_tgt/iscsi_tgt.sh index bc85875d04..0316229b60 100755 --- a/test/iscsi_tgt/iscsi_tgt.sh +++ b/test/iscsi_tgt/iscsi_tgt.sh @@ -17,6 +17,10 @@ else exit 1 fi +# Run cleanup once to make sure we remove any stale iscsiadm +# entries if they were missed in previous runs +iscsicleanup + # Network configuration create_veth_interfaces $TEST_TYPE