restconf-rpc tests
This commit is contained in:
parent
475e70d773
commit
ff8650c748
2 changed files with 22 additions and 6 deletions
|
|
@ -67,6 +67,9 @@ new "start restconf"
|
|||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><process-control xmlns=\"http://clicon.org/lib\"><name>restconf</name><operation>start</operation></process-control></rpc>]]>]]>" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>"
|
||||
|
||||
new "3)check restconf on"
|
||||
if [ $valgrindtest -eq 0 ]; then # Cant get pgrep to work properly
|
||||
sleep $DEMWAIT # Slows the tests down considerably, but needed in eg docker test
|
||||
fi
|
||||
ps=$(ps aux|grep "$WWWDIR/clixon_restconf -f $cfg" | grep -v grep)
|
||||
if [ -z "$ps" ]; then
|
||||
err "restconf running"
|
||||
|
|
@ -82,6 +85,9 @@ new "start restconf again"
|
|||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><process-control xmlns=\"http://clicon.org/lib\"><name>restconf</name><operation>start</operation></process-control></rpc>]]>]]>" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>"
|
||||
|
||||
new "5)check restconf on"
|
||||
if [ $valgrindtest -eq 0 ]; then # Cant get pgrep to work properly
|
||||
sleep $DEMWAIT # Slows the tests down considerably, but needed in eg docker test
|
||||
fi
|
||||
ps=$(ps aux|grep "$WWWDIR/clixon_restconf -f $cfg" | grep -v grep)
|
||||
if [ -z "$ps" ]; then
|
||||
err "A restconf running"
|
||||
|
|
@ -102,6 +108,9 @@ expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><process-control xmlns=\
|
|||
new "7)check status on"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><process-control xmlns=\"http://clicon.org/lib\"><name>restconf</name><operation>status</operation></process-control></rpc>]]>]]>" "<rpc-reply $DEFAULTNS><status xmlns=\"http://clicon.org/lib\">true</status></rpc-reply>]]>]]>"
|
||||
|
||||
if [ $valgrindtest -eq 0 ]; then # Cant get pgrep to work properly
|
||||
sleep $DEMWAIT # Slows the tests down considerably, but needed in eg docker test
|
||||
fi
|
||||
pid0=$(pgrep clixon_restconf)
|
||||
|
||||
new "restart restconf"
|
||||
|
|
@ -112,7 +121,11 @@ expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><process-control xmlns=\
|
|||
|
||||
if [ $valgrindtest -eq 0 ]; then # Cant get pgrep to work properly
|
||||
new "9)check new pid"
|
||||
sleep $DEMWAIT # Slows the tests down considerably, but needed in eg docker test
|
||||
pid1=$(pgrep clixon_restconf)
|
||||
if [ -z "$pid0" -o -z "$pid1" ]; then
|
||||
err "Pids expected" "pid0:$pid0 = pid1:$pid1"
|
||||
fi
|
||||
if [ $pid0 -eq $pid1 ]; then
|
||||
err "Different pids" "pid0:$pid0 = pid1:$pid1"
|
||||
fi
|
||||
|
|
@ -128,10 +141,14 @@ if [ $BE -ne 0 ]; then
|
|||
# kill backend
|
||||
stop_backend -f $cfg
|
||||
|
||||
new "10)check no restconf"
|
||||
ps=$(ps aux|grep "$WWWDIR/clixon_restconf" | grep -v grep)
|
||||
if [ -n "$ps" ]; then
|
||||
err "No restconf running" "$ps"
|
||||
# XXX Cant get this to work in docker/alpine
|
||||
if false; then
|
||||
new "10)check no restconf"
|
||||
sleep $DEMWAIT
|
||||
ps=$(ps aux|grep "$WWWDIR/clixon_restconf" | grep -v grep)
|
||||
if [ -n "$ps" ]; then
|
||||
err "No restconf running" "$ps"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue