Check if we have Net-SNMP support enabled before trying to run SNMP tests.

This commit is contained in:
Kristofer Hallin 2022-04-27 02:04:13 -07:00 committed by Olof hagsand
parent 432131c9d2
commit c584d171ee
2 changed files with 8 additions and 0 deletions

View file

@ -52,6 +52,9 @@ HAVE_HTTP1=@HAVE_HTTP1@
# use it you need to set Clixon config option CLICON_YANG_REGEXP to libxml2
WITH_LIBXML2=@with_libxml2@
# Check if we have support for Net-SNMP enabled or not.
WITH_NETSNMP=@enable_netsnmp@
# C++ compiler
CXX=@CXX@

View file

@ -11,6 +11,11 @@ if [ $valgrindtest -ne 0 ]; then
return 0 # skip
fi
if [ ${WITH_NETSNMP} != "yes" ]; then
echo "Skipping test, Net-SNMP support not enabled."
if [ "$s" = $0 ]; then exit 0; else return 0; fi
fi
snmpd=$(type -p snmpd)
snmpget="$(type -p snmpget) -c public -v2c localhost:1161 "
snmpset="$(type -p snmpset) -c public -v2c localhost:1161 "