X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fintegration%2Ftestlib.sh;h=4c99f3be6cf3d07e90bb8b86b2a15dbf2b70c223;hb=34317698b8c024de5c948b6f6058730b1fdbc328;hp=3d0f990bc37b90a81c51614ec48a31b8cb968755;hpb=6565c9690d7325537eb0d3f7c298037ca1843737;p=tinc diff --git a/test/integration/testlib.sh b/test/integration/testlib.sh index 3d0f990b..4c99f3be 100644 --- a/test/integration/testlib.sh +++ b/test/integration/testlib.sh @@ -45,6 +45,21 @@ DIR_BAZ=$(realdir "$PWD/$net3") # Register helper functions +if [ "$(uname -s)" = SunOS ]; then + gnu=/usr/gnu/bin + grep="$gnu/grep" + + grep() { $gnu/grep "$@"; } + tail() { $gnu/tail "$@"; } + + if ! tail /dev/null || ! echo '' | grep ''; then + echo >&2 'Sorry, native Solaris tools are not supported. Please install GNU Coreutils.' + exit $EXIT_SKIP_TEST + fi +else + grep='grep' +fi + # Alias gtimeout to timeout if it exists. if type gtimeout >/dev/null; then timeout() { gtimeout "$@"; } @@ -361,7 +376,7 @@ wait_script() { new_line=$( sh -c " - grep -n -m $count '^$script,' <'$fifo' + $grep -n -m $count '^$script,' <'$fifo' " | awk -F: 'END { print $1 }' )