From 1d4289b3c10f5d8002fd59a518fbb7b148794449 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Fri, 3 Jul 2015 04:44:05 +0100 Subject: tests: avoid side effects of $SHELL environment variable Since non interactive shells don't generally set $SHELL, its value is propagated through the tests and may cause issues; for example if $SHELL implicitly adjusts $PATH when run. Instead we set $SHELL to that determined by the posix-shell module, and use that consistently for all test sub scripts, including those created thorugh the `split --filter` command. * tests/local.mk: Explicitly set $SHELL to $(PREFERABLY_POSIX_SHELL) which defaults to $CONFIG_SHELL and thus usually /bin/sh. * tests/envvar-check: Remove bash environment variables with side effects, in case /bin/bash was selected for $SHELL. * tests/misc/help-version.sh: Remove redundant initialization of $SHELL. * tests/install/strip-program.sh: Use $SHELL for sub script. * tests/misc/sort-compress-hang.sh: Likewise. * tests/misc/sort-compress-proc.sh: Likewise. * tests/misc/sort-compress.sh: Likewise. * tests/misc/timeout-group.sh: Likewise. * tests/rm/fail-eperm.xpl: Remove redundant elision of bash env vars. * tests/misc/pwd-long.sh: Likewise. --- tests/rm/fail-eperm.xpl | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/rm') diff --git a/tests/rm/fail-eperm.xpl b/tests/rm/fail-eperm.xpl index 80299b4d4..7a5b9ce15 100755 --- a/tests/rm/fail-eperm.xpl +++ b/tests/rm/fail-eperm.xpl @@ -32,7 +32,6 @@ my $verbose = $ENV{VERBOSE} && $ENV{VERBOSE} eq 'yes'; $ENV{LC_ALL} = 'C'; # Set up a safe, well-known environment -delete @ENV{qw(BASH_ENV CDPATH ENV)}; $ENV{IFS} = ''; # Taint checking requires a sanitized $PATH. This script performs no $PATH -- cgit v1.2.3-54-g00ecf