File: 05object_config.t

package info (click to toggle)
libnagios-object-perl 0.21.20-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,032 kB
  • sloc: perl: 3,198; makefile: 9
file content (32 lines) | stat: -r--r--r-- 875 bytes parent folder | download | duplicates (6)
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
#!/usr/bin/perl -w

use strict;
use Test::More qw(no_plan);
use Test::NoWarnings;
use Data::Dumper;
use lib qw( ../lib ./lib );

eval { chdir('t') };

use_ok('Nagios::Object::Config');

ok( my $parser = Nagios::Object::Config->new(),
    "\$parser = Nagios::Object::Config->new()"
);

ok( $parser->parse('testconfig.cfg'), "\$parser->parse( 'testconfig.cfg' )" );

ok( $parser->resolve_objects,  "\$parser->resolve_objects" );
ok( $parser->register_objects, "\$parser->register_objects" );

ok( $parser->resolve_objects,
    "\$parser->resolve_objects should be ok to call multiple times" );
ok( $parser->register_objects,
    "\$parser->register_objects should be ok to call multiple times" );

ok( my @hosts    = $parser->list_hosts(),    "\$parser->list_hosts()" );
ok( my @contacts = $parser->list_contacts(), "\$parser->list_contacts()" );

#warn Dumper(\@contacts);
#