3 |
use Libconf qw(:functions); |
use Libconf qw(:functions); |
4 |
use Data::Dumper; |
use Data::Dumper; |
5 |
|
|
|
my $struct; |
|
|
|
|
6 |
# test 1, minimal requirement : regenerate correctly |
# test 1, minimal requirement : regenerate correctly |
7 |
my $struct = new Libconf("hostgroups.cfg", 'nagios', ''); |
my $struct = new Libconf("hostgroups.cfg", 'nagios', ''); |
8 |
#print " ----- " . Dumper($struct) . "\n"; |
#print " ----- " . Dumper($struct) . "\n"; |
21 |
display(3); |
display(3); |
22 |
$struct = new Libconf("hostgroups.cfg", 'nagios', ''); |
$struct = new Libconf("hostgroups.cfg", 'nagios', ''); |
23 |
$struct->appendAtom({section_name => 'section', type => 'SECTION', 'sections' => [] }); |
$struct->appendAtom({section_name => 'section', type => 'SECTION', 'sections' => [] }); |
24 |
$struct->appendAtom({key => 'alias2', list => ['some', 'stuff'], type => 'KEY_LIST'}); |
$struct->appendAtom({key => 'alias2', list => [ 'some', 'stuff' ], type => 'KEY_LIST' }); |
25 |
$struct->appendAtom({type => 'ENDSECTION', 'sections' => [] }); |
$struct->appendAtom({type => 'ENDSECTION', 'sections' => [] }); |
26 |
$struct->writeConf("nagios_output_3"); |
$struct->writeConf("nagios_output_3"); |
27 |
test(3); |
test(3); |