Cleaning up code for xml insignificant whitespace removal

Experimenal explicit index search code
This commit is contained in:
Olof hagsand 2020-02-07 14:59:57 +01:00
parent c7d6f69a85
commit a674af6f2c
32 changed files with 493 additions and 180 deletions

View file

@ -63,6 +63,7 @@ module leafref{
}
EOF
# This is state data writte to file that backend reads from (on request)
cat <<EOF > $fstate
<sender-state xmlns="urn:example:example">
<ref>x</ref>
@ -83,7 +84,7 @@ if [ $BE -ne 0 ]; then
wait_backend
fi
# Test top-level, default prefix, wring leafref prefix and typedef path
# Test top-level, default prefix, wrong leafref prefix and typedef path
XML=$(cat <<EOF
<sender-config xmlns="urn:example:example">
<name>x</name>
@ -127,6 +128,24 @@ expecteof "$clixon_netconf -qf $cfg" 0 '<rpc><get content="nonconfig"><filter ty
new "netconf get /sender-config config-only"
expecteof "$clixon_netconf -qf $cfg" 0 '<rpc><get content="config"><filter type="xpath" select="/sender-config" xmlns="urn:example:example"/></get></rpc>]]>]]>' '^<rpc-reply><data><sender-config xmlns="urn:example:example"><name>x</name></sender-config></data></rpc-reply>]]>]]>$'
# Negative tests,
# Double xmlns attribute
cat <<EOF > $fstate
<sender-config xmlns="urn:example:example">
<name>x</name>
</sender-config>
EOF
new "Merge same tree - check double xmlns attribute"
expecteof "$clixon_netconf -qf $cfg" 0 '<rpc><get content="all"><filter type="xpath" select="/"/></get></rpc>]]>]]>' '^<rpc-reply><data><sender-config xmlns="urn:example:example"><name>x</name></sender-config></data></rpc-reply>]]>]]>$'
# Back to original
cat <<EOF > $fstate
<sender-state xmlns="urn:example:example">
<ref>x</ref>
</sender-state>
EOF
# delete x, add y
XML=$(cat <<EOF
<sender-config xmlns="urn:example:example" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete">