Allow NOAUTH to test that people really do need to log in. A regression

test identifying that.
This commit is contained in:
Andrew McMillan 2006-11-01 10:13:13 +13:00
parent 203351337c
commit bc1065c637
2 changed files with 20 additions and 1 deletions

View File

@ -8,10 +8,11 @@ my $test=$ARGV[1];
usage() unless ( defined($suite) && defined($test) );
my @arguments = ( "--basic", "--user", "user1:user1", "--proxy", "", "--silent" );
my @arguments = ( "--basic", "--proxy", "", "--silent" );
push @arguments, "--verbose" if ( defined($ARGV[2]) );
my $url;
my @auth = ( "--user", "user1:user1" );
my $datafile = "tests/$suite/$test.data";
@ -23,6 +24,14 @@ while( <TEST> ) {
push @arguments, "--include";
};
/^\s*NOAUTH\s*(#|$|=)/ && do {
@auth = ();
};
/^\s*AUTH\s*=\s*(\S.*)$/ && do {
@auth = ( "--user", $1 );
};
/^\s*DATA\s*=\s*(\S.*)$/ && do {
$datafile="tests/$suite/$1.data";
};
@ -55,6 +64,8 @@ EOERROR
exit (2);
}
push @arguments, @auth;
if ( -f $datafile ) {
push @arguments, "--data-binary", "\@$datafile";
# print "Using datafile: ", $datafile,"\n";

View File

@ -0,0 +1,8 @@
HTTP/1.1 401 Unauthorized
Date: Dow, 01 Jan 2000 00:00:00 GMT
Server: Apache/2.2.3 (Debian) DAV/2
WWW-Authenticate: Basic realm="Really Simple CalDAV Store"
Content-Length: 40
Content-Type: text/html; charset=UTF-8
Please log in for access to this system.