Demon->Daemon, FreeBSD grep changes
This commit is contained in:
parent
734f65e25a
commit
77b491c568
15 changed files with 54 additions and 51 deletions
|
|
@ -78,9 +78,8 @@ You may add your site-specific modifications in a `site.sh` file. Example:
|
|||
IETFRFC=$YANGMODELS/standard/ietf/RFC
|
||||
```
|
||||
|
||||
## FreeBSD
|
||||
|
||||
To run on freebsd:
|
||||
For example, in FreeBSD, add:
|
||||
```
|
||||
wwwuser=www
|
||||
make=gmake
|
||||
```
|
||||
wwwuser=www clixon_restconf=/usr/local/sbin/clixon_restconf ./all.sh
|
||||
```
|
||||
|
|
@ -123,14 +123,14 @@ EOF
|
|||
|
||||
new "netconf modules-state header"
|
||||
expect='^<rpc-reply><data><modules-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"><module><name>'
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
||||
new "netconf module A"
|
||||
expect="<module><name>example</name><revision/><namespace>urn:example:clixon</namespace><feature>A</feature><conformance-type>implement</conformance-type></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -138,7 +138,7 @@ fi
|
|||
if false ; then # clixon "config" bug
|
||||
new "netconf module clixon-config"
|
||||
expect="<module><name>clixon-config</name><revision>2018-09-30</revision><namespace/></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -146,14 +146,14 @@ fi # false
|
|||
|
||||
new "netconf module ietf-inet-types"
|
||||
expect="<module><name>ietf-inet-types</name><revision>2013-07-15</revision><namespace>urn:ietf:params:xml:ns:yang:ietf-inet-types</namespace><conformance-type>implement</conformance-type></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
||||
new "netconf module ietf-interfaces"
|
||||
expect="<module><name>ietf-interfaces</name><revision>2018-02-20</revision><namespace>urn:ietf:params:xml:ns:yang:ietf-interfaces</namespace><conformance-type>implement</conformance-type></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -161,26 +161,26 @@ fi
|
|||
# Note order of features in ietf-netconf yang is alphabetically: candidate, startup, validate, xpath
|
||||
new "netconf module ietf-netconf"
|
||||
expect="<module><name>ietf-netconf</name><revision>2011-06-01</revision><namespace>urn:ietf:params:xml:ns:netconf:base:1.0</namespace><feature>candidate</feature><feature>validate</feature><feature>xpath</feature><conformance-type>implement</conformance-type></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
||||
new "netconf module ietf-routing"
|
||||
expect="<module><name>ietf-routing</name><revision>2018-03-13</revision><namespace>urn:ietf:params:xml:ns:yang:ietf-routing</namespace><feature>router-id</feature><conformance-type>implement</conformance-type></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
expect="<module><name>ietf-yang-library</name><revision>2016-06-21</revision><namespace>urn:ietf:params:xml:ns:yang:ietf-yang-library</namespace><conformance-type>implement</conformance-type></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
||||
new "netconf module ietf-yang_types"
|
||||
expect="<module><name>ietf-yang-types</name><revision>2013-07-15</revision><namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types</namespace><conformance-type>implement</conformance-type></module>"
|
||||
match=`echo "$ret" | grep -GZo "$expect"`
|
||||
match=`echo "$ret" | grep --null -Go "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -4,10 +4,13 @@
|
|||
# Magic line must be first in script (see README.md)
|
||||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
||||
|
||||
# Eg on FreeBSD use gmake
|
||||
: ${make:=make}
|
||||
|
||||
new "Set up installdir $dir"
|
||||
|
||||
new "Make DESTDIR install"
|
||||
(cd ..; make DESTDIR=$dir install)
|
||||
new "Make DESTDIR install ($dir)"
|
||||
(cd ..; $make DESTDIR=$dir install)
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
fi
|
||||
|
|
@ -33,7 +36,7 @@ if [ ! -h $dir/usr/local/lib/libclixon_backend.so ]; then
|
|||
fi
|
||||
|
||||
new "Make DESTDIR install include"
|
||||
(cd ..; make DESTDIR=$dir install-include)
|
||||
(cd ..; $make DESTDIR=$dir install-include)
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
fi
|
||||
|
|
@ -42,7 +45,7 @@ if [ ! -f $dir/usr/local/include/clixon/clixon.h ]; then
|
|||
err $dir/usr/local/include/clixon/clixon.h
|
||||
fi
|
||||
new "Make DESTDIR uninstall"
|
||||
(cd ..; make DESTDIR=$dir uninstall)
|
||||
(cd ..; $make DESTDIR=$dir uninstall)
|
||||
if [ $? -ne 0 ]; then
|
||||
err
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ expecteq "$(curl -u andy:bar -sS -X GET http://localhost/restconf/data/clixon-ex
|
|||
new "admin read top ok (all)"
|
||||
ret=$(curl -u andy:bar -sS -X GET http://localhost/restconf/data)
|
||||
expect='{"data":{"nacm-example:x":42,"clixon-example:translate":'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ expecteq "$(curl -sG http://localhost/restconf/operations)" 0 '{"operations":{"c
|
|||
new "restconf get restconf/operations. RFC8040 3.3.2 (xml)"
|
||||
ret=$(curl -s -H "Accept: application/yang-data+xml" -G http://localhost/restconf/operations)
|
||||
expect='<operations><client-rpc xmlns="urn:example:clixon"/><empty xmlns="urn:example:clixon"/><optional xmlns="urn:example:clixon"/><example xmlns="urn:example:clixon"/><debug xmlns="http://clicon.org/lib"/><ping xmlns="http://clicon.org/lib"/><get-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><copy-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><delete-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><lock xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><unlock xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><close-session xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><kill-session xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><commit xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><discard-changes xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><validate xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/><create-subscription xmlns="urn:ietf:params:xml:ns:netmod:notification"/></operations>'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -91,7 +91,7 @@ expecteq "$(curl -sG http://localhost/restconf/yang-library-version)" 0 '{"yang-
|
|||
new "restconf get restconf/yang-library-version. RFC8040 3.3.3 (xml)"
|
||||
ret=$(curl -s -H "Accept: application/yang-data+xml" -G http://localhost/restconf/yang-library-version)
|
||||
expect="<yang-library-version>2016-06-21</yang-library-version>"
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -132,7 +132,7 @@ expectpart "$(curl -siSG http://localhost/restconf/data/badmodule:state)" 0 'HTT
|
|||
new "restconf get empty config + state xml"
|
||||
ret=$(curl -s -H "Accept: application/yang-data+xml" -G http://localhost/restconf/data/clixon-example:state)
|
||||
expect='<state xmlns="urn:example:clixon"><op>42</op><op>41</op><op>43</op></state>'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -145,7 +145,7 @@ new "restconf get state operation"
|
|||
# Cant get shell macros to work, inline matching from lib.sh
|
||||
ret=$(curl -s -H "Accept: application/yang-data+xml" -G http://localhost/restconf/data/clixon-example:state/op=42)
|
||||
expect='<op xmlns="urn:example:clixon">42</op>'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -158,7 +158,7 @@ new "restconf get state operation type xml"
|
|||
# Cant get shell macros to work, inline matching from lib.sh
|
||||
ret=$(curl -s -H "Accept: application/yang-data+xml" -G http://localhost/restconf/data/clixon-example:state/op=42)
|
||||
expect='<op xmlns="urn:example:clixon">42</op>'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -250,7 +250,7 @@ expecteq "$(curl -s -X POST -H "Content-Type: application/yang-data+json" -d '{}
|
|||
new "restconf rpc using POST xml"
|
||||
ret=$(curl -s -X POST -H "Content-Type: application/yang-data+json" -H "Accept: application/yang-data+xml" -d '{"clixon-example:input":{"x":42}}' http://localhost/restconf/operations/clixon-example:example)
|
||||
expect='<output xmlns="urn:example:clixon"><x>42</x><y>42</y></output>'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -261,7 +261,7 @@ expecteq "$(curl -s -X POST -H "Content-Type: application/yang-data+json" -d '{"
|
|||
new "restconf local client rpc using POST xml"
|
||||
ret=$(curl -s -i -X POST -H "Content-Type: application/yang-data+json" -H "Accept: application/yang-data+xml" -d '{"clixon-example:input":{"x":"example"}}' http://localhost/restconf/operations/clixon-example:client-rpc)
|
||||
expect='<output xmlns="urn:example:clixon"><x>example</x></output>'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ expectfn "curl -s -X GET http://localhost/restconf/data/example:cont1/interface=
|
|||
new "restconf GET interface subtree xml"
|
||||
ret=$(curl -s -H "Accept: application/yang-data+xml" -G http://localhost/restconf/data/example:cont1/interface=local0)
|
||||
expect='<interface xmlns="urn:example:clixon"><name>local0</name><type>regular</type></interface>'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ new "rpc tests"
|
|||
new "restconf empty rpc"
|
||||
ret=$(curl -is -X POST http://localhost/restconf/operations/clixon-example:empty)
|
||||
expect="204 No Content"
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -108,7 +108,7 @@ expecteof "$clixon_netconf -qf $cfg" 0 '<rpc xmlns="urn:ietf:params:xml:ns:netco
|
|||
new "restconf empty rpc with null input"
|
||||
ret=$(curl -is -X POST -H "Content-Type: application/yang-data+json" -d '{"clixon-example:input":null}' http://localhost/restconf/operations/clixon-example:empty)
|
||||
expect="204 No Content"
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
@ -120,7 +120,7 @@ expectpart "$(curl -iss -X POST -H "Content-Type: application/yang-data+json" -d
|
|||
new "restconf optional rpc with null input and output"
|
||||
ret=$(curl -is -X POST -H "Content-Type: application/yang-data+json" -d '{"clixon-example:input":null}' http://localhost/restconf/operations/clixon-example:optional)
|
||||
expect="204 No Content"
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ expecteq "$(curl -s -X POST -H "Content-Type: application/yang-data+json" -d '{"
|
|||
new "restconf get config example1 and example2"
|
||||
ret=$(curl -s -X GET http://localhost/restconf/data)
|
||||
expect='"example1:x":42,"example2:x":{"y":99}'
|
||||
match=`echo $ret | grep -EZo "$expect"`
|
||||
match=`echo $ret | grep --null -Eo "$expect"`
|
||||
if [ -z "$match" ]; then
|
||||
err "$expect" "$ret"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue