test yangmodels typo

This commit is contained in:
Olof Hagsand 2021-02-22 20:46:19 +00:00
parent 3d07db24d9
commit 187da4dc47
5 changed files with 21 additions and 50 deletions

View file

@ -39,12 +39,12 @@ ssh -t $h "(cd /tmp; chmod 750 $SCRIPTS)"
# pull git changes and build cligen
ssh -t $h "test -d src || mkdir src"
ssh -t $h "test -d src/cligen || (cd src;git clone https://github.com/clicon/cligen.git)"
ssh -t $h "(cd src/cligen;git pull)"
ssh -t $h "(cd src/cligen;git pull origin master)"
ssh -t $h "(cd src/cligen;./configure)"
ssh -t $h "(cd src/cligen; /tmp/cligen-mk.sh)"
# pull git changes and build clixon
ssh -t $h "test -d src/clixon || (cd src;git clone https://github.com/clicon/clixon.git)"
ssh -t $h "(cd src/clixon;git pull)"
ssh -t $h "(cd src/clixon;git pull origin master)"
ssh -t $h "(cd src/clixon; /tmp/clixon-config.sh $restconf)"
ssh -t $h "(cd src/clixon; /tmp/clixon-mk.sh)"
ssh -t $h sudo ldconfig

View file

@ -30,9 +30,10 @@ if [ "${WITH_RESTCONF}" != "fcgi" -o "$RCPROTO" = https ]; then
if [ "$s" = $0 ]; then exit 0; else return 0; fi # skip
fi
SLEEP2=1
SLEEP5=.5
APPNAME=example
: ${clixon_util_stream:=clixon_util_stream}
NCWAIT=10 # Wait (netconf valgrind may need more time)
# Ensure UTC
DATE=$(date -u +"%Y-%m-%d")
@ -152,11 +153,11 @@ new "2. Restconf RFC8040 stream testing"
new "restconf event stream discovery RFC8040 Sec 6.2"
expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-restconf-monitoring:restconf-state/streams)" 0 "HTTP/1.1 200 OK" '{"ietf-restconf-monitoring:streams":{"stream":\[{"name":"EXAMPLE","description":"Example event stream","replay-support":true,"access":\[{"encoding":"xml","location":"https://localhost/streams/EXAMPLE"}\]}\]}'
sleep 1
sleep $SLEEP2
new "restconf subscribe RFC8040 Sec 6.3, get location"
expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/ietf-restconf-monitoring:restconf-state/streams/stream=EXAMPLE/access=xml/location)" 0 "HTTP/1.1 200 OK" '{"ietf-restconf-monitoring:location":"https://localhost/streams/EXAMPLE"}'
sleep 1
sleep $SLEEP2
# Restconf stream subscription RFC8040 Sec 6.3
# Start Subscription w error
new "restconf monitor event nonexist stream"
@ -178,7 +179,7 @@ if [ $nr -lt 1 -o $nr -gt 2 ]; then
err 2 "$nr"
fi
sleep 1
sleep $SLEEP2
# 2b) start subscription 8s - stoptime after 5s - expect 1-2 notifications
new "2b) start subscriptions 8s - stoptime after 5s - expect 1-2 notifications"
@ -193,7 +194,7 @@ if [ $nr -lt 1 -o $nr -gt 2 ]; then
err 1 "$nr"
fi
sleep 1
sleep $SLEEP2
# 2c
new "2c) start sub 8s - replay from start -8s - expect 3-4 notifications"
@ -208,7 +209,7 @@ nr=$(echo "$ret" | grep -c "data:")
if [ $nr -lt 3 ]; then
err 4 "$nr"
fi
sleep 1
sleep $SLEEP2
# 2d) start sub 8s - replay from start -8s to stop +4s - expect 3 notifications
new "2d) start sub 8s - replay from start -8s to stop +4s - expect 3 notifications"
@ -224,12 +225,14 @@ if [ $nr -lt 4 ]; then
err 6 "$nr"
fi
sleep 1
sleep $SLEEP2
# 2e) start sub 8s - replay from -90s w retention 60s - expect 9-14 notifications
new "2e) start sub 8s - replay from -90s w retention 60s - expect 10 notifications"
echo "$clixon_util_stream -u $RCPROTO://localhost/streams/EXAMPLE -t 10 -s -90 -e +0"
ret=$($clixon_util_stream -u $RCPROTO://localhost/streams/EXAMPLE -t 10 -s -90 -e +0)
expect="data: <notification xmlns=\"urn:ietf:params:xml:ns:netconf:notification:1.0\"><eventTime>${DATE}T[0-9:.]*Z</eventTime><event xmlns=\"urn:example:clixon\"><event-class>fault</event-class><reportingEntity><card>Ethernet0</card></reportingEntity><severity>major</severity></event>"
match=$(echo "$ret" | grep -Eo "$expect")
if [ -z "$match" ]; then
err "$expect" "$ret"
@ -240,7 +243,7 @@ if [ $nr -lt 8 -o $nr -gt 14 ]; then
err "8-14" "$nr"
fi
sleep 1
sleep $SLEEP2
# Try parallell
# start background job
@ -269,7 +272,7 @@ echo "Add <CLICON_STREAM_PUB>http://localhost/pub</CLICON_STREAM_PUB> to config"
echo "Eg: curl $CURLOPTS -H \"Accept: text/event-stream\" -s -X GET $RCPROTO://localhost/sub/EXAMPLE"
#-----------------
sleep 5
sleep $SLEEP5
if [ $RC -ne 0 ]; then
new "Kill restconf daemon"
stop_restconf
@ -286,11 +289,14 @@ if [ $BE -ne 0 ]; then
stop_backend -f $cfg
fi
rm -rf $dir
# Set by restconf_config
unset RESTCONFIG
# unset conditional parameters
unset clixon_util_stream
unset nr
new "Endtest"
endtest
rm -rf $dir

View file

@ -217,10 +217,10 @@ EOF
expectpart "$(curl $CURLOPTS --key $certdir/yyy.key --cert $certdir/yyy.crt -X GET $RCPROTO://localhost/restconf/data/example:x 2>&1)" 58 " could not load PEM client certificate"
new "Certificate required"
expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example:x 2>&1)" "55 56"
expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example:x 2>&1)" "35 55 56"
new "limited invalid cert"
expectpart "$(curl $CURLOPTS --key $certdir/limited.key --cert $certdir/limited.crt -X GET $RCPROTO://localhost/restconf/data/example:x 2>&1)" "55 56" # 55 "certificate expired"
expectpart "$(curl $CURLOPTS --key $certdir/limited.key --cert $certdir/limited.crt -X GET $RCPROTO://localhost/restconf/data/example:x 2>&1)" "35 55 56" # 55 "certificate expired"
if [ $RC -ne 0 ]; then
new "Kill restconf daemon"

View file

@ -74,20 +74,3 @@ expectpart "$($clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/s
rm -rf $dir
exit 0
# Diff to make it work
diff --git a/standard/ieee/published/802.3/ieee802-ethernet-pon.yang b/standard/ieee/published/802.3/ieee802-ethernet-pon.yang
index 37c54c2a..a56b5f50 100755
--- a/standard/ieee/published/802.3/ieee802-ethernet-pon.yang
+++ b/standard/ieee/published/802.3/ieee802-ethernet-pon.yang
@@ -2421,7 +2421,7 @@ module ieee802-ethernet-pon {
}
leaf mpcp-maximum-queue-count-per-report {
- when "../ompe-mode = olt'";
+ when "../ompe-mode = 'olt'";^M
type mpcp-maximum-queue-count-per-report;
config false;

View file

@ -45,21 +45,3 @@ echo "$clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/
expectpart "$($clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=$YANGMODELS/standard/ietf/RFC show version)" 0 "$version."
rm -rf $dir
exit 0
# Diff to make it work
diff --git a/standard/ietf/RFC/ietf-mud@2019-01-28.yang b/standard/ietf/RFC/ietf-mud@2019-01-28.yang
index 1842284e..4197ad46 100644
--- a/standard/ietf/RFC/ietf-mud@2019-01-28.yang
+++ b/standard/ietf/RFC/ietf-mud@2019-01-28.yang
@@ -297,7 +297,7 @@ module ietf-mud {
}
}
augment "/acl:acls/acl:acl/acl:aces/acl:ace/acl:matches"
- + "/acl:l4/acl:tcp/acl:tcp" {
+ + "/acl:l4/acl:tcp" { /* Olof: rm extra /acl:tcp */
description
"add direction-initiated";
leaf direction-initiated {