mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-20 21:57:10 -04:00
Fix opttest script
This commit is contained in:
parent
cb5abf1981
commit
b982e12ecf
1 changed files with 25 additions and 6 deletions
|
|
@ -28,22 +28,41 @@ for my $prog (keys %progs) {
|
|||
|
||||
$idx = 1;
|
||||
$output = `$prog -h 2>&1`;
|
||||
if($?) {$state++;print "$prog failed test $idx\n";}
|
||||
if(($? >> 8) != 3) {
|
||||
$state++;
|
||||
print "$prog failed test $idx (help exit code (short form))\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
unless ($output =~ m/$progs{$prog}/ms) {
|
||||
$idx++; $state++;print "$output\n$prog failed test $idx\n";
|
||||
$idx++;
|
||||
$state++;
|
||||
print "$output\n$prog failed test $idx\n";
|
||||
}
|
||||
|
||||
$idx++;
|
||||
`$prog --help 2>&1 > /dev/null`;
|
||||
if($?) {$state++;print "$prog failed test $idx\n";}
|
||||
if(($? >> 8) != 3) {
|
||||
$state++;
|
||||
print "$prog failed test $idx (help exit code (long form))\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$idx++;
|
||||
`$prog -V 2>&1 > /dev/null`;
|
||||
if($?) {$state++;print "$prog failed test $idx\n";}
|
||||
`$prog -V 2>&1 > /dev/null`;
|
||||
if(($? >> 8) != 3) {
|
||||
$state++;
|
||||
print "$prog failed test $idx (version exit code (short form))\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$idx++;
|
||||
`$prog --version 2>&1 > /dev/null`;
|
||||
if($?) {$state++;print "$prog failed test $idx\n";}
|
||||
if(($? >> 8) != 3) {
|
||||
$state++;
|
||||
print "$prog failed test $idx (version exit code (long form))\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
print "$prog ($idx tests) ";
|
||||
ok $state,0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue