Mercurial > hg > nginx-tests
comparison mail_imap.t @ 151:1c39b7edc593
Tests: make sure imap authenticate without arguments fails.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Apr 2011 04:40:38 +0400 |
parents | b714d6df958c |
children | c0ae29632905 |
comparison
equal
deleted
inserted
replaced
150:6b73d6c8f26c | 151:1c39b7edc593 |
---|---|
27 select STDOUT; $| = 1; | 27 select STDOUT; $| = 1; |
28 | 28 |
29 local $SIG{PIPE} = 'IGNORE'; | 29 local $SIG{PIPE} = 'IGNORE'; |
30 | 30 |
31 my $t = Test::Nginx->new() | 31 my $t = Test::Nginx->new() |
32 ->has(qw/mail imap http rewrite/)->plan(8) | 32 ->has(qw/mail imap http rewrite/)->plan(9) |
33 ->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon) | 33 ->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon) |
34 ->write_file_expand('nginx.conf', <<'EOF')->run(); | 34 ->write_file_expand('nginx.conf', <<'EOF')->run(); |
35 | 35 |
36 %%TEST_GLOBALS%% | 36 %%TEST_GLOBALS%% |
37 | 37 |
84 ############################################################################### | 84 ############################################################################### |
85 | 85 |
86 my $s = Test::Nginx::IMAP->new(); | 86 my $s = Test::Nginx::IMAP->new(); |
87 $s->ok('greeting'); | 87 $s->ok('greeting'); |
88 | 88 |
89 # bad auth | |
90 | |
91 $s->send('1 AUTHENTICATE'); | |
92 $s->check(qr/^\S+ BAD/, 'auth without arguments'); | |
93 | |
89 # auth plain | 94 # auth plain |
90 | 95 |
91 $s->send('1 AUTHENTICATE PLAIN ' . encode_base64("\0test\@example.com\0bad", '')); | 96 $s->send('1 AUTHENTICATE PLAIN ' . encode_base64("\0test\@example.com\0bad", '')); |
92 $s->check(qr/^\S+ NO/, 'auth plain with bad password'); | 97 $s->check(qr/^\S+ NO/, 'auth plain with bad password'); |
93 | 98 |