From 25768f40dd00a0268b1f28f3395935c09bc54251 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 19 Jan 2021 07:54:36 +0100 Subject: [PATCH] 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 --- tests/browser.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/browser.sh b/tests/browser.sh index 25dd32e..d8ed6bc 100755 --- a/tests/browser.sh +++ b/tests/browser.sh @@ -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"