From d40f27c34fca5f571ad130157d8499413a4b6939 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Mon, 21 May 2012 22:16:00 +0100 Subject: [PATCH] Testsuite: more robust fix for SHELL vs /bin/sh, take two. --- test/log/0369 | 8 ++++---- test/runtest | 13 +++++++------ test/stdout/0137 | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/test/log/0369 b/test/log/0369 index 160da5f7b..174ea1a84 100644 --- a/test/log/0369 +++ b/test/log/0369 @@ -1,11 +1,11 @@ 1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 10HmaX-0005vi-00 => 0 <0@test.ex> R=r1 T=t1 -1999-03-02 09:44:33 10HmaX-0005vi-00 ** 10@test.ex R=r1 T=t1: Child process of t1 transport returned 10 from command: SHELL -1999-03-02 09:44:33 10HmaX-0005vi-00 == 45@test.ex R=r1 T=t1 defer (0): Child process of t1 transport returned 45 from command: SHELL +1999-03-02 09:44:33 10HmaX-0005vi-00 ** 10@test.ex R=r1 T=t1: Child process of t1 transport returned 10 from command: /bin/sh +1999-03-02 09:44:33 10HmaX-0005vi-00 == 45@test.ex R=r1 T=t1 defer (0): Child process of t1 transport returned 45 from command: /bin/sh 1999-03-02 09:44:33 10HmaY-0005vi-00 <= <> R=10HmaX-0005vi-00 U=EXIMUSER P=local S=sss 1999-03-02 09:44:33 10HmaY-0005vi-00 ** CALLER@myhost.test.ex: I can't route to CALLER 1999-03-02 09:44:33 10HmaY-0005vi-00 Frozen (delivery error message) 1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 10HmaZ-0005vi-00 => 0 <0@test2.ex> R=r2 T=t2 -1999-03-02 09:44:33 10HmaZ-0005vi-00 == 10@test2.ex R=r2 T=t2 defer (0): Child process of t2 transport returned 10 from command: SHELL -1999-03-02 09:44:33 10HmaZ-0005vi-00 == 45@test2.ex R=r2 T=t2 defer (0): Child process of t2 transport returned 45 from command: SHELL +1999-03-02 09:44:33 10HmaZ-0005vi-00 == 10@test2.ex R=r2 T=t2 defer (0): Child process of t2 transport returned 10 from command: /bin/sh +1999-03-02 09:44:33 10HmaZ-0005vi-00 == 45@test2.ex R=r2 T=t2 defer (0): Child process of t2 transport returned 45 from command: /bin/sh diff --git a/test/runtest b/test/runtest index 3e961ca98..dac02779c 100755 --- a/test/runtest +++ b/test/runtest @@ -344,6 +344,9 @@ RESET_AFTER_EXTRA_LINE_READ: # But convert "name=the.local.host address=127.0.0.1" to use "localhost" s/name=the\.local\.host address=127\.0\.0\.1/name=localhost address=127.0.0.1/g; + # The name of the shell may vary + s/\s\Q$parm_shell\E\b/ ENV_SHELL/; + # Replace the path to the testsuite directory s?\Q$parm_cwd\E?TESTSUITE?g; @@ -391,9 +394,6 @@ RESET_AFTER_EXTRA_LINE_READ: # The message for a non-listening FIFO varies s/:[^:]+: while opening named pipe/: Error: while opening named pipe/; - # The name of the shell may vary - s/\s\Q$parm_shell\E\b/ SHELL/; - # Debugging output of lists of hosts may have different sort keys s/sort=\S+/sort=xx/ if /^\S+ (?:\d+\.){3}\d+ mx=\S+ sort=\S+/; @@ -2728,9 +2728,6 @@ if ($parm_hostname =~ /[[:upper:]]/) print "\n*** Host name has upper case characters: this may cause problems ***\n\n"; } -# Find the user's shell - -$parm_shell = $ENV{'SHELL'}; ################################################## @@ -3051,6 +3048,10 @@ foreach $basedir ("aux-var", "dnszones") } } +# Set a user's shell, distinguishable from /bin/sh + +symlink("/bin/sh","aux-var/sh"); +$ENV{'SHELL'} = $parm_shell = $parm_cwd . "/aux-var/sh"; ################################################## # Create fake DNS zones for this host # diff --git a/test/stdout/0137 b/test/stdout/0137 index 07baa99b8..a7e9192e5 100644 --- a/test/stdout/0137 +++ b/test/stdout/0137 @@ -3,12 +3,12 @@ exim_lock: lockname = test-mail/userx.lock exim_lock: creating lock file exim_lock: lock file successfully created exim_lock: fcntl() lock successfully applied -exim_lock: locking test-mail/userx succeeded: running SHELL ... +exim_lock: locking test-mail/userx succeeded: running ENV_SHELL ... exim_lock: test-mail/userx closed exim_lock: lock file removed exim_lock: fcntl() lock successfully applied -exim_lock: locking test-mail/userx succeeded: running SHELL ... +exim_lock: locking test-mail/userx succeeded: running ENV_SHELL ... exim_lock: test-mail/userx closed exim_lock: fcntl() lock successfully applied -exim_lock: locking test-mail/userx succeeded: running SHELL ... +exim_lock: locking test-mail/userx succeeded: running ENV_SHELL ... exim_lock: test-mail/userx closed -- 2.25.1