Commit 13b6c53d authored by Krzysztof Karas's avatar Krzysztof Karas Committed by Tomasz Zawadzki
Browse files

hw_hotplug: remove log.txt before exiting script



hw_hotplug job would most of the time throw errors on one of device
removals, while running with vfio-pci driver. This issue was not
present for uio_pci_generic driver.

The hw_hotplug.sh script would detect "Starting I/O..."
log, before "Initializing NVMe Controllers" in function
register_controllers() was printed. This indicates
that the log.txt contained logs from previous hw_hotplug
test.

Change-Id: Iad56511ba689cd6b2a794aee6b952c7bba0fe8ef
Signed-off-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12677


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 38012f56
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ exec >&$log 2>&1
$SPDK_EXAMPLE_DIR/hotplug -i 0 -t 100 -n 2 -r 2 $mode &
hotplug_pid=$!

trap 'killprocess $hotplug_pid; restore_device; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $hotplug_pid; restore_device; rm $testdir/log.txt; exit 1' SIGINT SIGTERM EXIT

i=0
while ! grep "Starting I/O" $testdir/log.txt; do
@@ -77,6 +77,7 @@ while ! grep "Starting I/O" $testdir/log.txt; do
done

if ! grep "Starting I/O" $testdir/log.txt; then
	rm $testdir/log.txt
	exit 1
fi

@@ -94,11 +95,14 @@ timing_enter wait_for_example

if ! wait $hotplug_pid; then
	echo "Hotplug example returned error!"
	rm $testdir/log.txt
	exit 1
fi

timing_exit wait_for_example

rm $testdir/log.txt

trap - SIGINT SIGTERM EXIT

timing_exit hotplug_hw_test