Vagrant and test updates for restconf /www-data mods
This commit is contained in:
parent
637c68aed6
commit
603f70e51f
5 changed files with 28 additions and 12 deletions
|
|
@ -39,7 +39,7 @@ Expected: June 2021
|
|||
* Do not extend default values if when statements evaluate to false
|
||||
* Do not allow edit-config of nodes if when statements evaluate to false (Sec 8.3.2)
|
||||
* If a key leaf is defined in a grouping that is used in a list, the "uses" statement MUST NOT have a "when" statement. (See 7.21.5)
|
||||
* See [yang uses's substatement when has no effect #218](https://github.com/clicon/clixon/issues/2$
|
||||
* See [yang uses's substatement when has no effect #218](https://github.com/clicon/clixon/issues/218)
|
||||
* YANG deviation [deviation statement not yet support #211](https://github.com/clicon/clixon/issues/211)
|
||||
* See RFC7950 Sec 5.6.3
|
||||
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@ Send netconf command:
|
|||
```
|
||||
Start clixon restconf daemon
|
||||
```
|
||||
sudo su -c "/www-data/clixon_restconf -f /usr/local/etc/example.xml " -s /bin/sh www-data
|
||||
sudo /usr/local/bin/clixon_restconf -f /usr/local/etc/example.xml
|
||||
```
|
||||
Send restconf command
|
||||
```
|
||||
curl -G http://127.0.0.1/restconf/data
|
||||
curl -X GET http://127.0.0.1/restconf/data
|
||||
```
|
||||
|
||||
## Using the CLI
|
||||
|
|
@ -148,7 +148,7 @@ Start nginx daemon
|
|||
```
|
||||
Start the clixon restconf daemon
|
||||
```
|
||||
sudo su -c "/www-data/clixon_restconf -f /usr/local/etc/example.xml " -s /bin/sh www-data
|
||||
sudo /usr/local/sbin/clixon_restconf -f /usr/local/etc/example.xml
|
||||
```
|
||||
then access using curl or wget:
|
||||
```
|
||||
|
|
@ -206,7 +206,7 @@ clixon_netconf -qf /usr/local/etc/example.xml
|
|||
```
|
||||
Restconf (assuming nginx started):
|
||||
```
|
||||
sudo su -c "/www-data/clixon_restconf -f /usr/local/etc/example.xml " -s /bin/sh www-data&
|
||||
sudo /usr/local/sbin/clixon_restconf -f /usr/local/etc/example.xml
|
||||
curl -X POST http://localhost/restconf/operations/clixon-example:example -H "Content-Type: application/yang-data+json" -d '{"clixon-example:input":{"x":"ipv4"}}'
|
||||
{
|
||||
"clixon-example:output": {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
# 1. Start two servers, where one fails
|
||||
# 2. Reach one not the other
|
||||
# (Wanted to bind an invalid port, but then such a port must be bound and later killed)
|
||||
# Note there are debug printfs marked as XXX for a race condition in travis
|
||||
|
||||
# Magic line must be first in script (see README.md)
|
||||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
||||
|
|
@ -117,7 +118,7 @@ EOF
|
|||
if [ -z "$pid" ]; then
|
||||
err "No pid return value" "$retx"
|
||||
fi
|
||||
echo "retx:$retx"
|
||||
echo "retx:$retx" # XXX
|
||||
if $active; then
|
||||
expect="^<rpc-reply $DEFAULTNS><active $LIBNS>$active</active><description $LIBNS>Clixon RESTCONF process</description><command $LIBNS>/.*/clixon_restconf -f $cfg -D [0-9] -l ${LOGDST_CMD}</command><status $LIBNS>$status</status><starttime $LIBNS>20[0-9][0-9]\-[0-9][0-9]\-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9]*Z</starttime><pid $LIBNS>$pid</pid></rpc-reply>]]>]]>$"
|
||||
else
|
||||
|
|
@ -169,16 +170,16 @@ expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><edit-confi
|
|||
new "commit minimal server"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><commit/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
echo "pid:$pid"
|
||||
ps aux|grep clixon_
|
||||
echo "pid:$pid" # XXX
|
||||
ps aux|grep clixon_ # XXX
|
||||
|
||||
new "2. get status, get pid1"
|
||||
rpcstatus true running
|
||||
pid1=$pid
|
||||
if [ $pid1 -eq 0 ]; then err "Pid" 0; fi
|
||||
|
||||
echo "pid1:$pid1"
|
||||
ps aux|grep clixon_
|
||||
echo "pid1:$pid1" # XXX
|
||||
ps aux|grep clixon_ # XXX
|
||||
|
||||
new "Check $pid1 exists"
|
||||
while sudo kill -0 $pid1 2> /dev/null; do
|
||||
|
|
@ -187,8 +188,8 @@ while sudo kill -0 $pid1 2> /dev/null; do
|
|||
sleep $DEMSLEEP
|
||||
done
|
||||
|
||||
echo "pid1:$pid1"
|
||||
ps aux|grep clixon_
|
||||
echo "pid1:$pid1" # XXX
|
||||
ps aux|grep clixon_ # XXX
|
||||
|
||||
new "3. get status: Check killed"
|
||||
rpcstatus false stopped
|
||||
|
|
|
|||
|
|
@ -29,3 +29,11 @@ The current vagrant boxes are verified continuously:
|
|||
|
||||
For other vagrant boxes, see [search vagrant boxes](https://vagrantcloud.com/search)
|
||||
|
||||
Inaccessible
|
||||
------------
|
||||
Sometimes Vagrant says: ”Your VM has become inaccessible”
|
||||
|
||||
```
|
||||
VBoxManage list vms
|
||||
VBoxManage unregistervm xxx
|
||||
```
|
||||
|
|
|
|||
|
|
@ -26,6 +26,13 @@ if [ ! $(id -u clicon) ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Fcgi restconf requires /www-data directory for fcgi socket
|
||||
if [ ${with_restconf} = fcgi ]; then
|
||||
sudo mkdir /www-data
|
||||
sudo chown $wwwuser /www-data
|
||||
sudo chgrp $wwwuser /www-data
|
||||
fi
|
||||
|
||||
# cligen
|
||||
test -d src || mkdir src
|
||||
test -d src/cligen || (cd src;git clone https://github.com/clicon/cligen.git)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue