Valgrind tests for clixon_snmp.

This commit is contained in:
Kristofer Hallin 2022-04-27 21:03:47 +02:00 committed by Olof hagsand
parent 28514c6750
commit 366b1cb42f
3 changed files with 40 additions and 17 deletions

View file

@ -18,6 +18,7 @@ function memonce(){
clixon_netconf=
clixon_backend=
clixon_restconf=
clixon_snmp=
case "$what" in
'cli')
valgrindtest=1
@ -43,8 +44,15 @@ function memonce(){
clixon_restconf="/usr/bin/valgrind --num-callers=50 --leak-check=full --show-leak-kinds=all --suppressions=./valgrind-clixon.supp --track-fds=yes --trace-children=no --child-silent-after-fork=yes --log-file=$valgrindfile clixon_restconf"
;;
'snmp')
valgrindtest=1 # This means snmp valgrind test
sudo chmod 660 $valgrindfile
: ${DEMWAIT:=15} # valgrind backend needs some time to get up
clixon_snmp="/usr/bin/valgrind --num-callers=50 --leak-check=full --show-leak-kinds=all --suppressions=./valgrind-clixon.supp --track-fds=yes --trace-children=no --child-silent-after-fork=yes --log-file=$valgrindfile /usr/local/sbin/clixon_snmp"
;;
*)
echo "usage: $0 cli|netconf|restconf|backend" # valgrind memleak checks
echo "usage: $0 cli|netconf|restconf|backend|snmp" # valgrind memleak checks
rm -f $valgrindfile
exit -1
;;
@ -86,16 +94,16 @@ function println(){
}
if [ -z "$*" ]; then
cmds="backend restconf cli netconf"
cmds="backend restconf cli netconf snmp"
else
cmds=$*
fi
# First run sanity
for c in $cmds; do
if [ $c != cli -a $c != netconf -a $c != restconf -a $c != backend ]; then
if [ $c != cli -a $c != netconf -a $c != restconf -a $c != backend -a $c != snmp ]; then
echo "c:$c"
echo "usage: $0 [cli|netconf|restconf|backend]+"
echo "usage: $0 [cli|netconf|restconf|backend|snmp]+"
echo " with no args run all"
exit -1
fi