Mercurial > hg > nginx-tests
changeset 666:64f22e0aaab2
Tests: auth basic tests for merged "off" value and user not found.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 27 Aug 2015 15:19:27 +0300 |
parents | 3a8dc14b98ba |
children | 0247e314e991 |
files | auth_basic.t |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/auth_basic.t Thu Aug 27 13:33:41 2015 +0300 +++ b/auth_basic.t Thu Aug 27 15:19:27 2015 +0300 @@ -23,7 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http auth_basic/)->plan(19) +my $t = Test::Nginx->new()->has(qw/http auth_basic/)->plan(21) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -43,6 +43,11 @@ location / { auth_basic "closed site"; auth_basic_user_file %%TESTDIR%%/htpasswd; + + location /inner { + auth_basic off; + alias %%TESTDIR%%/; + } } } } @@ -115,6 +120,9 @@ like(http_get_auth('/', 'sha2', '1'), qr!401 Unauthorized!, 'sha broken 1'); like(http_get_auth('/', 'sha3', '1'), qr!401 Unauthorized!, 'sha broken 2'); +like(http_get_auth('/', 'notfound', '1'), qr!401 Unauthorized!, 'not found'); +like(http_get('/inner/'), qr!SEETHIS!, 'inner off'); + ############################################################################### sub http_get_auth {