| 1 |
#!perl -w |
| 2 |
|
| 3 |
sub register_tests { |
| 4 |
my $self = shift; |
| 5 |
$self->register_test("test_auth_flat_file", 3); |
| 6 |
} |
| 7 |
|
| 8 |
my @u_list = qw ( good bad none ); |
| 9 |
my %u_data = ( |
| 10 |
good => [ '[email protected]', OK, 'good_pass' ], |
| 11 |
bad => [ '[email protected]', DENY, 'not_bad_pass' ], |
| 12 |
none => [ '[email protected]', DECLINED, '' ], |
| 13 |
); |
| 14 |
|
| 15 |
sub test_auth_flat_file { |
| 16 |
my $self = shift; |
| 17 |
my ($tran, $ret, $note, $u, $r, $p, $a ); |
| 18 |
$tran = $self->qp->transaction; |
| 19 |
for $u ( @u_list ) { |
| 20 |
( $a,$r,$p ) = @{$u_data{$u}}; |
| 21 |
($ret, $note) = $self->auth_flat_file($tran,'CRAMMD5',$a,$p); |
| 22 |
defined $note or $note='authflat: No-Message'; |
| 23 |
is ($ret, $r, $note); |
| 24 |
# - for debugging. |
| 25 |
# warn "$note\n"; |
| 26 |
} |
| 27 |
} |