* Yang parser is stricter (see cardinality below) which may break parsing of slack yang specs.
* YANG parser cardinality checked (only modules level yet) * See https://github.com/clicon/clixon/issues/48
This commit is contained in:
parent
9c57902b96
commit
a8f0aad411
28 changed files with 159 additions and 47 deletions
|
|
@ -1,41 +1,26 @@
|
|||
#!/bin/bash
|
||||
# Test: YANG parser tests
|
||||
# First an example yang, second all openconfig yangs
|
||||
# Problem with this is that util only parses single file. it should
|
||||
# call yang_parse().
|
||||
#PROG="valgrind --leak-check=full --show-leak-kinds=all ../util/clixon_util_yang"
|
||||
PROG=../util/clixon_util_yang
|
||||
OPENCONFIG=~/syssrc/openconfig
|
||||
|
||||
exit 0 # nyi
|
||||
# include err() and new() functions and creates $dir
|
||||
. ./lib.sh
|
||||
|
||||
YANG=$(cat <<EOF
|
||||
module test{
|
||||
prefix ex;
|
||||
extension c-define {
|
||||
description "Example from RFC 6020";
|
||||
argument "name";
|
||||
}
|
||||
ex:not-defined ARGUMENT;
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
new "yang parse"
|
||||
#expecteof "$PROG" 0 "$YANG" "^$YANG$"
|
||||
|
||||
if [ ! -d $OPENCONFIG ]; then
|
||||
echo "$OPENCONFIG not found. Do git clone https://github.com/openconfig/public and point DIR to it to run these tests"
|
||||
rm -rf $dir
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Openconfig
|
||||
# Files not parseable:
|
||||
# - openconfig-access-points.yang
|
||||
# - openconfig-access-points.yang
|
||||
new "Openconfig"
|
||||
files=$(find $OPENCONFIG -name "*.yang")
|
||||
for f in $files; do
|
||||
new "$f"
|
||||
YANG=$(cat $f)
|
||||
# expecteof "$PROG" 0 "$YANG" "module"
|
||||
# NYI
|
||||
expecteof "$PROG" 0 "$YANG" "module"
|
||||
done
|
||||
rm -rf $dir
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue