tests: support setting/using blank content env variables
- test450: remove --config from the keywords - test2080: change return code - test428: add --config as a keyword - test428: disable on Windows due to CI problems
This commit is contained in:
parent
0f0edc283c
commit
7cf8414fab
@ -522,9 +522,14 @@ Brief test case description, shown when the test runs.
|
||||
### `<setenv>`
|
||||
variable1=contents1
|
||||
variable2=contents2
|
||||
variable3
|
||||
|
||||
Set the given environment variables to the specified value before the actual
|
||||
command is run. They are cleared again after the command has been run.
|
||||
command is run. They are restored back to their former values again after the
|
||||
command has been run.
|
||||
|
||||
If the variable name has no assignment, no `=`, then that variable is just
|
||||
deleted.
|
||||
|
||||
### `<command [option="no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
|
||||
Command line to run.
|
||||
|
||||
Binary file not shown.
@ -3,6 +3,7 @@
|
||||
<keywords>
|
||||
HTTP
|
||||
variables
|
||||
--config
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
@ -28,6 +29,14 @@ Funny-head: yesyes
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
|
||||
# For unknown reasons, a number of CI jobs on Appveyor keep returning NULL to
|
||||
# getenv() for the blank environment variable which makes the test fail.
|
||||
# Unfortunately, this makes me disable the test completely on Windows.
|
||||
|
||||
<features>
|
||||
!win32
|
||||
</features>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
--config
|
||||
variables
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
@ -648,15 +648,15 @@ sub singletest_setenv {
|
||||
my @setenv = getpart("client", "setenv");
|
||||
foreach my $s (@setenv) {
|
||||
chomp $s;
|
||||
if($s =~ /([^=]*)=(.*)/) {
|
||||
if($s =~ /([^=]*)(.*)/) {
|
||||
my ($var, $content) = ($1, $2);
|
||||
# remember current setting, to restore it once test runs
|
||||
$oldenv{$var} = ($ENV{$var})?"$ENV{$var}":'notset';
|
||||
# set new value
|
||||
if(!$content) {
|
||||
delete $ENV{$var} if($ENV{$var});
|
||||
}
|
||||
else {
|
||||
|
||||
if($content =~ /^=(.*)/) {
|
||||
# assign it
|
||||
$content = $1;
|
||||
|
||||
if($var =~ /^LD_PRELOAD/) {
|
||||
if(exe_ext('TOOL') && (exe_ext('TOOL') eq '.exe')) {
|
||||
logmsg "Skipping LD_PRELOAD due to lack of OS support\n" if($verbose);
|
||||
@ -670,6 +670,11 @@ sub singletest_setenv {
|
||||
$ENV{$var} = "$content";
|
||||
logmsg "setenv $var = $content\n" if($verbose);
|
||||
}
|
||||
else {
|
||||
# remove it
|
||||
delete $ENV{$var} if($ENV{$var});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($proxy_address) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user