Extended util/clixon_util_xml with yang and validate functionality so it can be used as a stand-alone utility for validating XML/JSON files
This commit is contained in:
parent
ee863e5dbd
commit
519fac186c
8 changed files with 172 additions and 36 deletions
|
|
@ -2,6 +2,9 @@
|
|||
# Run, eg as:
|
||||
# ./all.sh 2>&1 | tee test.log # break on first test
|
||||
|
||||
# Pattern to run tests, default is all, but you may want to narrow it down
|
||||
: ${pattern:=test_*.sh}
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
echo "usage: $0 # detailed logs and stopon first error"
|
||||
exit -1
|
||||
|
|
@ -9,10 +12,10 @@ fi
|
|||
|
||||
err=0
|
||||
testnr=0
|
||||
for test in test_*.sh; do
|
||||
for test in $pattern; do
|
||||
if [ $testnr != 0 ]; then echo; fi
|
||||
testfile=$test
|
||||
. ./$test
|
||||
ret=$(./$test) # . ./$test
|
||||
errcode=$?
|
||||
if [ $errcode -ne 0 ]; then
|
||||
err=1
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# Run valgrind leak test for cli, restconf, netconf or background.
|
||||
# Stop on first error
|
||||
|
||||
# Pattern to run tests
|
||||
# Pattern to run tests, default is all, but you may want to narrow it down
|
||||
: ${pattern:=test_*.sh}
|
||||
|
||||
# Run valgrindtest once, args:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
# Magic line must be first in script (see README.md)
|
||||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
||||
|
||||
: ${clixon_util_xml:=clixon_util_xml}
|
||||
: ${clixon_util_xml:=clixon_util_xml -o} # -o is output
|
||||
|
||||
new "xml parse"
|
||||
expecteof "$clixon_util_xml" 0 "<a><b/></a>" "^<a><b/></a>$"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue