From: Miroslav Lichvar Date: Fri, 26 Apr 2019 08:04:15 +0000 (+0200) Subject: test: use env in shebang of system tests X-Git-Tag: 3.5-pre1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86a99bb257a055921bb006ed41ede30e4c5f7865;p=thirdparty%2Fchrony.git test: use env in shebang of system tests This should allow the tests to run on systems where bash is not in /bin. --- diff --git a/test/system/001-minimal b/test/system/001-minimal index daa1f73f..107fa3f6 100755 --- a/test/system/001-minimal +++ b/test/system/001-minimal @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/002-extended b/test/system/002-extended index 03728c88..7a6734f5 100755 --- a/test/system/002-extended +++ b/test/system/002-extended @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/003-memlock b/test/system/003-memlock index 0369d1ec..e4ab1bf4 100755 --- a/test/system/003-memlock +++ b/test/system/003-memlock @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/004-priority b/test/system/004-priority index 976747b3..bf8a04bd 100755 --- a/test/system/004-priority +++ b/test/system/004-priority @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/005-scfilter b/test/system/005-scfilter index 285d14d1..778a6882 100755 --- a/test/system/005-scfilter +++ b/test/system/005-scfilter @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/006-privdrop b/test/system/006-privdrop index 57565344..6d7b0c9d 100755 --- a/test/system/006-privdrop +++ b/test/system/006-privdrop @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/007-cmdmon b/test/system/007-cmdmon index f97954a5..f705fb07 100755 --- a/test/system/007-cmdmon +++ b/test/system/007-cmdmon @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/100-clockupdate b/test/system/100-clockupdate index 1d698e10..191e461b 100755 --- a/test/system/100-clockupdate +++ b/test/system/100-clockupdate @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/101-rtc b/test/system/101-rtc index 82c8d51d..fa9a70d4 100755 --- a/test/system/101-rtc +++ b/test/system/101-rtc @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/102-hwtimestamp b/test/system/102-hwtimestamp index a09b1d9f..86f22874 100755 --- a/test/system/102-hwtimestamp +++ b/test/system/102-hwtimestamp @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/103-refclock b/test/system/103-refclock index 623b9de5..e5b74e0d 100755 --- a/test/system/103-refclock +++ b/test/system/103-refclock @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash . ./test.common diff --git a/test/system/104-systemdirs b/test/system/104-systemdirs index a8ee0566..15508dc5 100755 --- a/test/system/104-systemdirs +++ b/test/system/104-systemdirs @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash TEST_LIBDIR=${CHRONY_LIBDIR:-/var/lib/chrony} TEST_LOGDIR=${CHRONY_LOGDIR:-/var/log/chrony} diff --git a/test/system/run b/test/system/run index b31a36ca..5516ed41 100755 --- a/test/system/run +++ b/test/system/run @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash print_help() { echo "$1 [-a] [-d] [TEST]..." diff --git a/test/system/test.common b/test/system/test.common index 9ac05bb9..28c48055 100644 --- a/test/system/test.common +++ b/test/system/test.common @@ -38,7 +38,7 @@ test_start() { if [ "$user" != "root" ]; then id -u "$user" > /dev/null 2> /dev/null || test_skip "missing user $user" chown "$user:$(id -g "$user")" "$TEST_DIR" || test_skip "could not chown $TEST_DIR" - su "$user" -s /bin/bash -c "touch $TEST_DIR/test" 2> /dev/null || \ + su "$user" -s /bin/sh -c "touch $TEST_DIR/test" 2> /dev/null || \ test_skip "$user cannot access $TEST_DIR" rm "$TEST_DIR/test" fi