diff --git a/test/test_netconf_monitoring.sh b/test/test_netconf_monitoring.sh index e3ffb7bc..186fc57e 100755 --- a/test/test_netconf_monitoring.sh +++ b/test/test_netconf_monitoring.sh @@ -3,6 +3,7 @@ # See eg Examples: # 4.1. Retrieving Schema List via Operation # 4.2. Retrieving Schema Instances +# Also: loop over all installed yang files and compare with get-schema # Magic line must be first in script (see README.md) s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi @@ -15,6 +16,7 @@ fyang=$dir/clixon-example@2022-01-01.yang cat < $cfg $cfg + ${YANG_INSTALLDIR} $fyang false @@ -98,6 +100,47 @@ if [ $BE -ne 0 ]; then stop_backend -f $cfg fi +YANGDIR=$YANG_INSTALLDIR + +if [ $BE -ne 0 ]; then + new "start backend -s init -f $cfg -o CLICON_YANG_MAIN_DIR=$YANGDIR" + start_backend -s init -f $cfg -o CLICON_YANG_MAIN_DIR=$YANGDIR +fi +new "wait backend" +wait_backend + +new "Loop over all yangs in $YANGDIR" + +for f in ${YANGDIR}/*.yang; do + b=$(basename $f) + id=$(echo "$b" | sed 's/.yang//' | sed 's/@.*//') + version=$(echo "$b" | sed 's/.yang//' | sed 's/.*@//') + $clixon_netconf -qf $cfg < $dir/ex.yang +$HELLONO11 + + + $id + $version + yang + +]]>]]> +EOF + grep "" $dir/ex.yang > /dev/null + if [ $? -eq 0 ]; then + continue + fi + # Mask netconf header and footer + sed -i -e "s///" -e 's/<\/data><\/rpc-reply>]]>]]>//' /var/tmp/test_netconf_monitoring.sh/ex.yang + # Decode XML + sed -i -e 's/>/>/g' -e 's/</