From b4b00bffaf6d850f184c2c962c2e01e09e9a3cc1 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Wed, 27 Apr 2022 01:27:45 -0700 Subject: [PATCH] Set proper paths to SNMP utils. --- test/test_snmp.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/test_snmp.sh b/test/test_snmp.sh index 37385863..2525fb55 100755 --- a/test/test_snmp.sh +++ b/test/test_snmp.sh @@ -11,9 +11,9 @@ if [ $valgrindtest -ne 0 ]; then return 0 # skip fi -snmpd="/usr/sbin/snmpd" -snmpget="/usr/bin/snmpget -c public -v2c localhost:1161 " -snmpset="/usr/bin/snmpset -c public -v2c localhost:1161 " +snmpd=$(type -p snmpd) +snmpget="$(type -p snmpget) -c public -v2c localhost:1161 " +snmpset="$(type -p snmpset) -c public -v2c localhost:1161 " clixon_snmp="/usr/local/sbin/clixon_snmp" cfg=$dir/conf_startup.xml fyang=$dir/clixon-example.yang @@ -77,6 +77,10 @@ function testinit(){ fi } +function testexit(){ + sudo killall snmpd +} + new "SNMP tests" testinit @@ -89,5 +93,8 @@ expectpart "$($snmpset .1.3.6.1.4.1.8072.2.4.1.1.2.0 i 1234)" 0 "NET-SNMP-EXAMPL new "Get new value" expectpart "$($snmpget .1.3.6.1.4.1.8072.2.4.1.1.2.0)" 0 "NET-SNMP-EXAMPLES-MIB::netSnmpExamples.4.1.1.2.0 = INTEGER: 1234" +new "Cleaning up" +testexit + new "endtest" endtest