[monitoring-plugins] tests: skip extented snmp tests if snmpd has no ...
Sven Nierlein
git at monitoring-plugins.org
Thu Jul 31 22:00:07 CEST 2014
Module: monitoring-plugins
Branch: master
Commit: a5b6d94fc6daa1868745441f6fed8f7576f2e5dd
Author: Sven Nierlein <Sven.Nierlein at consol.de>
Date: Thu Jul 31 17:06:32 2014 +0200
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=a5b6d94
tests: skip extented snmp tests if snmpd has no perl support
solaris snmpd has no perl support by default, so this test will fail.
Signed-off-by: Sven Nierlein <Sven.Nierlein at consol.de>
---
plugins/tests/check_snmp.t | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/plugins/tests/check_snmp.t b/plugins/tests/check_snmp.t
index aace9bc..2fd033d 100755
--- a/plugins/tests/check_snmp.t
+++ b/plugins/tests/check_snmp.t
@@ -20,7 +20,16 @@ if ($@) {
plan skip_all => "Missing required module for test: $@";
} else {
if (-x "./check_snmp") {
- plan tests => $tests;
+ # check if snmpd has perl support
+ my $test = `snmpd -c tests/conf/snmpd.conf -C -r -H 2>&1`;
+ if(!defined $test) {
+ plan skip_all => "snmpd required";
+ }
+ elsif($test =~ m/Warning: Unknown token: perl/) {
+ plan skip_all => "snmpd has no perl support";
+ } else {
+ plan tests => $tests;
+ }
} else {
plan skip_all => "No check_snmp compiled";
}
More information about the Commits
mailing list