X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/382bf15bed5d85fe017dd3b7d117eeb28f219358..bc3c7bb7d4aba3e563434e5627fe1f2176aa18c0:/test/runtest diff --git a/test/runtest b/test/runtest index 8dcb0587c..18ed0915d 100755 --- a/test/runtest +++ b/test/runtest @@ -349,7 +349,7 @@ $spid = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; # that are specific to certain file types, though there are also some of those # inline too. -while() +LINE: while() { RESET_AFTER_EXTRA_LINE_READ: # Custom munges @@ -564,6 +564,25 @@ RESET_AFTER_EXTRA_LINE_READ: # signature algorithm names s/RSA-SHA1/RSA-SHA/; + # -d produces a list of environement variables as they are checked if they exist in the + # in the environment. Unfortunately this list isn't always in the same order. For now we + # just remove this list + # + if (/^\w+ in keep_environment/) + { + my @lines = $_; + while () + { + if (/^\w+ in keep_environment/) + { + push @lines, $_; + next; + } + print MUNGED sort grep { !/^(SHLVL|_) / } @lines; + redo LINE; + } + } + # ======== Caller's login, uid, gid, home, gecos ======== @@ -1686,6 +1705,8 @@ my($commandnameref) = $_[3]; my($aux_info) = $_[4]; my($yield) = 1; +our %ENV = map { $_ => $ENV{$_} } grep { /^(?:USER|SHELL|PATH|TERM|EXIM_TEST_.*)$/ } keys %ENV; + if (/^(\d+)\s*$/) # Handle unusual return code { my($r) = $_[2]; @@ -2089,7 +2110,7 @@ if (/^client/ || /^(sudo\s+)?perl\b/) # not drop privilege when -C and -D options are present. To run the exim # command as root, we use sudo. -elsif (/^([A-Z_]+=\S+\s+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+)?\s+(.*)$/) +elsif (/^((?i:[A-Z\d_]+=\S+\s+)+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+)?\s+(.*)$/) { $args = $6; my($envset) = (defined $1)? $1 : "";