Imported Upstream version 1.4.13+git200906171200
This commit is contained in:
parent
4ab9f0d24c
commit
d0b8ab8112
362 changed files with 34110 additions and 10773 deletions
34
lib/tests/test_ini3.t
Executable file
34
lib/tests/test_ini3.t
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/perl
|
||||
use Test::More;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
if (! -e "./test_ini3") {
|
||||
plan skip_all => "./test_ini not compiled - please install tap library and/or enable parse-ini to test";
|
||||
}
|
||||
|
||||
# array of argument arrays
|
||||
# - First value is the expected return code
|
||||
# - 2nd value is the NAGIOS_CONFIG_PATH
|
||||
# TODO: looks like we look in default path after looking trough this variable - shall we?
|
||||
# - 3rd value is the plugin name
|
||||
# - 4th is the ini locator
|
||||
my @TESTS = (
|
||||
[3, undef, "section", "section_unknown@./config-tiny.ini"],
|
||||
);
|
||||
|
||||
plan tests => scalar(@TESTS);
|
||||
|
||||
my $count=1;
|
||||
|
||||
foreach my $args (@TESTS) {
|
||||
my $rc = shift(@$args);
|
||||
if (my $env = shift(@$args)) {
|
||||
$ENV{"NAGIOS_CONFIG_PATH"} = $env;
|
||||
} else {
|
||||
delete($ENV{"NAGIOS_CONFIG_PATH"});
|
||||
}
|
||||
system {'./test_ini3'} @$args;
|
||||
cmp_ok($?>>8, '==', $rc, "Parse-ini die " . $count++);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue