rm xml index; added xml util functions; further xmldb development
This commit is contained in:
parent
d02015f456
commit
c2f52845f8
11 changed files with 653 additions and 187 deletions
|
|
@ -26,6 +26,16 @@ module ietf-ip{
|
|||
leaf d {
|
||||
type empty;
|
||||
}
|
||||
container f {
|
||||
leaf-list e {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
container h {
|
||||
leaf j {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
|
@ -52,6 +62,15 @@ expecteof "$clixon_netconf -qf $clixon_cf -y /tmp/test" "<rpc><commit/></rpc>]]>
|
|||
new "netconf get config xpath"
|
||||
expecteof "$clixon_netconf -qf $clixon_cf -y /tmp/test" "<rpc><get-config><source><candidate/></source><filter type=\"xpath\" select=\"/x/y[a=1][b=2]\"/></get-config></rpc>]]>]]>" "^<rpc-reply><data><config><x><y><a>1</a><b>2</b><c>5</c></y></x></config></data></rpc-reply>]]>]]>$"
|
||||
|
||||
new "netconf edit leaf-list"
|
||||
expecteof "$clixon_netconf -qf $clixon_cf -y /tmp/test" "<rpc><edit-config><target><candidate/></target><config><x><f><e>hej</e><e>hopp</e></f></x></config></edit-config></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
new "netconf get leaf-list"
|
||||
expecteof "$clixon_netconf -qf $clixon_cf -y /tmp/test" "<rpc><get-config><source><candidate/></source><filter type=\"xpath\" select=\"/x/f/e\"/></get-config></rpc>]]>]]>" "^<rpc-reply><data><config><x><f><e>hej</e><e>hopp</e></f></x></config></data></rpc-reply>]]>]]>$"
|
||||
|
||||
new "netconf get leaf-list path"
|
||||
expecteof "$clixon_netconf -qf $clixon_cf -y /tmp/test" "<rpc><get-config><source><candidate/></source><filter type=\"xpath\" select=\"/x/f[e=hej]\"/></get-config></rpc>]]>]]>" "^<rpc-reply><data><config><x><f><e>hej</e><e>hopp</e></f></x></config></data></rpc-reply>]]>]]>$"
|
||||
|
||||
new "Kill backend"
|
||||
# Check if still alive
|
||||
pid=`pgrep clixon_backend`
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
datastore=datastore_client
|
||||
|
||||
|
||||
cat <<EOF > /tmp/ietf-ip.yang
|
||||
module ietf-ip{
|
||||
container x {
|
||||
|
|
@ -24,22 +25,52 @@ module ietf-ip{
|
|||
leaf d {
|
||||
type empty;
|
||||
}
|
||||
container f {
|
||||
leaf-list e {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
container h {
|
||||
leaf j {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
db='<config><x><y><a>1</a><b>2</b><c>first-entry</c></y><y><a>1</a><b>3</b><c>second-entry</c></y><y><a>2</a><b>3</b><c>third-entry</c></y><d/><f><e>a</e><e>b</e><e>c</e></f><g>astring</g></x></config>'
|
||||
|
||||
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"
|
||||
new "datastore $name init"
|
||||
expectfn "$datastore $conf init" ""
|
||||
|
||||
new "datastore $name put top"
|
||||
echo "$datastore $conf put replace '/' $db"
|
||||
expectfn "$datastore $conf put replace '/' \"$db\"" ""
|
||||
|
||||
return
|
||||
new "datastore $name get"
|
||||
expectfn "$datastore $conf get /" $db
|
||||
|
||||
new "datastore $name put rm"
|
||||
expectfn "$datastore $conf put remove /x/g"
|
||||
|
||||
new "datastore $name put top"
|
||||
expectfn "$datastore $conf put replace / $db"
|
||||
|
||||
new "datastore $name put del"
|
||||
expectfn "$datastore $conf put delete /x/g"
|
||||
|
||||
return
|
||||
new "datastore $name get empty"
|
||||
expectfn "$datastore $conf get /" "^<config/>$"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue