diff --git a/test/test_augment.sh b/test/test_augment.sh index 13b5f798..2102ed75 100755 --- a/test/test_augment.sh +++ b/test/test_augment.sh @@ -236,8 +236,11 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " true " "" "" +new "netconf verify get with refined ports (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "e1mymod:some-new-iftypetrue808080" "" + new "netconf verify get with refined ports" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "e1mymod:some-new-iftypetrue808080" "" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "e1mymod:some-new-iftypetrue" "" new "netconf set identity defined in other" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " @@ -264,8 +267,11 @@ new "netconf commit ok" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" # restconf and augment +new "restconf get augment json (report-all)" +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces?with-defaults=report-all)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interfaces":{"interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:port":80,"example-augment:lport":8080},{"name":"e2","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:other":"ietf-interfaces:fddi","example-augment:port":80,"example-augment:lport":8080},{"name":"e3","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:me":"you","example-augment:port":80,"example-augment:lport":8080}\]}}' + new "restconf get augment json" -expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interfaces":{"interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:port":80,"example-augment:lport":8080},{"name":"e2","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:other":"ietf-interfaces:fddi","example-augment:port":80,"example-augment:lport":8080},{"name":"e3","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:me":"you","example-augment:port":80,"example-augment:lport":8080}\]}}' +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interfaces":{"interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true"},{"name":"e2","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:other":"ietf-interfaces:fddi"},{"name":"e3","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:me":"you"}\]}}' new "restconf get augment xml" expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces)" 0 "HTTP/$HVER 200" ' @@ -291,14 +297,23 @@ EOF new "restconf POST augment multi-namespace path e2 (middle path)" expectpart "$(curl $CURLOPTS -X POST -H 'Content-Type: application/yang-data+xml' $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e2 -d "$XML" )" 0 "HTTP/$HVER 201" +new "restconf GET augment multi-namespace top (report-all)" +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces?with-defaults=report-all)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interfaces":{"interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true","example-augment:port":80,"example-augment:lport":8080},{"name":"e2","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true","example-augment:other":"ietf-interfaces:fddi","example-augment:port":80,"example-augment:lport":8080},{"name":"e3","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:me":"you","example-augment:port":80,"example-augment:lport":8080}\]}}' + new "restconf GET augment multi-namespace top" -expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interfaces":{"interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true","example-augment:port":80,"example-augment:lport":8080},{"name":"e2","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true","example-augment:other":"ietf-interfaces:fddi","example-augment:port":80,"example-augment:lport":8080},{"name":"e3","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:me":"you","example-augment:port":80,"example-augment:lport":8080}\]}}' +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interfaces":{"interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true"},{"name":"e2","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true","example-augment:other":"ietf-interfaces:fddi"},{"name":"e3","type":"example-augment:some-new-iftype","example-augment:mandatory-leaf":"true","example-augment:me":"you"}\]}}' + +new "restconf GET augment multi-namespace level 1 (report-all)" +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e1?with-defaults=report-all)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true","example-augment:port":80,"example-augment:lport":8080}\]}' new "restconf GET augment multi-namespace level 1" -expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e1)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true","example-augment:port":80,"example-augment:lport":8080}\]}' +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e1)" 0 "HTTP/$HVER 200" '{"ietf-interfaces:interface":\[{"name":"e1","type":"example-augment:some-new-iftype","example-augment:ospf":{"reference-bandwidth":23},"example-augment:mandatory-leaf":"true"}\]}' new "restconf GET augment multi-namespace cross" -expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e1/example-augment:ospf)" 0 "HTTP/$HVER 200" '{"example-augment:ospf":{"reference-bandwidth":23}}' +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e1/example-augment:ospf?with-defaults=report-all)" 0 "HTTP/$HVER 200" '{"example-augment:ospf":{"reference-bandwidth":23}}' + +new "restconf GET augment multi-namespace cross level 2 (report-all)" +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e1/example-augment:ospf/reference-bandwidth?with-defaults=report-all)" 0 "HTTP/$HVER 200" '{"example-augment:reference-bandwidth":23}' new "restconf GET augment multi-namespace cross level 2" expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e1/example-augment:ospf/reference-bandwidth)" 0 "HTTP/$HVER 200" '{"example-augment:reference-bandwidth":23}' diff --git a/test/test_augment_default.sh b/test/test_augment_default.sh index ea6edb77..08896c32 100755 --- a/test/test_augment_default.sh +++ b/test/test_augment_default.sh @@ -89,19 +89,19 @@ new "wait backend" wait_backend new "cli show config startup" -expectpart "$($clixon_cli -1 -f $cfg -l o show config xml)" 0 '' '' 'true' +expectpart "$($clixon_cli -1 -f $cfg -l o show config xml default report-all)" 0 '
' '' 'true' new "cli delete map name" expectpart "$($clixon_cli -1 -f $cfg -l o delete table map name me)" 0 "" new "cli show config deleted" -expectpart "$($clixon_cli -1 -f $cfg -l o show config xml)" 0 '
' '' 'true' +expectpart "$($clixon_cli -1 -f $cfg -l o show config xml default report-all)" 0 '
' '' 'true' new "cli set map name" expectpart "$($clixon_cli -1 -f $cfg -l o set table map name x)" 0 "" new "cli show config set" -expectpart "$($clixon_cli -1 -f $cfg -l o show config xml)" 0 '
' '' 'true' +expectpart "$($clixon_cli -1 -f $cfg -l o show config xml default report-all)" 0 '
' '' 'true' if [ $BE -ne 0 ]; then new "Kill backend" diff --git a/test/test_augment_state.sh b/test/test_augment_state.sh index 0dc65175..68de7081 100755 --- a/test/test_augment_state.sh +++ b/test/test_augment_state.sh @@ -125,13 +125,13 @@ function testrun() new "get config" if [ -z "$config" ]; then - expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "^$" + expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "^$" else - expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "^$config$" + expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "^$config$" fi new "get state" - expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "^$state$" + expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "^$state$" } new "test params: -f $cfg" diff --git a/test/test_copy_config.sh b/test/test_copy_config.sh index f8b6e9b1..cddba32d 100755 --- a/test/test_copy_config.sh +++ b/test/test_copy_config.sh @@ -153,10 +153,10 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " # Here startup and candidate have content new "Check candidate content" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fdditrue" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fddi" new "Check startup content" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fdditrue" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fddi" new "Delete startup" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -170,7 +170,7 @@ new "copy candidate->startup" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "Check startup content xxx" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fdditrue" +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 " "" "" @@ -184,7 +184,7 @@ new "copy startup->candidate" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "Check candidate content" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fdditrue" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth/0/0if:fddi" # Negative test: check copying to running is not allowed new "Delete candidate" diff --git a/test/test_leaf_default.sh b/test/test_leaf_default.sh index e205ee3b..1dd6ea55 100755 --- a/test/test_leaf_default.sh +++ b/test/test_leaf_default.sh @@ -136,7 +136,10 @@ new "wait backend" wait_backend new "get config" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "$XML" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" + +new "get config(report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "$XML" new "Change default value r1" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "99" "" "" @@ -144,24 +147,36 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" " new "get config r1" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "99" +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" "" "" new "get config" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "$XML" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" + +new "get config(report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "$XML" new "Set x list element" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "a" "" "" -new "get config (should contain y/inside+outside)" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "$XMLafalsefalse" +new "get config (should not contain y/inside+outside)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "a" + +new "get config(report-all) (should contain y/inside+outside)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "$XMLafalsefalse" # Set s3 leaf to 99 triggering when condition for default values new "Set s3 to 99" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "99" "" "" new "get config np3 with npleaf and npext" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "99319899" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "99" + +new "get config(report-all) np3 with npleaf and npext" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "99319899" if [ $BE -ne 0 ]; then new "Kill backend" @@ -198,7 +213,11 @@ wait_backend new "get startup config" # Should have all defaults, except r1 that is set to 99 -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "$XML" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "$SXML" + +new "get(report-all) startup config" +# Should have all defaults, except r1 that is set to 99 +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "$XML" # permission kludges sudo chmod 666 $dir/running_db @@ -258,7 +277,10 @@ new "wait backend" wait_backend new "get startup config with presence" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "$XML" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" + +new "get(report-all) startup config with presence" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "$XML" if [ $BE -ne 0 ]; then new "Kill backend" @@ -290,7 +312,10 @@ new "wait backend" wait_backend new "get startup config with list default" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "$XMLafalsefalse" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "a" + +new "get(report-all) startup config with list default" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "$XMLafalsefalse" if [ $BE -ne 0 ]; then new "Kill backend" diff --git a/test/test_nacm_recovery.sh b/test/test_nacm_recovery.sh index b5274618..eb378cba 100755 --- a/test/test_nacm_recovery.sh +++ b/test/test_nacm_recovery.sh @@ -112,7 +112,7 @@ EOF if $getp; then # default is read allowed so this should always succeed. new "get startup default ok" - expecteof_netconf "$prefix$clixon_netconf -qf $cfg -U $pseudo" 0 "$DEFAULTHELLO" "" "" "$DEFAULT" + expecteof_netconf "$prefix$clixon_netconf -qf $cfg -U $pseudo" 0 "$DEFAULTHELLO" "report-all" "" "$DEFAULT" # This would normally not work except in recovery situations else new "get startup not ok" diff --git a/test/test_netconf.sh b/test/test_netconf.sh index e4bde339..758c4baa 100755 --- a/test/test_netconf.sh +++ b/test/test_netconf.sh @@ -207,7 +207,7 @@ $DEFAULTHELLO$rpc EOF new "Check eth/0/0 added using xpath" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "$rpc" "" "eth/0/0ex:ethtrue" +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 " "" "" @@ -241,7 +241,7 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "$rpc" "" "" new "netconf get config xpath parent" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "$rpc" "" "eth/0/0trueeth1truetruefalse
9.2.3.424
" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "$rpc" "" "eth/0/0eth1true
9.2.3.424
" new "netconf validate missing type" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -281,7 +281,10 @@ new "netconf edit ampersand encoding(<&): name:'eth&' type:'t<>'" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "eth&t<>" "" "" new "netconf get replaced config" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth&t<>trueeth1ex:ethtrueeth2ex:ethtrue" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth&t<>eth1ex:etheth2ex:eth" + +new "netconf get replaced config (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "eth&t<>trueeth1ex:ethtrueeth2ex:ethtrue" new "cli show configuration eth& - encoding tests" expectpart "$($clixon_cli -1 -f $cfg show conf cli)" 0 "interfaces interface eth& type t<> @@ -300,10 +303,10 @@ new "netconf edit state operation should fail" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "e0up" "" "applicationbad-elementoper-statuserrormodule ietf-interfaces: state data node unexpected" new "netconf get state operation" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:ethtrueup42foo" +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:ethtrueup42foo" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:ethup42foo" new "netconf lock" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" @@ -403,7 +406,7 @@ new "copy startup to candidate using prefix xx" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "netconf get startup" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:ethtrue" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "eth1ex:eth" new "netconf delete startup" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_perf_state.sh b/test/test_perf_state.sh index 77462f45..970fd60a 100755 --- a/test/test_perf_state.sh +++ b/test/test_perf_state.sh @@ -150,7 +150,7 @@ new "netconf get test single req" sel="/ex:interfaces/ex:a[ex:name='foo']/ex:b/ex:interface[ex:name='e1']" rpc=$(chunked_framing "") -expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "$rpc" "" "fooe1ex:ethtrueup" +expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "$rpc" "" "fooe1ex:ethup" new "netconf get $perfreq single reqs" { time -p for (( i=0; i<$perfreq; i++ )); do @@ -162,7 +162,7 @@ done | $clixon_netconf -qe1f $cfg > /dev/null; } 2>&1 | awk '/real/ {print $2}' # RESTCONF get new "restconf get test single req" -expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example:interfaces/a=foo/b/interface=e1)" 0 "HTTP/$HVER 200" '{"example:interface":\[{"name":"e1","type":"ex:eth","enabled":true,"status":"up"}\]}' +expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example:interfaces/a=foo/b/interface=e1)" 0 "HTTP/$HVER 200" '{"example:interface":\[{"name":"e1","type":"ex:eth","status":"up"}\]}' new "restconf get $perfreq single reqs" #curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-interfaces:interfaces/interface=e67 @@ -178,7 +178,7 @@ edit interfaces a foo b interface e1 show state xml EOF new "cli get test single req" -expectpart "$($clixon_cli -F $fin -f $cfg)" 0 "e1" "ex:eth" "true" "up$" +expectpart "$($clixon_cli -F $fin -f $cfg)" 0 "e1" "ex:eth" "up$" new "cli get $perfreq single reqs" { time -p for (( i=0; i<$perfreq; i++ )); do diff --git a/test/test_refine.sh b/test/test_refine.sh index b31a6690..3a3b0e30 100755 --- a/test/test_refine.sh +++ b/test/test_refine.sh @@ -95,14 +95,20 @@ wait_backend new "Set local-definition" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +new "Get config expected foo2 refined default value (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "foo2" + new "Get config expected foo2 refined default value" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "foo2" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" new "Set keystore-reference" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" +new "Get config expected bar2 refined default value (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "bar2" + new "Get config expected bar2 refined default value" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "bar2" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" if [ $BE -ne 0 ]; then new "Kill backend" diff --git a/test/test_restconf_internal_usecases.sh b/test/test_restconf_internal_usecases.sh index 8e21622c..f8ffff39 100755 --- a/test/test_restconf_internal_usecases.sh +++ b/test/test_restconf_internal_usecases.sh @@ -357,7 +357,7 @@ if [ $pid1 -eq 0 ]; then err "Pid" 0; fi sleep $DEMSLEEP new "Get restconf config 1" -expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/clixon-restconf:restconf)" 0 "HTTP/$HVER 200" "truenone$RESTCONFDBG$LOGDSTfalsefalsedefault
0.0.0.0
80false
" +expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/clixon-restconf:restconf?with-defaults=report-all)" 0 "HTTP/$HVER 200" "truenone$RESTCONFDBG$LOGDSTfalsefalsedefault
0.0.0.0
80false
" # remove it new "Delete server" @@ -452,7 +452,7 @@ if [ $pid1 -eq 0 ]; then err "Pid" 0; fi sleep $DEMSLEEP new "Get restconf config" -expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/clixon-restconf:restconf)" 0 "HTTP/$HVER 200" "truenone$RESTCONFDBG$LOGDSTfalsefalsedefault
0.0.0.0
80false
default
$INVALIDADDR
8080false
" +expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/clixon-restconf:restconf?with-defaults=report-all)" 0 "HTTP/$HVER 200" "truenone$RESTCONFDBG$LOGDSTfalsefalsedefault
0.0.0.0
80false
default
$INVALIDADDR
8080false
" if [ $BE -ne 0 ]; then new "Kill backend" diff --git a/test/test_with_default.sh b/test/test_with_default.sh index e207ef7b..916c8be6 100755 --- a/test/test_with_default.sh +++ b/test/test_with_default.sh @@ -92,7 +92,7 @@ TRIM='defaultnotset$XML
" "" "" diff --git a/test/test_yang_default.sh b/test/test_yang_default.sh index 2416a282..761e50ce 100755 --- a/test/test_yang_default.sh +++ b/test/test_yang_default.sh @@ -113,8 +113,11 @@ if [ $? -ne 0 ]; then err "<${DATASTORE_TOP}>$XML" "$ret" fi +new "check running defaults (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "880foo42" + new "check running defaults" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "880foo42" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "0" new "delete existing list element" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "0" "" "" @@ -125,23 +128,41 @@ expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "17" "" "" +new "get the list top (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "8817foo42" + new "get the list top" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "8817foo42" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "17" + +new "get the list xpath /a (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "8817foo42" new "get the list xpath /a" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "8817foo42" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "17" + +new "get the list xpath /a/b (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "17foo42" new "get the list xpath /a/b" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "17foo42" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "17" + +new "get the list xpath /a/b/c (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "17" new "get the list xpath /a/b/c" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "17" +new "get the list xpath /a/b/c=17 (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all17" "" "17foo42" + new "get the list xpath /a/b/c=17" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "17" "" "17foo42" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "17" "" "17" + +new "get the list xpath /a/b/c=17/d1 (report-all)" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all17" "" "17foo" new "get the list xpath /a/b/c=17/d1" -expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "17" "" "17foo" +expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "17" "" "17" if [ $BE -ne 0 ]; then # Bring your own backend new "Kill backend" diff --git a/test/test_yang_deviation.sh b/test/test_yang_deviation.sh index e911a845..9eddbb69 100755 --- a/test/test_yang_deviation.sh +++ b/test/test_yang_deviation.sh @@ -124,7 +124,7 @@ function testrun() if $admindefault; then # add rule new "Get type admin expected" - expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "bobadmin" + expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "bobadmin" else new "Get type none expected" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "" diff --git a/test/test_yang_wdcc.sh b/test/test_yang_wdcc.sh index 1b388eb1..2b1474d7 100755 --- a/test/test_yang_wdcc.sh +++ b/test/test_yang_wdcc.sh @@ -204,7 +204,7 @@ new "rfc6243 2.3.1. 'explicit' Basic Mode Retrieval" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" \ "" "" \ "\ -15001500ok\ +1500ok\ " diff --git a/test/test_yang_when.sh b/test/test_yang_when.sh index b759e2bf..ef801d1b 100755 --- a/test/test_yang_when.sh +++ b/test/test_yang_when.sh @@ -114,7 +114,7 @@ function testrun() expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "
kalle
merge
" "" "" new "netconf get default value set" - expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "" "" "kallefoo
" + expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "report-all" "" "kallefoo
" new "netconf set non-match value expect ok" expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "kalle42
merge
" "" ""