From 35828d55eef4b0cdb3b1084bf36b4c6c8adf4b3a Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Tue, 5 Apr 2022 09:50:32 +0000 Subject: [PATCH] hw_hotplug: set Beetle's GPIO to high upon exiting with error Set the GPIO pin to HIGH during trap command. This is to avoid errors in other test suites, when hardware hotplug test returns with an error. Change-Id: I953d42b8f87196a072c3b4530a38b9bf59c62316 Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12155 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- 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 76871583d..a0891230b 100755 --- a/test/nvme/hw_hotplug.sh +++ b/test/nvme/hw_hotplug.sh @@ -14,6 +14,10 @@ function remove_device() { ssh root@$ip 'Beetle --SetGpio "$gpio" LOW' } +function restore_device() { + ssh root@$ip 'Beetle --SetGpio "$gpio" HIGH' +} + ip=$1 gpio=$2 driver=$3 @@ -52,7 +56,7 @@ exec >&$log 2>&1 $SPDK_EXAMPLE_DIR/hotplug -i 0 -t 100 -n 2 -r 2 $mode & hotplug_pid=$! -trap 'killprocess $hotplug_pid; exit 1' SIGINT SIGTERM EXIT +trap 'killprocess $hotplug_pid; restore_device; exit 1' SIGINT SIGTERM EXIT i=0 while ! grep "Starting I/O" $testdir/log.txt; do