]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests: Add path smarts to the shell scripts
authorTom Hromatka <tom.hromatka@oracle.com>
Fri, 20 Jan 2023 16:49:26 +0000 (09:49 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 20 Jan 2023 16:49:26 +0000 (09:49 -0700)
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 <tom.hromatka@oracle.com>
tests/ftests/ftests-nocontainer.sh
tests/ftests/ftests.sh

index 4725fede2d54b56e91f42e2d4b1b0cda2335a127..d34b69eae8f55aa86beb3e8e08dd16177e43f536 100755 (executable)
@@ -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
index ce754fb7c5eca9344e31fc16381c878c63dcaf08..a46bb2da9c2be7a6c725a099cd724c285eedd1ba 100755 (executable)
@@ -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