ed8eca0a63
Apparently the format of vpopmaild responses has been expanded and the responses are conditional. * Replaced the 'sometimes works' eq comparison with a regexp that always works. * added tests for all 3 vpopmail plugins * added cram-md5 auth support to auth_vpopmaild.
28 lines
723 B
Perl
28 lines
723 B
Perl
# -*-perl-*- [emacs]
|
|
|
|
warn "loaded test auth_vpopmaild\n";
|
|
|
|
sub register_tests {
|
|
my $self = shift;
|
|
$self->register_test("test_auth_vpopmaild", 3);
|
|
}
|
|
|
|
my @u_list = qw ( good bad none );
|
|
my %u_data = (
|
|
good => [ 'postmaster@example.com', OK, 'Good Strong Passphrase' ],
|
|
bad => [ 'bad@example.com', DENY, 'not_bad_pass' ],
|
|
none => [ 'none@example.com', DECLINED, '' ],
|
|
);
|
|
|
|
sub test_auth_vpopmaild {
|
|
my $self = shift;
|
|
my ($tran, $ret, $note, $u, $r, $p, $a );
|
|
$tran = $self->qp->transaction;
|
|
for $u ( @u_list ) {
|
|
( $a,$r,$p ) = @{$u_data{$u}};
|
|
($ret, $note) = $self->auth_vpopmaild($tran,'LOGIN',$a,$p);
|
|
defined $note or $note='No-Message';
|
|
is ($ret, $r, $note);
|
|
}
|
|
}
|