|
|
|
@ -7,12 +7,12 @@ use utf8;
|
|
|
|
|
use LDV::LDAP; |
|
|
|
|
use File::Slurp; |
|
|
|
|
use Data::Dumper; |
|
|
|
|
use Test::More tests => 13; |
|
|
|
|
use Test::More tests => 16; |
|
|
|
|
|
|
|
|
|
my $hash = read_file('conf/ldv.conf'); |
|
|
|
|
my $config = eval "$hash"; |
|
|
|
|
SKIP: { |
|
|
|
|
skip "Can't load config", 13 unless (ref($config) eq 'HASH'); |
|
|
|
|
skip "Can't load config", 16 unless (ref($config) eq 'HASH'); |
|
|
|
|
|
|
|
|
|
my $ldap = LDV::LDAP->new($config->{ldap}); |
|
|
|
|
isa_ok($ldap, "LDV::LDAP", "LDV::LDAP->new"); |
|
|
|
@ -36,6 +36,10 @@ SKIP: {
|
|
|
|
|
is($ldap->auth("test20", "test1"), undef, "check auth falure (wrong pass)"); |
|
|
|
|
is($ldap->auth("test20", undef), undef, "check auth falure (empty pass)"); |
|
|
|
|
|
|
|
|
|
is($ldap->chpass("test20", "test2"), undef, "change password"); |
|
|
|
|
is($ldap->auth("test20", "test2"), 1, "check auth success (new pass)"); |
|
|
|
|
is($ldap->auth("test20", "test"), undef, "check auth falure (old pass)"); |
|
|
|
|
|
|
|
|
|
is($ldap->delete("test20"), undef, "deleting user"); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|