tests: Fix browser.sh path detection to be less STI specific

Only set `$SOURCE` to ./source/ if that actually exists, which is when
it is being called through Standard Test Interface.

Provide fallbacks for using FMF [1] or when calling the script manually.

[1] https://github.com/cockpit-project/cockpit-podman/pull/649
This commit is contained in:
Martin Pitt 2021-01-19 07:54:36 +01:00
parent f7239450eb
commit 25768f40dd

View File

@ -1,10 +1,14 @@
#!/bin/sh
set -eux
# from standard-test-source
SOURCE="$(pwd)/source"
TESTS="$(realpath $(dirname "$0"))"
if [ -d source ]; then
# path for standard-test-source
SOURCE="$(pwd)/source"
else
SOURCE="$(realpath $TESTS/..)"
fi
LOGS="$(pwd)/logs"
TESTS="$(pwd)/tests"
mkdir -p "$LOGS"
chmod a+w "$LOGS"