-
Notifications
You must be signed in to change notification settings - Fork 125
/
config.t
46 lines (37 loc) · 1.02 KB
/
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
#!/usr/bin/perl
use strict;
use warnings;
use lib 't';
use File::Temp;
use Test::More;
use FusionInventory::Agent::Config;
my %config = (
'sample1' => {
'no-task' => ['snmpquery', 'wakeonlan', 'inventory'],
'no-category' => ['software']
},
'sample2' => {
'no-task' => [],
'no-category' => ['printer', 'software']
},
'sample3' => {
'no-task' => [],
'no-category' => []
}
);
plan tests => (scalar keys %config) * 2;
foreach my $test (keys %config) {
my $c = FusionInventory::Agent::Config->new(options => {
'conf-file' => "t/config/$test/agent.cfg"
});
is_deeply($c->{'no-task'}, $config{$test}->{'no-task'}, "no-task");
is_deeply($c->{'no-category'}, $config{$test}->{'no-category'}, "no-category");
}
#$config = FusionInventory::Agent::Config->new(options => {
# 'conf-file' => 't/config/sample2/agent.cfg'
#
#});
#
#is_deeply($config->{'no-task'}, , "no-task");
#is_deeply($config->{'no-category'}, , "no-category is not empty");
#