diff --git a/apps/cli/cli_pipe.c b/apps/cli/cli_pipe.c index b945f86f..cdee5bd0 100644 --- a/apps/cli/cli_pipe.c +++ b/apps/cli/cli_pipe.c @@ -190,8 +190,8 @@ pipe_grep_fn(clicon_handle h, */ int pipe_wc_fn(clicon_handle h, - cvec *cvv, - cvec *argv) + cvec *cvv, + cvec *argv) { int retval = -1; cg_var *cv; diff --git a/test/test_autocli_show.sh b/test/test_autocli_show.sh index bef861bd..59211a52 100755 --- a/test/test_autocli_show.sh +++ b/test/test_autocli_show.sh @@ -246,11 +246,11 @@ format=netconf # XXX netconf base capability 0, EOM framing new "cli check show config $format" -X='x1aby2
]]>]]>' +X="x1aby2
]]>]]>" expectpart "$($clixon_cli -1 -f $cfg -l o show config $format)" 0 "^$X$" new "cli check show auto $format table" -X='x1aby2
]]>]]>' +X="x1aby2
]]>]]>" expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table)" 0 "^$X$" # XXX rest does not print whole NETCONF path to root, eg does not include "table" diff --git a/test/test_choice.sh b/test/test_choice.sh index 7ae6dd08..00d92111 100755 --- a/test/test_choice.sh +++ b/test/test_choice.sh @@ -265,7 +265,7 @@ new "netconf commit protocol tcp" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf changing from TCP to UDP (RFC7950 7.9.6)" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "$" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "$" "" new "netconf get protocol udp" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -321,7 +321,7 @@ new "netconf set shorthand tcp" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf changing from TCP to UDP (RFC7950 7.9.6)" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf get shorthand udp" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_copy_config.sh b/test/test_copy_config.sh index 491c5ce2..e0580cb8 100755 --- a/test/test_copy_config.sh +++ b/test/test_copy_config.sh @@ -129,13 +129,13 @@ new "wait restconf" wait_restconf new "Add config to candidate" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" new "netconf commit to running" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "Delete candidate" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" # Here startup and candidate are empty, only running has content # test running->startup and running->candidate @@ -173,7 +173,7 @@ new "Check startup content xxx" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fddi" new "Delete candidate" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" # Here candidate is empty and startup has content # test startup->candidate @@ -188,7 +188,7 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " # Negative test: check copying to running is not allowed new "Delete candidate" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0if:fddinone " "" "" new "netconf commit to running" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -203,7 +203,7 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " if ! $YANG_UNKNOWN_ANYDATA ; then new "copy startup->running not allowed" - expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "applicationunknown-elementrunningerrorFailed to find YANG spec of XML node: running with parent: target in namespace: urn:ietf:params:xml:ns:netconf:base:1.0" + expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "applicationunknown-elementrunningerrorFailed to find YANG spec of XML node: running with parent: target in namespace: ${BASENS}" fi # restconf copy @@ -211,7 +211,7 @@ new "restconf copy-config smoketest, json" expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://127.0.0.1/restconf/operations/ietf-netconf:copy-config -d '{"ietf-netconf:input": {"target": {"startup": [null]},"source": {"running": [null]}}}')" 0 "HTTP/$HVER 204" new "restconf copy-config smoketest, xml" -expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+xml" $RCPROTO://127.0.0.1/restconf/operations/ietf-netconf:copy-config -d '')" 0 "HTTP/$HVER 204" +expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+xml" $RCPROTO://127.0.0.1/restconf/operations/ietf-netconf:copy-config -d "")" 0 "HTTP/$HVER 204" # Here running is empty new "Check running empty" diff --git a/test/test_datastore.sh b/test/test_datastore.sh index 3c2feda1..2358bb21 100755 --- a/test/test_datastore.sh +++ b/test/test_datastore.sh @@ -161,7 +161,6 @@ diff $mydir/kalle_db $mydir/candidate_db new "datastore lock" expectpart "$($clixon_util_datastore $conf lock 756)" 0 "" - rm -rf $mydir rm -rf $dir diff --git a/test/test_feature.sh b/test/test_feature.sh index 58278ac9..13b773c8 100755 --- a/test/test_feature.sh +++ b/test/test_feature.sh @@ -272,7 +272,7 @@ fi # Note order of features in ietf-netconf yang is alphabetically: candidate, startup, validate, xpath new "netconf module ietf-netconf" -expect="ietf-netconf2011-06-01urn:ietf:params:xml:ns:netconf:base:1.0candidatevalidatexpath" +expect="ietf-netconf2011-06-01${BASENS}candidatevalidatexpath" match=`echo "$ret" | grep --null -Go "$expect"` if [ -z "$match" ]; then err "$expect" "$ret" diff --git a/test/test_leaf_default.sh b/test/test_leaf_default.sh index 38dcbdf6..8060ef17 100755 --- a/test/test_leaf_default.sh +++ b/test/test_leaf_default.sh @@ -151,7 +151,7 @@ new "get config(report-all) r1" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "99" new "Remove r1" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "99" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "99" "" "" new "get config" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_leafref.sh b/test/test_leafref.sh index e9f0d524..7c00fb55 100755 --- a/test/test_leafref.sh +++ b/test/test_leafref.sh @@ -172,7 +172,7 @@ new "leafref validate (ok)" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "leafref delete leaf" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth0" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth0" "" "" new "leafref validate (should fail)" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "applicationbad-elementeth0errorLeafref validation failed: No leaf eth0 matching path /if:interfaces/if:interface/if:name in example.yang:[0-9]*" "" diff --git a/test/test_leafref_state.sh b/test/test_leafref_state.sh index 494c8fe4..842f0ad0 100755 --- a/test/test_leafref_state.sh +++ b/test/test_leafref_state.sh @@ -185,7 +185,7 @@ EOF # delete x, add y XML=$(cat < + x diff --git a/test/test_minmax.sh b/test/test_minmax.sh index b61aa828..c104e71c 100755 --- a/test/test_minmax.sh +++ b/test/test_minmax.sh @@ -247,19 +247,19 @@ new "netconf commit" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "minmax: delete to minimal: 1x a1,b1" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none11" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none11" "" "" new "minmax: commit minimal list" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "minmax: delete to no list" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none00" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none00" "" "" new "minmax: validate should fail empty list" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "protocoloperation-failedtoo-few-elementserror/c/a1" new "delete c" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none" "" "" # 0 new "add empty list entry with a min-element leaf within a non-presence container" @@ -285,7 +285,7 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " # 071 new "delete b3ll, empty" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none042" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "none042" "" "" new "validate expect OK" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_nacm_datanode.sh b/test/test_nacm_datanode.sh index d8d88877..d38a1be6 100755 --- a/test/test_nacm_datanode.sh +++ b/test/test_nacm_datanode.sh @@ -42,6 +42,9 @@ APPNAME=example . ./nacm.sh cfg=$dir/conf_yang.xml +CFD=$dir/conf.d +test -d $CFD || mkdir -p $CFD + fyang=$dir/nacm-example.yang fyang2=$dir/itf.yang @@ -51,6 +54,7 @@ RESTCONFIG=$(restconf_config user false) cat < $cfg $cfg + $CFD ${YANG_INSTALLDIR} $dir $fyang @@ -64,6 +68,11 @@ cat < $cfg /usr/local/var/$APPNAME internal true + +EOF + +cat < $CFD/restconf.xml + $RESTCONFIG EOF diff --git a/test/test_netconf.sh b/test/test_netconf.sh index c3946af0..a8576d98 100755 --- a/test/test_netconf.sh +++ b/test/test_netconf.sh @@ -156,15 +156,15 @@ wait_backend # Framing. with -q to inhibit rcv hello new "Empty frame" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 ']]>]]>' "" 'rpcoperation-failederrorEmpty XML]]>]]>' "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 ']]>]]>' "" "rpcoperation-failederrorEmpty XML]]>]]>" "" if [ $valgrindtest -eq 0 ]; then # Some leakage in lex / error handling difficult to catch new "Frame invalid non-xml" -expecteof "$clixon_netconf -qf $cfg" 0 "This is not XML]]>]]>" 'rpcoperation-failederrorxml_parse: line 0: syntax error: at or before: This]]>]]>' 2> /dev/null +expecteof "$clixon_netconf -qf $cfg" 0 "This is not XML]]>]]>" "rpcoperation-failederrorxml_parse: line 0: syntax error: at or before: This]]>]]>" 2> /dev/null fi new "Frame with two messages" -expecteof "$clixon_netconf -qf $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" 'rpcmalformed-messageerrorMore than one message in netconf rpc frame]]>]]>' +expecteof "$clixon_netconf -qf $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" "rpcmalformed-messageerrorMore than one message in netconf rpc frame]]>]]>" new "Frame with unknown message" expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" "^protocolunknown-elementxxxerrorUnrecognized netconf operation]]>]]>$" @@ -177,10 +177,10 @@ new "netconf rcv hello, disable RFC7895/ietf-yang-library" expecteof_netconf "$clixon_netconf -qD 7 -lf/tmp/netconf0.log -f $cfg -o CLICON_YANG_LIBRARY=0" 0 "$DEFAULTHELLO" "" "" "" new "netconf get-config nc prefix" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf get-config xx prefix" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf get-config double quotes" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -193,16 +193,16 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " # Trying prefixes new "Add subtree eth/0/0 using nc prefix" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "noneeth/0/0" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "noneeth/0/0" "" "" new "Add subtree eth/0/0 using xx prefix" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "noneeth/0/0" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "noneeth/0/0" "" "" new "Check nothing added" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "Add subtree eth/0/0 using none and create which should add eth/0/0" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" # Too many quotes, (single inside double inside single) need to fool bash rpc=$(chunked_framing "") @@ -214,25 +214,25 @@ new "Check eth/0/0 added using xpath" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "$rpc" "" "eth/0/0ex:eth" new "Re-create same eth/0/0 which should generate error" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" new "Delete eth/0/0 using none config" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" new "Check deleted eth/0/0 (non-presence container)" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "Re-Delete eth/0/0 using none should generate error" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0ex:ethnone " "" "" new "Add interface without key" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "ex:ethnone " "applicationmissing-elementnameerrorMandatory key in 'list interface' in ietf-interfaces.yang:[0-9]\+" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "ex:ethnone " "applicationmissing-elementnameerrorMandatory key in 'list interface' in ietf-interfaces.yang:[0-9]\+" "" new "netconf discard-changes" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf discard-changes using xx prefix" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf edit config" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth/0/0eth1true9.2.3.424" "" "" @@ -251,17 +251,17 @@ new "netconf validate missing type" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf validate using xx prefix" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf discard-changes" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" # These are clixon-lib attributes used by RESTCONF new "netonf edit-config with extra attributes on leaf" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "nonex99
" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "nonex99
" "" new "netconf get-config" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "x99
" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "x99
" new "netconf discard-changes" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -285,7 +285,7 @@ new "netconf commit" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf commit using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf edit config merge eth2" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth2ex:ethmerge" "" "" @@ -320,7 +320,7 @@ new "netconf get state operation" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:ethup42foo" new "netconf get state operation use prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:ethup42foo" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:ethup42foo" new "netconf lock" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -329,10 +329,10 @@ new "netconf unlock" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "protocollock-denied0errorUnlock failed, lock is not currently active" new "netconf lock using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf unlock using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "protocollock-denied0errorUnlock failed, lock is not currently active" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "protocollock-denied0errorUnlock failed, lock is not currently active" # send multiple frames rpc=$(chunked_framing "") @@ -365,14 +365,14 @@ new "close-session" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "close-session using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" # XXX NOTE that this does not actually kill a running session - and may even kill some random process,... new "kill-session" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "44" "" "" new "kill-session using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "44" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "44" "" "" new "asynchronous lock running" sleep 60 | cat <(echo "$HELLONO11]]>]]>") -| $clixon_netconf -qf $cfg >> /dev/null & @@ -417,7 +417,7 @@ new "copy startup to candidate" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "copy startup to candidate using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf get startup" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:eth" @@ -426,7 +426,7 @@ new "netconf delete startup" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf delete startup using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf check empty startup" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -435,7 +435,7 @@ new "netconf example rpc" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "42" "" "4242" new "netconf example rpc using prefix xx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "42" "" "4242" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "42" "" "4242" new "netconf empty rpc" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_netconf_framing.sh b/test/test_netconf_framing.sh index 0350385c..f48f566b 100755 --- a/test/test_netconf_framing.sh +++ b/test/test_netconf_framing.sh @@ -87,7 +87,7 @@ expecteof_netconf "$clixon_netconf -qef $cfg -o CLICON_NETCONF_BASE_CAPABILITY=1 rpc=$(cat <urn:ietf:params:netconf:base:1.1]]>]]> #85 - ## diff --git a/test/test_netconf_hello.sh b/test/test_netconf_hello.sh index 01a4f4c2..50024479 100755 --- a/test/test_netconf_hello.sh +++ b/test/test_netconf_hello.sh @@ -100,10 +100,10 @@ expecteof "$clixon_netconf -qef $cfg" 255 "urn:ietf:params:netconf:base:1.1]]>]]>" '^$' 2> /dev/null +expecteof "$clixon_netconf -qef $cfg" 255 "urn:ietf:params:netconf:base:1.1]]>]]>" '^$' 2> /dev/null new "Netconf snd hello with prefix" -expecteof "$clixon_netconf -qef $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" '^$' +expecteof "$clixon_netconf -qef $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" '^$' new "netconf snd + rcv hello" expecteof "$clixon_netconf -f $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" "^urn:ietf:params:netconf:base:1.1urn:ietf:params:netconf:base:1.0 @@ -118,7 +118,7 @@ expecteof "$clixon_netconf -f $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" '^protocolunknown-elementextra-elementerrorUnrecognized hello/capabilities element]]>]]>$' '^$' +expecteof "$clixon_netconf -qf $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" "^protocolunknown-elementextra-elementerrorUnrecognized hello/capabilities element]]>]]>$" '^$' new "Netconf send rpc without hello error" expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" "rpcoperation-failederrorClient must send an hello element before any RPC]]>]]>" '^$' diff --git a/test/test_netconf_whitespace.sh b/test/test_netconf_whitespace.sh index 6162e407..607f1c41 100755 --- a/test/test_netconf_whitespace.sh +++ b/test/test_netconf_whitespace.sh @@ -80,7 +80,7 @@ new "get startup" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "foo" new "remove" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "commit" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_order.sh b/test/test_order.sh index b9274f41..9554dbb7 100755 --- a/test/test_order.sh +++ b/test/test_order.sh @@ -372,7 +372,7 @@ new "check ordered-by-user: a,b,c,d,e" expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "abcde" new "move one entry (e) to leaf-list first" -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "e" "" "" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "e" "" "" new "check ordered-by-user: e,a,b,c,d" expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "eabcd" diff --git a/test/test_perf_netconf.sh b/test/test_perf_netconf.sh index 1a65cfef..8412e45e 100755 --- a/test/test_perf_netconf.sh +++ b/test/test_perf_netconf.sh @@ -189,7 +189,7 @@ expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "$rnd") + rpc=$(chunked_framing "$rnd") echo "$rpc" done | $clixon_netconf -qe1f $cfg > /dev/null; } 2>&1 | awk '/real/ {print $2}' diff --git a/test/test_restconf_internal.sh b/test/test_restconf_internal.sh index 115c8321..53d4bb84 100755 --- a/test/test_restconf_internal.sh +++ b/test/test_restconf_internal.sh @@ -481,7 +481,7 @@ if [ $pid -ne 0 ]; then err "Pid" "$pid"; fi # Negative validation checks of clixon-restconf / socket new "netconf edit config invalid ssl" -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "truedefault
0.0.0.0
80true
" "" "" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "truedefault
0.0.0.0
80true
" "" "" new "netconf validate should fail" expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationoperation-failederrorSSL enabled but server-cert-path not set" diff --git a/test/test_rpc.sh b/test/test_rpc.sh index 0b8f3ce8..9a3f34fb 100755 --- a/test/test_rpc.sh +++ b/test/test_rpc.sh @@ -293,21 +293,21 @@ new "netconf kill-session missing session-id mandatory" expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationmissing-elementsession-iderrorMandatory variable of kill-session in module ietf-netconf" new "netconf edit-config ok" -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "" if ! $YANG_UNKNOWN_ANYDATA ; then new "netconf edit-config extra arg: should fail" -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationunknown-elementextraerrorFailed to find YANG spec of XML node: extra with parent: edit-config in namespace: urn:ietf:params:xml:ns:netconf:base:1.0" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationunknown-elementextraerrorFailed to find YANG spec of XML node: extra with parent: edit-config in namespace: ${BASENS}" fi new "netconf edit-config empty target: should fail" -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationdata-missingmissing-choice/rpc/edit-config/targetconfig-targeterror" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationdata-missingmissing-choice/rpc/edit-config/targetconfig-targeterror" new "netconf edit-config missing target: should fail" -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationmissing-elementtargeterrorMandatory variable of edit-config in module ietf-netconf" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationmissing-elementtargeterrorMandatory variable of edit-config in module ietf-netconf" new "netconf edit-config missing config: should fail" -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationdata-missingmissing-choice/rpc/edit-configedit-contenterror" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "" "" "applicationdata-missingmissing-choice/rpc/edit-configedit-contenterror" # Negative errors (namespace/module missing) new "netconf wrong rpc namespace: should fail" @@ -331,7 +331,7 @@ if [ $r -ne 0 ]; then err "0" "$r" fi -for expect in "mandatory42" '' 'foobar' ""; do +for expect in "mandatory42" 'foobar' ""; do new "expect:$expect" match=`echo $ret | grep --null -Eo "$expect"` if [ -z "$match" ]; then diff --git a/test/test_type.sh b/test/test_type.sh index 8770e7ab..744d051b 100755 --- a/test/test_type.sh +++ b/test/test_type.sh @@ -627,7 +627,7 @@ EOF expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf delete mandatory variable" - expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "foonone" "" "" + expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "foonone" "" "" new "get mandatory" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_unique.sh b/test/test_unique.sh index 043eeec5..7355846a 100755 --- a/test/test_unique.sh +++ b/test/test_unique.sh @@ -128,14 +128,14 @@ new "netconf validate ok" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "make it invalid by adding port to ftp entry" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "noneftp25 +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "noneftp25 " "" "" new "netconf validate (should fail)" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "applicationoperation-faileddata-not-uniqueerror/c/server[name=\"smtp\"]/ip/c/server[name=\"smtp\"]/port" new "make it valid by deleting port from smtp entry" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "nonesmtp25 +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "nonesmtp25 " "" "" new "netconf validate ok" diff --git a/test/test_yang.sh b/test/test_yang.sh index 406de0fd..b097e638 100755 --- a/test/test_yang.sh +++ b/test/test_yang.sh @@ -279,7 +279,7 @@ new "netconf check replace" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "111replace121two" new "netconf delete first" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "111" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "111" "" "" new "netconf check delete" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "121two" diff --git a/test/test_yang_default.sh b/test/test_yang_default.sh index 688adfcd..952e27a3 100755 --- a/test/test_yang_default.sh +++ b/test/test_yang_default.sh @@ -120,7 +120,7 @@ new "check running defaults" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "0" new "delete existing list element" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "0" "" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "0" "" "" new "netconf commit" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_yang_with_defaults.sh b/test/test_yang_with_defaults.sh index 23004464..43c1a250 100755 --- a/test/test_yang_with_defaults.sh +++ b/test/test_yang_with_defaults.sh @@ -299,7 +299,7 @@ new "rfc6243 2.3.3. 'explicit' and Behavior (part 1 # (test: try to create mtu=3000 on interface eth3) expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" \ "\ -\ +\ eth33000\ none " "" \ "\ @@ -332,7 +332,7 @@ new "rfc6243 2.3.3. 'explicit' and Behavior (part 2 # (test: set mtu=3000 on interface eth1) expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" \ "\ -\ +\ eth13000\ none " \ "" \ @@ -361,7 +361,7 @@ new "rfc6243 2.3.3. 'explicit' and Behavior (part 3 # (test: try to delete mtu on interface eth1) expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" \ "\ -\ +\ eth1\ none" \ "" \ @@ -390,7 +390,7 @@ new "rfc6243 2.3.3. 'explicit' and Behavior (part 4 #(test: try to delete default mtu on interface eth1) expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" \ "\ -\ +\ eth11500\ none" \ "" \