forked from UPC/ravada
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02_config.t
62 lines (46 loc) · 1.08 KB
/
02_config.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
use warnings;
use strict;
use Test::More;
use lib 't/lib';
use Test::Ravada;
init();
#########################################################################
sub check_empty {
is(Ravada::_check_config( {} ), 1);
is(Ravada::_check_config( undef ), 1);
}
sub check_fail{
is(Ravada::_check_config( {fail => 'yes'} ) , 0);
}
sub check_db {
is(Ravada::_check_config( {
db => {
user => 1
, password => 2
, hostname => 3
}
}) , 1);
is(Ravada::_check_config( {
db => {
user => 1
, password => 2
, foo => 3
}
}) , 0);
is(Ravada::_check_config( {
ldap => {
secure => 0
}
}),1);
}
sub check_no_ldap {
is(rvd_front->feature('ldap'),0);
}
#########################################################################
clean();
check_empty();
check_fail();
check_db();
check_no_ldap();
end();
done_testing();