From 4d37d7eaedae964cf72e82ec959a2482916faa1b Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 7 Nov 2020 20:30:51 -0800 Subject: [PATCH] cli-tests/common.sh: fix _user_do() Apparently, on some distros 'su' doesn't preserve $PATH. So, manually export it in the command. Also, ensure that the shell stays as bash. This is needed for some of the CLI tests to pass in Travis CI. --- cli-tests/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli-tests/common.sh b/cli-tests/common.sh index 79b42ae..527eaa4 100644 --- a/cli-tests/common.sh +++ b/cli-tests/common.sh @@ -117,7 +117,7 @@ _user_do() { [ $# -ne 1 ] && _fail "wrong argument count to ${FUNCNAME[0]}" - su "$TEST_USER" --command="$1" + su "$TEST_USER" --shell=/bin/bash --command="export PATH='$PATH'; $1" } # Runs the given shell command as the test user and expects it to fail. -- 2.39.5