Test: killed backend in snmp tests

This commit is contained in:
Olof hagsand 2022-10-08 17:19:24 +02:00
parent 575429caa1
commit dd1e5966fb
6 changed files with 51 additions and 3 deletions

View file

@ -658,7 +658,6 @@ xml_yang_minmax_recurse(cxobj *xt,
yt = xml_spec(xt); /* If yt == NULL, then no gap-analysis is done */ yt = xml_spec(xt); /* If yt == NULL, then no gap-analysis is done */
while ((x = xml_child_each(xt, x, CX_ELMNT)) != NULL){ while ((x = xml_child_each(xt, x, CX_ELMNT)) != NULL){
clicon_debug(1, "%s x:%s", __FUNCTION__, xml_name(x));
if ((y = xml_spec(x)) == NULL) if ((y = xml_spec(x)) == NULL)
continue; continue;
keyw = yang_keyword_get(y); keyw = yang_keyword_get(y);

View file

@ -136,6 +136,17 @@ function testinit(){
function testexit(){ function testexit(){
stop_snmp stop_snmp
if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
pid=$(pgrep -u root -f clixon_backend)
if [ -z "$pid" ]; then
err "backend already dead"
fi
# kill backend
stop_backend -f $cfg
fi
} }
ENTITY_OID=".1.3.6.1.2.1.47.1.1.1" ENTITY_OID=".1.3.6.1.2.1.47.1.1.1"

View file

@ -132,6 +132,16 @@ function testinit(){
function testexit(){ function testexit(){
stop_snmp stop_snmp
if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
pid=$(pgrep -u root -f clixon_backend)
if [ -z "$pid" ]; then
err "backend already dead"
fi
# kill backend
stop_backend -f $cfg
fi
} }
new "SNMP tests" new "SNMP tests"

View file

@ -195,13 +195,21 @@ function testinit(){
function testexit(){ function testexit(){
stop_snmp stop_snmp
if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
pid=$(pgrep -u root -f clixon_backend)
if [ -z "$pid" ]; then
err "backend already dead"
fi
# kill backend
stop_backend -f $cfg
fi
} }
new "SNMP tests" new "SNMP tests"
testinit testinit
# IF-MIB::interfaces # IF-MIB::interfaces
MIB=".1.3.6.1.2.1" MIB=".1.3.6.1.2.1"
for (( i=1; i<23; i++ )); do for (( i=1; i<23; i++ )); do

View file

@ -206,6 +206,16 @@ function testrun_removeRows()
function testexit() function testexit()
{ {
stop_snmp stop_snmp
if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
pid=$(pgrep -u root -f clixon_backend)
if [ -z "$pid" ]; then
err "backend already dead"
fi
# kill backend
stop_backend -f $cfg
fi
} }
new "SNMP tests" new "SNMP tests"

View file

@ -121,6 +121,16 @@ function testinit(){
function testexit(){ function testexit(){
stop_snmp stop_snmp
if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
pid=$(pgrep -u root -f clixon_backend)
if [ -z "$pid" ]; then
err "backend already dead"
fi
# kill backend
stop_backend -f $cfg
fi
} }
new "SNMP tests" new "SNMP tests"