From 13b6c53dcfb003ec0dff0663330cf7a91466d033 Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Fri, 13 May 2022 10:43:26 +0000 Subject: [PATCH] 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: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12677 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- test/nvme/hw_hotplug.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/nvme/hw_hotplug.sh b/test/nvme/hw_hotplug.sh index f41b859da..373f25d49 100755 --- a/test/nvme/hw_hotplug.sh +++ b/test/nvme/hw_hotplug.sh @@ -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