Commit 35828d55 authored by Krzysztof Karas's avatar Krzysztof Karas Committed by Tomasz Zawadzki
Browse files

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: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12155


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 6e09fdc4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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