<verify>
<errorcode>
-numerical error code curl is supposed to return
+numerical error code curl is supposed to return. Specify a list of accepted
+error codes by separating multiple numbers with comma. See test 237 for an
+example.
</errorcode>
<strip>
One regex per line that is removed from the protocol dumps before the
<verify>
# curl: (15) Can't resolve new host 1218.91.256.127:32639
# 15 => CURLE_FTP_CANT_GET_HOST
+# some systems just don't fail on the illegal host name/address but instead
+# moves on and attempt to connect to... yes, to what?
+# 7= CURLE_COULDNT_CONNECT
<errorcode>
-15
+15, 7
</errorcode>
<protocol>
USER anonymous\r
}
my @err = getpart("verify", "errorcode");
- my $errorcode = $err[0];
+ my $errorcode = $err[0] || "0";
my $res;
if (@validstdout) {
}
}
- if($errorcode == $cmdres) {
- $errorcode =~ s/\n//;
+ # accept multiple comma-separated error codes
+ my @splerr = split(/ *, */, $errorcode);
+ my $errok;
+ my $e;
+ foreach $e (@splerr) {
+ if($e == $cmdres) {
+ # a fine error code
+ $errok = 1;
+ last;
+ }
+ }
+
+ if($errok) {
if($verbose) {
- print " received exitcode $errorcode OK";
+ print " received exitcode $cmdres OK";
}
elsif(!$short) {
print " exit OK";
}
else {
if(!$short) {
- print "\ncurl returned $cmdres, ".(0+$errorcode)." was expected\n";
+ printf "\ncurl returned $cmdres, %s was expected\n", $errorcode;
}
print " exit FAILED\n";
return 1;