* [Need an option to disable restconf mandatory action of overwriting startup_db #230](https://github.com/clicon/clixon/issues/230)
* Disable RFC 8040 mandatory copy of running to startup after commit * Rename CLICON_RESTCONF_INSTALL_DIR -> CLICON_RESTCONF_INSTALLDIR
This commit is contained in:
parent
60c9172d21
commit
5b39418e92
8 changed files with 53 additions and 25 deletions
|
|
@ -54,7 +54,7 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_INSTALL_DIR>$RESTCONFDIR</CLICON_RESTCONF_INSTALL_DIR>
|
||||
<CLICON_RESTCONF_INSTALLDIR>$RESTCONFDIR</CLICON_RESTCONF_INSTALLDIR>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_DIR>/usr/local/lib/$APPNAME/backend</CLICON_BACKEND_DIR>
|
||||
<CLICON_BACKEND_REGEXP>example_backend.so$</CLICON_BACKEND_REGEXP>
|
||||
<CLICON_RESTCONF_DIR>/usr/local/lib/$APPNAME/restconf</CLICON_RESTCONF_DIR>
|
||||
<CLICON_RESTCONF_INSTALL_DIR>$RESTCONFDIR</CLICON_RESTCONF_INSTALL_DIR>
|
||||
<CLICON_RESTCONF_INSTALLDIR>$RESTCONFDIR</CLICON_RESTCONF_INSTALLDIR>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>
|
||||
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
|
||||
|
|
@ -194,15 +194,15 @@ ps aux|grep clixon_ # XXX
|
|||
|
||||
new "Check $pid1 exists"
|
||||
# Here backend dies / is killed
|
||||
#while sudo kill -0 $pid1 2> /dev/null; do
|
||||
if sudo kill -0 $pid1; then # XXX
|
||||
# if sudo kill -0 $pid1; then # XXX
|
||||
while sudo kill -0 $pid1 2> /dev/null; do
|
||||
new "kill $pid1 externally"
|
||||
sudo kill $pid1
|
||||
sleep 1 # There is a race condition here when restconf is killed while waiting for reply from backend
|
||||
echo "pid1:$pid1" # XXX
|
||||
ps aux|grep clixon_ # XXX
|
||||
fi
|
||||
#done
|
||||
done
|
||||
# fi
|
||||
|
||||
echo "pid1:$pid1" # XXX
|
||||
ps aux|grep clixon_ # XXX
|
||||
|
|
|
|||
|
|
@ -66,16 +66,18 @@ function testrun(){
|
|||
start_backend -s init -f $cfg -y $fyang $option
|
||||
fi
|
||||
|
||||
new "waiting"
|
||||
new "wait backend"
|
||||
wait_backend
|
||||
|
||||
new "kill old restconf daemon"
|
||||
stop_restconf_pre
|
||||
if [ $RC -ne 0 ]; then
|
||||
new "kill old restconf daemon"
|
||||
stop_restconf_pre
|
||||
|
||||
new "start restconf daemon"
|
||||
start_restconf -f $cfg -y $fyang $option
|
||||
new "start restconf daemon"
|
||||
start_restconf -f $cfg -y $fyang $option
|
||||
fi
|
||||
|
||||
new "waiting"
|
||||
new "wait restconf"
|
||||
wait_restconf
|
||||
|
||||
new "restconf put 42"
|
||||
|
|
@ -90,9 +92,11 @@ function testrun(){
|
|||
new "restconf delete 42"
|
||||
expectpart "$(curl $CURLOPTS -X DELETE $RCPROTO://localhost/restconf/data/example:x/y=42)" 0 "HTTP/1.1 204 No Content"
|
||||
|
||||
new "Kill restconf daemon"
|
||||
stop_restconf
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
new "Kill restconf daemon"
|
||||
stop_restconf
|
||||
fi
|
||||
|
||||
if [ $BE -ne 0 ]; then
|
||||
new "Kill backend"
|
||||
# Check if premature kill
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue