2007-05-18 00:00:55 +02:00
|
|
|
# -*-perl-*- [emacs]
|
|
|
|
|
|
|
|
sub register_tests {
|
|
|
|
my $self = shift;
|
2010-05-11 07:16:54 +02:00
|
|
|
$self->register_test("test_auth_flat_file", 3);
|
2007-05-18 00:00:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
my @u_list = qw ( good bad none );
|
|
|
|
my %u_data = (
|
|
|
|
good => [ 'good@example.com', OK, 'good_pass' ],
|
|
|
|
bad => [ 'bad@example.com', DENY, 'not_bad_pass' ],
|
|
|
|
none => [ 'none@example.com', DECLINED, '' ],
|
|
|
|
);
|
|
|
|
|
2010-05-11 07:16:54 +02:00
|
|
|
sub test_auth_flat_file {
|
2007-05-18 00:00:55 +02:00
|
|
|
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}};
|
2010-05-11 07:16:54 +02:00
|
|
|
($ret, $note) = $self->auth_flat_file($tran,'CRAMMD5',$a,$p);
|
2007-05-18 00:00:55 +02:00
|
|
|
defined $note or $note='No-Message';
|
|
|
|
is ($ret, $r, $note);
|
|
|
|
# - for debugging.
|
|
|
|
# warn "$note\n";
|
|
|
|
}
|
|
|
|
}
|