From c4a99d9fd0735bd90b4b7091caab37ae9e217feb Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Fri, 20 Jan 2023 09:49:26 -0700 Subject: [PATCH] ftests: Add path smarts to the shell scripts Add path smarts to ftests.sh and ftests-nocontainer.sh. When invoked from `make distcheck`, the paths need to be corrected to account for the non-standard build directory. Signed-off-by: Tom Hromatka --- tests/ftests/ftests-nocontainer.sh | 17 +++++++++++++++++ tests/ftests/ftests.sh | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/tests/ftests/ftests-nocontainer.sh b/tests/ftests/ftests-nocontainer.sh index 4725fede..d34b69ea 100755 --- a/tests/ftests/ftests-nocontainer.sh +++ b/tests/ftests/ftests-nocontainer.sh @@ -1,2 +1,19 @@ #!/bin/bash + +START_DIR=$PWD +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [ "$START_DIR" != "$SCRIPT_DIR" ]; then + cp "$SCRIPT_DIR"/*.py "$START_DIR" +fi + ./ftests.py -l 10 -L ftests-nocontainer.log --skip 28 --no-container +RET=$? + +if [ "$START_DIR" != "$SCRIPT_DIR" ]; then + rm -f "$START_DIR"/*.py + rm -fr "$START_DIR"/__pycache__ + rm -f ftests.py.log +fi + +exit $RET diff --git a/tests/ftests/ftests.sh b/tests/ftests/ftests.sh index ce754fb7..a46bb2da 100755 --- a/tests/ftests/ftests.sh +++ b/tests/ftests/ftests.sh @@ -1,2 +1,19 @@ #!/bin/bash + +START_DIR=$PWD +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [ "$START_DIR" != "$SCRIPT_DIR" ]; then + cp "$SCRIPT_DIR"/*.py "$START_DIR" +fi + ./ftests.py -l 10 -L ftests.log +RET=$? + +if [ "$START_DIR" != "$SCRIPT_DIR" ]; then + rm -f "$START_DIR"/*.py + rm -fr "$START_DIR"/__pycache__ + rm -f ftests.py.log +fi + +exit $RET -- 2.47.2