upgrade example and test

This commit is contained in:
Olof hagsand 2019-03-27 18:04:01 +01:00
parent 4902f7cf1d
commit be59bd48d8
7 changed files with 88 additions and 103 deletions

View file

@ -1,5 +1,21 @@
#!/bin/bash
# Yang features. if-feature. and schema resources according to RFC7895
# Yang features. if-feature.
# The test has a example module with FEATURES A and B, where A is enabled and
# B is disabled.
# It also uses an ietf-router module where (only) router-id is enabled
# Also check modules-state (RFC7895) announces the enabled features.
#
# From RFC7950:
# 7.20.1 Schema nodes tagged with an "if-feature" statement are _ignored_ by
# the server unless the server supports the given feature expression.
# 8.1: There MUST be no nodes tagged with "if-feature" present if the
# "if-feature" expression evaluates to "false" in the server.
# - Should the server just "ignore" these nodes or actively reject them?
#
# Clixon has a strict implementation of the features so that setting
# data with disabled features is same as if they are not present in the Yang.
# Which means no cli syntax or edit operations were syntactically allowed
# (and therefore invalid).
# Magic line must be first in script (see README.md)
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
@ -31,7 +47,7 @@ cat <<EOF > $cfg
EOF
cat <<EOF > $fyang
module $APPNAME{
module example{
yang-version 1.1;
namespace "urn:example:clixon";
prefix ex;
@ -44,9 +60,6 @@ module $APPNAME{
feature B{
description "This test feature is disabled";
}
feature C{
description "This test feature is disabled";
}
leaf x{
if-feature A;
type "string";

View file

@ -270,7 +270,7 @@ cat <<EOF > $cfg
<clixon-config xmlns="http://clicon.org/config">
<CLICON_CONFIGFILE>$cfg</CLICON_CONFIGFILE>
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
<CLICON_FEATURE>*:*</CLICON_FEATURE>
<CLICON_FEATURE>interfaces:if-mib</CLICON_FEATURE>
<CLICON_YANG_MAIN_DIR>$dir</CLICON_YANG_MAIN_DIR>
<CLICON_SOCK>/usr/local/var/$APPNAME/$APPNAME.sock</CLICON_SOCK>
<CLICON_BACKEND_DIR>/usr/local/lib/example/backend</CLICON_BACKEND_DIR>