Refined netconf none semantics in tests and text datastore

This commit is contained in:
Olof hagsand 2017-05-01 12:46:09 +02:00
parent 2f30bda7d4
commit 69ff0e3891
19 changed files with 247 additions and 91 deletions

View file

@ -47,15 +47,18 @@ db='<config><x><y><a>1</a><b>2</b><c>first-entry</c></y><y><a>1</a><b>3</b><c>se
run(){
name=$1
dir=/tmp/$name
if [ ! -d $dir ]; then
mkdir $dir
fi
rm -rf $dir/*
conf="-d candidate -b $dir -p ../datastore/$name/$name.so -y /tmp -m ietf-ip"
echo "conf:$conf"
# echo "conf:$conf"
new "datastore $name init"
expectfn "$datastore $conf init" ""
# Whole tree operations
new "datastore $name put all replace"
expectfn "$datastore $conf put replace / $db" ""
@ -89,31 +92,55 @@ run(){
new "datastore $name put top create"
expectfn "$datastore $conf put create / <config><x/></config>" "" # error
return
# Single key operations
# leaf
new "datastore $name put all delete"
expectfn "$datastore $conf delete" ""
new "datastore $name init"
expectfn "$datastore $conf init" ""
new "datastore $name create leaf"
expectfn "$datastore $conf put create /x/y=1,3/c <c>newentry</c>"
new "datastore $name put top"
expectfn "$datastore $conf put replace / $db"
new "datastore $name create leaf"
expectfn "$datastore $conf put create /x/y=1,3/c <c>newentry</c>"
new "datastore $name put del"
new "datastore $name delete leaf"
expectfn "$datastore $conf put delete /x/y=1,3"
new "datastore $name replace leaf"
expectfn "$datastore $conf put create /x/y=1,3/c <c>newentry</c>"
new "datastore $name remove leaf"
expectfn "$datastore $conf put remove /x/g"
new "datastore $name remove leaf"
expectfn "$datastore $conf put remove /x/y=1,3/c"
new "datastore $name delete leaf"
expectfn "$datastore $conf put delete /x/g"
return
new "datastore $name get empty"
expectfn "$datastore $conf get /" "^<config/>$"
new "datastore $name merge leaf"
expectfn "$datastore $conf put merge /x/g <g>nalle</g>"
new "datastore $name put top"
expectfn "$datastore $conf put replace / <config><x><y><a>foo</a><b>bar</b><c>fie</c></y></x></config>" ""
new "datastore $name replace leaf"
expectfn "$datastore $conf put replace /x/g <g>nalle</g>"
new "datastore $name get config"
expectfn "$datastore $conf get /" "^<config><x><y><a>foo</a><b>bar</b><c>fie</c></y></x></config>$"
new "datastore $name merge leaf"
expectfn "$datastore $conf put merge /x/y=1,3/c <c>newentry</c>"
new "datastore $name put delete"
expectfn "$datastore $conf put delete / <config/>" ""
new "datastore $name replace leaf"
expectfn "$datastore $conf put replace /x/y=1,3/c <c>newentry</c>"
new "datastore $name get deleted"
expectfn "$datastore $conf get /" "^<config/>$"
new "datastore $name create leaf"
expectfn "$datastore $conf put create /x/h <h><j>aaa</j></h>"
new "datastore $name create leaf"
expectfn "$datastore $conf put create /x/y=1,3/c <c>newentry</c>"
#leaf-list
rm -rf $dir
}