diff --git a/test/test_http_data.sh b/test/test_http_data.sh index b8a9d6ea..58309359 100755 --- a/test/test_http_data.sh +++ b/test/test_http_data.sh @@ -190,7 +190,7 @@ EOF new "wait restconf" wait_restconf $proto - echo "curl $CURLOPTS -X GET -H 'Accept: text/html' $proto://localhost/data/index.html" +# echo "curl $CURLOPTS -X GET -H 'Accept: text/html' $proto://localhost/data/index.html" if ! $enable; then # XXX or bad request? diff --git a/test/test_restconf.sh b/test/test_restconf.sh index 134673c0..e1f8b22f 100755 --- a/test/test_restconf.sh +++ b/test/test_restconf.sh @@ -221,8 +221,8 @@ function testrun() HVER=2 new "wait restconf" - wait_restconf https - + wait_restconf + new "restconf root discovery. RFC 8040 3.1 (xml+xrd)" echo "curl $CURLOPTS -X GET $proto://$addr/.well-known/host-meta" expectpart "$(curl $CURLOPTS -X GET $proto://$addr/.well-known/host-meta)" 0 "HTTP/$HVER 200" "" "" "" diff --git a/test/test_restconf_callhome.sh b/test/test_restconf_callhome.sh index 88a471b0..55866fec 100755 --- a/test/test_restconf_callhome.sh +++ b/test/test_restconf_callhome.sh @@ -26,16 +26,9 @@ if ! ${HAVE_HTTP1}; then rm -rf $dir if [ "$s" = $0 ]; then exit 0; else return 0; fi fi -# Callhome stream is HTTP/1.1, other communication is HTTP/2 + +# Callhome stream pin to HTTP/1.1, other communication is HTTP/2 if present HVERCH=1.1 -if [ ${HAVE_LIBNGHTTP2} = true ]; then - # Pin to http/1 - HAVE_LIBNGHTTP2=false - CURLOPTS="${CURLOPTS} --http1.1" - HVER=2 -else - HVER=1.1 -fi : ${clixon_restconf_callhome_client:=clixon_restconf_callhome_client} @@ -305,7 +298,6 @@ fi new "wait restconf" wait_restconf - new "restconf Add init data" expectpart "$(curl $CURLOPTS --key $certdir/andy.key --cert $certdir/andy.crt -X POST -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -d '{"clixon-example:table":{"parameter":{"name":"x","value":"foo"}}}' $RCPROTO://127.0.0.1/restconf/data)" 0 "HTTP/$HVER 201" @@ -316,7 +308,7 @@ t1=$(date +"%s") let t=t1-t0 new "Check persistent interval ($t) is in interval [2,4]" -if [ $t -lt 2 -o $t -ge 4 ]; then +if [ $t -lt 2 -o $t -gt 4 ]; then err1 "timer in interval [2,4] but is: $t" fi @@ -327,7 +319,7 @@ t1=$(date +"%s") let t=t1-t0 new "Check periodic interval ($t) is in interval [10-21]" -if [ $t -lt 10 -o $t -ge 21 ]; then +if [ $t -lt 10 -o $t -gt 21 ]; then err1 "timer in interval [10-21] but is: $t" fi @@ -338,7 +330,7 @@ t1=$(date +"%s") let t=t1-t0 new "Check persistent interval ($t) is in interval [2,4]" -if [ $t -lt 2 -o $t -ge 4 ]; then +if [ $t -lt 2 -o $t -gt 4 ]; then err1 "timer in interval [2,4] but is: $t" fi @@ -349,7 +341,7 @@ t1=$(date +"%s") let t=t1-t0 new "Check periodic interval ($t) is in interval [5-15]" -if [ $t -lt 5 -o $t -ge 15 ]; then +if [ $t -lt 5 -o $t -gt 15 ]; then err1 "timer in interval [5-15] but is: $t" fi diff --git a/test/test_restconf_ssl_certs.sh b/test/test_restconf_ssl_certs.sh index fdc1efee..076f4144 100755 --- a/test/test_restconf_ssl_certs.sh +++ b/test/test_restconf_ssl_certs.sh @@ -44,9 +44,6 @@ x3users="mymd5" # Too weak ca # Whether to generate new keys or not (only if $dir is not removed) # Here dont generate keys if restconf started stand-alone (RC=0) : ${genkeys:=true} -#if [ $RC -eq 0 ]; then -# genkeys=false -#fi test -d $certdir || mkdir $certdir @@ -254,8 +251,13 @@ EOF start_restconf -f $cfg fi + # Note, the root resource is accessed by wait_restconf to detect liveness. + # The root resource is not a protected resource in clixon (see RFC8040 sec 2.5) + # therefore the client cert is not necessary + # wait_restconf # --key $certdir/andy.key --cert $certdir/andy.crt + # (should it be?) new "wait for restconf" - wait_restconf --key $certdir/andy.key --cert $certdir/andy.crt + wait_restconf new "enable nacm" expectpart "$(curl $CURLOPTS --key $certdir/andy.key --cert $certdir/andy.crt -X PUT -H "Content-Type: application/yang-data+json" -d '{"ietf-netconf-acm:enable-nacm": true}' $RCPROTO://localhost/restconf/data/ietf-netconf-acm:nacm/enable-nacm)" 0 "HTTP/$HVER 204"