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 <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: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Krzysztof Karas 2022-04-05 09:50:32 +00:00 committed by Tomasz Zawadzki
parent 6e09fdc4e5
commit 35828d55ee

View File

@ -14,6 +14,10 @@ function remove_device() {
ssh root@$ip 'Beetle --SetGpio "$gpio" LOW' ssh root@$ip 'Beetle --SetGpio "$gpio" LOW'
} }
function restore_device() {
ssh root@$ip 'Beetle --SetGpio "$gpio" HIGH'
}
ip=$1 ip=$1
gpio=$2 gpio=$2
driver=$3 driver=$3
@ -52,7 +56,7 @@ exec >&$log 2>&1
$SPDK_EXAMPLE_DIR/hotplug -i 0 -t 100 -n 2 -r 2 $mode & $SPDK_EXAMPLE_DIR/hotplug -i 0 -t 100 -n 2 -r 2 $mode &
hotplug_pid=$! hotplug_pid=$!
trap 'killprocess $hotplug_pid; exit 1' SIGINT SIGTERM EXIT trap 'killprocess $hotplug_pid; restore_device; exit 1' SIGINT SIGTERM EXIT
i=0 i=0
while ! grep "Starting I/O" $testdir/log.txt; do while ! grep "Starting I/O" $testdir/log.txt; do