diff --git a/test/cicd/cicd.sh b/test/cicd/cicd.sh index ea3ecc00..61b7cade 100755 --- a/test/cicd/cicd.sh +++ b/test/cicd/cicd.sh @@ -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 diff --git a/test/test_restconf_notifications.sh b/test/test_restconf_notifications.sh index f821795c..2ed86f0e 100755 --- a/test/test_restconf_notifications.sh +++ b/test/test_restconf_notifications.sh @@ -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: ${DATE}T[0-9:.]*ZfaultEthernet0major" + 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 http://localhost/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 diff --git a/test/test_restconf_ssl_certs.sh b/test/test_restconf_ssl_certs.sh index 76812138..db12737f 100755 --- a/test/test_restconf_ssl_certs.sh +++ b/test/test_restconf_ssl_certs.sh @@ -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" diff --git a/test/test_yang_models_ieee.sh b/test/test_yang_models_ieee.sh index 11533479..a352699d 100755 --- a/test/test_yang_models_ieee.sh +++ b/test/test_yang_models_ieee.sh @@ -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; diff --git a/test/test_yang_models_ietf.sh b/test/test_yang_models_ietf.sh index 81015141..129232f1 100755 --- a/test/test_yang_models_ietf.sh +++ b/test/test_yang_models_ietf.sh @@ -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 {