summaryrefslogtreecommitdiff
path: root/tests/mod-auth.t
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2015-12-04 20:11:35 +0000
committerStefan Bühler <stbuehler@web.de>2015-12-04 20:11:35 +0000
commit1566748b1afd4f2216b3a0b8bc47b7cb1f960fc0 (patch)
tree86c33fcc032af6fc22bbe24827bfebf11c816faf /tests/mod-auth.t
parent2bcb73cdb80d58ea4bd501b9337d5e1ad70cd28f (diff)
downloadlighttpd1.4-1566748b1afd4f2216b3a0b8bc47b7cb1f960fc0.tar.gz
lighttpd1.4-1566748b1afd4f2216b3a0b8bc47b7cb1f960fc0.zip
[tests] test apr-md5 in mod-auth.t
From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3057 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/mod-auth.t')
-rwxr-xr-xtests/mod-auth.t25
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/mod-auth.t b/tests/mod-auth.t
index 576ee4eb..cc03aa8a 100755
--- a/tests/mod-auth.t
+++ b/tests/mod-auth.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 17;
+use Test::More tests => 19;
use LightyTest;
my $tf = LightyTest->new();
@@ -83,10 +83,27 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (sha, wrong password)');
+$t->{REQUEST} = ( <<EOF
+GET /server-config HTTP/1.0
+Host: auth-htpasswd.example.org
+Authorization: Basic YXByLW1kNTphcHItbWQ1
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
+ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (apr-md5)');
+
+$t->{REQUEST} = ( <<EOF
+GET /server-config HTTP/1.0
+Host: auth-htpasswd.example.org
+Authorization: Basic YXByLW1kNTphcHItbWQ2
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ];
+ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (apr-md5, wrong password)');
SKIP: {
- skip "no md5 for crypt under cygwin", 1 if $^O eq 'cygwin';
- skip "no md5 for crypt under darwin", 1 if $^O eq 'darwin';
+ skip "no crypt-md5 under cygwin", 1 if $^O eq 'cygwin';
+ skip "no crypt-md5 under darwin", 1 if $^O eq 'darwin';
$t->{REQUEST} = ( <<EOF
GET /server-config HTTP/1.0
Host: auth-htpasswd.example.org
@@ -94,7 +111,7 @@ Authorization: Basic bWQ1Om1kNQ==
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (md5)');
+ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (crypt-md5)');
}
$t->{REQUEST} = ( <<EOF