Test: Fixed: show netconf pretty

This commit is contained in:
Olof hagsand 2022-06-07 14:21:40 +02:00
parent b1cb774c9d
commit db8cf75077

View file

@ -128,21 +128,21 @@ wait_backend
# First go down in structure and show config # First go down in structure and show config
new "show top tree" new "show top tree"
expectpart "$(echo "show config xml" | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>$' expectpart "$(echo "show config xml" | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>'
cat <<EOF > $fin cat <<EOF > $fin
up up
show config xml show config xml
EOF EOF
new "up show" new "up show"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>$' expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>'
cat <<EOF > $fin cat <<EOF > $fin
edit table edit table
show config xml show config xml
EOF EOF
new "edit table; show" new "edit table; show"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 "/clixon-example:table>" "<parameter><name>a</name><value>42</value></parameter>$" --not-- '<table xmlns="urn:example:clixon">' expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 "/clixon-example:table>" "<parameter><name>a</name><value>42</value></parameter>" --not-- '<table xmlns="urn:example:clixon">'
cat <<EOF > $fin cat <<EOF > $fin
edit table parameter a edit table parameter a
@ -186,7 +186,7 @@ top
show config xml show config xml
EOF EOF
new "edit table parameter a value 42; top; show" new "edit table parameter a value 42; top; show"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>$' expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>'
cat <<EOF > $fin cat <<EOF > $fin
edit table parameter a edit table parameter a
@ -194,7 +194,7 @@ top
show config xml show config xml
EOF EOF
new "edit table parameter a; top; show" new "edit table parameter a; top; show"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>$' expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>'
# edit -> up # edit -> up
@ -204,7 +204,7 @@ up
show config xml show config xml
EOF EOF
new "edit table; up; show" new "edit table; up; show"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>$' expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>'
if $LEAFMODE; then if $LEAFMODE; then
cat <<EOF > $fin cat <<EOF > $fin
@ -223,7 +223,7 @@ up
show config xml show config xml
EOF EOF
new "edit table parameter a; up up; show" new "edit table parameter a; up up; show"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>$' expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>'
cat <<EOF > $fin cat <<EOF > $fin
edit table parameter a edit table parameter a
@ -275,7 +275,7 @@ up
show config xml show config xml
EOF EOF
new "delete parameter b" new "delete parameter b"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>$' expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 '<table xmlns="urn:example:clixon"><parameter><name>a</name><value>42</value></parameter></table>'
# Back to startup # Back to startup
# show state # show state
@ -285,7 +285,7 @@ edit table
show state show state
EOF EOF
new "show state" new "show state"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 "<parameter><name>a</name><value>42</value><stat>99</stat></parameter>$" expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 "<parameter><name>a</name><value>42</value><stat>99</stat></parameter>"
# Show other formats # Show other formats
cat <<EOF > $fin cat <<EOF > $fin
@ -314,7 +314,7 @@ edit table
show config netconf show config netconf
EOF EOF
new "show config netconf" new "show config netconf"
expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><parameter><name>a</name><value>42</value></parameter></config></edit-config></rpc>]]>]]>" expectpart "$(cat $fin | $clixon_cli -f $cfg 2>&1)" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><parameter><name>a</name><value>42</value></parameter>" "</config></edit-config></rpc>]]>]]>"
# Negative test # Negative test
new "config parameter only expect fail" new "config parameter only expect fail"