2012-05-05 05:33:50 +02:00
|
|
|
#!perl -w
|
2012-04-07 23:52:44 +02:00
|
|
|
|
|
|
|
sub register_tests {
|
|
|
|
my $self = shift;
|
|
|
|
$self->register_test("auth_vpopmail_sql", 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 auth_vpopmail_sql {
|
|
|
|
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}};
|
|
|
|
eval { ($ret, $note) = $self->auth_vmysql($tran,'PLAIN',$a,$p); };
|
|
|
|
defined $note or $note='auth_vpopmail_sql: No-Message';
|
|
|
|
is ($ret, $r, $note);
|
|
|
|
# - for debugging.
|
|
|
|
# warn "$note\n";
|
|
|
|
}
|
|
|
|
}
|