summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12) <hs@schlittermann.de>2015-04-07 21:44:00 +0200
committerHeiko Schlittermann (HS12) <hs@schlittermann.de>2015-04-25 21:00:20 +0200
commit26ab1da32241a0be1cf08ce866b00429fc35d06d (patch)
tree90dab3135bfad6c38956abec3fc368d8729aa562 /test
parentf4bb1d53d09d28cd6314a9e244d7a31d32e4bbdb (diff)
Testsuite: Auto-detect missing sbin directories
The runtest script maps bin directories to matching sbin directories, if they are not already included in the $PATH. This is mainly a comfort feature to find ifconfig on some systems automatically.
Diffstat (limited to 'test')
-rwxr-xr-xtest/runtest9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/runtest b/test/runtest
index 6c98a702c..0a2ede9ef 100755
--- a/test/runtest
+++ b/test/runtest
@@ -2207,6 +2207,15 @@ return $yield; # Ran command and waited
autoflush STDOUT 1;
print "Exim tester $testversion\n";
+# extend the PATH with .../sbin
+# we map all (.../bin) to (.../sbin:.../bin)
+$ENV{PATH} = do {
+ my %seen = map { $_, 1 } split /:/, $ENV{PATH};
+ join ':' => map { m{(.*)/bin$}
+ ? ( $seen{"$1/sbin"} ? () : ("$1/sbin"), $_)
+ : ($_) }
+ split /:/, $ENV{PATH};
+};
##################################################
# Some tests check created file modes #