From 9edf380f6acd5f97d3169b20dce22405dc44c476 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Fri, 18 Jun 2021 12:18:33 +0200 Subject: [PATCH] - Link utils statically if LINKAGE=static - Fix event exit bug (set to new counter, dont increment) - Changed default CI to be restconf=native instead of fcgi1~ - Tests: - Change to same wait backend and restconf commands - Change default restconf protocol from http to https --- apps/restconf/restconf_main_native.c | 6 ++-- apps/restconf/restconf_nghttp2.c | 7 +++- configure | 6 ++-- configure.ac | 4 +-- docker/main/Dockerfile.native | 2 +- docker/main/startsystem_native.sh | 1 - lib/src/clixon_event.c | 2 +- test/lib.sh | 15 ++++++--- test/test_api.sh | 6 ++-- test/test_cli_apipath.sh | 6 ++-- test/test_cli_auto.sh | 6 ++-- test/test_cli_auto_extension.sh | 6 ++-- test/test_cli_auto_genmodel.sh | 6 ++-- test/test_cli_auto_sub.sh | 6 ++-- test/test_cli_history.sh | 6 ++-- test/test_cli_multikey.sh | 6 ++-- test/test_cli_submodes.sh | 5 ++- test/test_cli_translate.sh | 6 ++-- test/test_client.sh | 6 ++-- test/test_copy_config.sh | 12 +++---- test/test_datastore_repair.sh | 6 ++-- test/test_feature.sh | 6 ++-- test/test_identity.sh | 6 ++-- test/test_leaf_default.sh | 24 +++++++------- test/test_leafref.sh | 6 ++-- test/test_leafref_augment.sh | 6 ++-- test/test_leafref_state.sh | 5 +-- test/test_minmax.sh | 6 ++-- test/test_nacm.sh | 6 ++-- test/test_nacm_datanode.sh | 6 ++-- test/test_nacm_datanode_paths.sh | 6 ++-- test/test_nacm_datanode_read.sh | 6 ++-- test/test_nacm_datanode_write.sh | 6 ++-- test/test_nacm_default.sh | 5 ++- test/test_nacm_ext.sh | 6 ++-- test/test_nacm_module_read.sh | 6 ++-- test/test_nacm_module_write.sh | 2 +- test/test_nacm_protocol.sh | 6 ++-- test/test_nacm_recovery.sh | 13 ++++---- test/test_netconf.sh | 6 ++-- test/test_netconf_hello.sh | 6 ++-- test/test_netconf_ssh_callhome.sh | 6 ++-- test/test_order.sh | 6 ++-- test/test_pattern.sh | 6 ++-- test/test_perf_restconf.sh | 2 +- test/test_perf_state_only.sh | 12 +++---- test/test_restconf_internal.sh | 6 ++-- test/test_restconf_netns.sh | 10 +++--- test/test_restconf_notifications.sh | 6 ++-- test/test_restconf_op.sh | 6 ++-- test/test_rpc.sh | 6 ++-- test/test_sock.sh | 6 ++-- test/test_submodule.sh | 6 ++-- test/test_transaction.sh | 6 ++-- test/test_transaction_restart.sh | 6 ++-- test/test_type.sh | 6 ++-- test/test_type_range.sh | 6 ++-- test/test_union.sh | 6 ++-- test/test_unique.sh | 6 ++-- test/test_upgrade_module.sh | 6 ++-- test/test_upgrade_simple.sh | 6 ++-- test/test_when_must.sh | 6 ++-- test/test_with_default.sh | 6 ++-- test/test_xpath_functions.sh | 6 ++-- test/test_yang.sh | 6 ++-- test/test_yang_extension.sh | 6 ++-- test/test_yang_load.sh | 49 ++++++++++++++-------------- test/test_yang_namespace.sh | 11 ++++--- util/Makefile.in | 19 ++++++++--- util/README.md | 2 ++ 70 files changed, 264 insertions(+), 238 deletions(-) diff --git a/apps/restconf/restconf_main_native.c b/apps/restconf/restconf_main_native.c index a4594639..61e27897 100644 --- a/apps/restconf/restconf_main_native.c +++ b/apps/restconf/restconf_main_native.c @@ -858,7 +858,7 @@ restconf_connection(int s, * frames instead of just postponing nrof events? */ if (clixon_exit_get() == 1){ - clixon_exit_set(4); + clixon_exit_set(3); } } #endif @@ -868,7 +868,9 @@ restconf_connection(int s, case HTTP_2: if (http2_recv(rc, (unsigned char *)buf, n) < 0) goto done; - // notused sd = restconf_stream_find(rc, 0); /* default stream */ + //notused sd = restconf_stream_find(rc, 0); /* default stream */ + /* There may be more data frames */ + readmore++; break; #endif /* HAVE_LIBNGHTTP2 */ default: diff --git a/apps/restconf/restconf_nghttp2.c b/apps/restconf/restconf_nghttp2.c index 4c296489..d990b592 100644 --- a/apps/restconf/restconf_nghttp2.c +++ b/apps/restconf/restconf_nghttp2.c @@ -543,6 +543,11 @@ on_invalid_frame_recv_callback(nghttp2_session *session, } /*! A chunk of data in DATA frame is received + * + * ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not + * necessarily mean this chunk of data is the last one in the stream. + * You should use :type:`nghttp2_on_frame_recv_callback` to know all + * data frames are received. */ static int on_data_chunk_recv_callback(nghttp2_session *session, @@ -835,7 +840,7 @@ error_callback2(nghttp2_session *session, * XXX see session_recv */ int -http2_recv(restconf_conn *rc, +http2_recv(restconf_conn *rc, const unsigned char *buf, size_t n) { diff --git a/configure b/configure index 95b77bdb..8b5469cc 100755 --- a/configure +++ b/configure @@ -1371,8 +1371,8 @@ Optional Features: curl --disable-evhtp Disable evhtp for native restconf http/1, default: yes - --enable-nghttp2 Enable nghttp2 for native restconf http/2, default: - no + --disable-nghttp2 Disable nghttp2 for native restconf http/2, default: + yes Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -5300,7 +5300,7 @@ if test "${enable_nghttp2+set}" = set; then : fi else - ac_enable_nghttp2=no + ac_enable_nghttp2=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking nghttp2 is enabled: $ac_enable_nghttp2" >&5 diff --git a/configure.ac b/configure.ac index df126452..16f0743f 100644 --- a/configure.ac +++ b/configure.ac @@ -244,14 +244,14 @@ elif test "x${with_restconf}" == xnative; then fi # Check if nghttp2 is enabled for http/2 - AC_ARG_ENABLE(nghttp2, AS_HELP_STRING([--enable-nghttp2],[Enable nghttp2 for native restconf http/2, default: no]),[ + AC_ARG_ENABLE(nghttp2, AS_HELP_STRING([--disable-nghttp2],[Disable nghttp2 for native restconf http/2, default: yes]),[ if test "$enableval" = no; then ac_enable_nghttp2=no else ac_enable_nghttp2=yes fi ], - [ ac_enable_nghttp2=no]) + [ ac_enable_nghttp2=yes]) AC_MSG_RESULT(checking nghttp2 is enabled: $ac_enable_nghttp2) if test "$ac_enable_nghttp2" = "yes"; then AC_CHECK_HEADERS(nghttp2/nghttp2.h,[], AC_MSG_ERROR([nghttp2 missing])) diff --git a/docker/main/Dockerfile.native b/docker/main/Dockerfile.native index 44a013ee..f8f1344a 100644 --- a/docker/main/Dockerfile.native +++ b/docker/main/Dockerfile.native @@ -77,7 +77,7 @@ COPY clixon . RUN adduser -D -H -G www-data www-data # Configure, build and install clixon -RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --enable-optyangs --with-restconf=native --disable-nghttp2 --enable-evhtp +RUN ./configure --prefix=/clixon/build --with-cligen=/clixon/build --enable-optyangs --with-restconf=native --enable-nghttp2 --enable-evhtp RUN make RUN make install diff --git a/docker/main/startsystem_native.sh b/docker/main/startsystem_native.sh index 2975880f..2370e09e 100755 --- a/docker/main/startsystem_native.sh +++ b/docker/main/startsystem_native.sh @@ -59,7 +59,6 @@ echo "$STORE" > /usr/local/var/example/running_db cat < /usr/local/bin/test/site.sh # Add your local site specific env variables (or tests) here. SKIPLIST="test_api.sh test_client.sh test_c++.sh test_install.sh test_privileges.sh" -RCPROTO=https #IETFRFC= EOF diff --git a/lib/src/clixon_event.c b/lib/src/clixon_event.c index 0d61cc47..736c7541 100644 --- a/lib/src/clixon_event.c +++ b/lib/src/clixon_event.c @@ -112,7 +112,7 @@ static int _clicon_sig_ignore = 0; int clixon_exit_set(int nr) { - _clicon_exit++; + _clicon_exit = nr; return 0; } diff --git a/test/lib.sh b/test/lib.sh index 60ba56c8..a2c35fc8 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -127,7 +127,7 @@ DEMSLEEP=.2 let DEMLOOP=5*DEMWAIT # RESTCONF protocol, eg http or https -: ${RCPROTO:=http} +: ${RCPROTO:=https} # www user (on linux typically www-data, freebsd www) # Start restconf user, can be root which is dropped to wwwuser @@ -381,9 +381,16 @@ function stop_restconf(){ # @see start_restconf # Reasons for not working: if you run native is nginx running? # @note assumes port=80 if RCPROTO=http and port=443 if RCPROTO=https +# Args: +# 1: (optional) override RCPROTO with http or https function wait_restconf(){ -# echo "curl $CURLOPTS $* $RCPROTO://localhost/restconf" - hdr=$(curl $CURLOPTS $* $RCPROTO://localhost/restconf 2> /dev/null) + if [ $# = 1 ]; then + myproto=$1 + else + myproto=${RCPROTO} + fi +# echo "curl $CURLOPTS $* $myproto://localhost/restconf" + hdr=$(curl $CURLOPTS $* $myproto://localhost/restconf 2> /dev/null) # echo "hdr:\"$hdr\"" let i=0; while [[ $hdr != *"200"* ]]; do @@ -392,7 +399,7 @@ function wait_restconf(){ err1 "restconf timeout $DEMWAIT seconds" fi sleep $DEMSLEEP - hdr=$(curl $CURLOPTS $* $RCPROTO://localhost/restconf 2> /dev/null) + hdr=$(curl $CURLOPTS $* $myproto://localhost/restconf 2> /dev/null) # echo "hdr:\"$hdr\"" let i++; done diff --git a/test/test_api.sh b/test/test_api.sh index d1cde5b8..9fc7a665 100755 --- a/test/test_api.sh +++ b/test/test_api.sh @@ -238,11 +238,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + XML='235zorro7' # Add a set of entries using restconf diff --git a/test/test_cli_apipath.sh b/test/test_cli_apipath.sh index 8699224a..4bab06a8 100755 --- a/test/test_cli_apipath.sh +++ b/test/test_cli_apipath.sh @@ -87,11 +87,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # Positive tests new "set x" expectpart "$($clixon_cli -1 -f $cfg set x)" 0 "" diff --git a/test/test_cli_auto.sh b/test/test_cli_auto.sh index 27f52fdf..228fa5a8 100755 --- a/test/test_cli_auto.sh +++ b/test/test_cli_auto.sh @@ -93,11 +93,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s startup -f $cfg -- -sS $fstate" start_backend -s startup -f $cfg -- -sS $fstate - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # First go down in structure and show config new "show top tree" expectpart "$(echo "show config xml" | $clixon_cli -f $cfg 2>&1)" 0 'a42
$' diff --git a/test/test_cli_auto_extension.sh b/test/test_cli_auto_extension.sh index 08b0d62b..412cb873 100755 --- a/test/test_cli_auto_extension.sh +++ b/test/test_cli_auto_extension.sh @@ -129,11 +129,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + function testparam() { diff --git a/test/test_cli_auto_genmodel.sh b/test/test_cli_auto_genmodel.sh index ef886f98..9f77fe47 100755 --- a/test/test_cli_auto_genmodel.sh +++ b/test/test_cli_auto_genmodel.sh @@ -109,11 +109,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg -- -sS $fstate" start_backend -s init -f $cfg -- -sS $fstate - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # Simple run trying setting a config, # then deleting it, and reloading it # 1. mode - either VARS Keywords on non-key variables: a y or diff --git a/test/test_cli_auto_sub.sh b/test/test_cli_auto_sub.sh index 32ca8817..9253e670 100755 --- a/test/test_cli_auto_sub.sh +++ b/test/test_cli_auto_sub.sh @@ -123,11 +123,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s startup -f $cfg" start_backend -s startup -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + cat < $fin enter0 p1 # table/parameter=p1 show config xml diff --git a/test/test_cli_history.sh b/test/test_cli_history.sh index da487fa1..d4a756f5 100755 --- a/test/test_cli_history.sh +++ b/test/test_cli_history.sh @@ -46,11 +46,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "cli read and add entry to existing history" expecteof "$clixon_cli -f $cfg" 0 "example 42" "data" diff --git a/test/test_cli_multikey.sh b/test/test_cli_multikey.sh index 9a592b8b..8c3ef23c 100755 --- a/test/test_cli_multikey.sh +++ b/test/test_cli_multikey.sh @@ -77,11 +77,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "set 1 v1" expectpart "$($clixon_cli -1 -f $cfg set ex x a 1 b v1)" 0 "" diff --git a/test/test_cli_submodes.sh b/test/test_cli_submodes.sh index 5811f85f..23dbf0fa 100755 --- a/test/test_cli_submodes.sh +++ b/test/test_cli_submodes.sh @@ -79,11 +79,10 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend m=AAA # Tests using mode AAA that should pass diff --git a/test/test_cli_translate.sh b/test/test_cli_translate.sh index da977c6e..e9fd230e 100755 --- a/test/test_cli_translate.sh +++ b/test/test_cli_translate.sh @@ -56,11 +56,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "translate abc -> table/parameter=translate/value = bcd" expectpart "$($clixon_cli -1 -f $cfg translate abc)" 0 "" diff --git a/test/test_client.sh b/test/test_client.sh index cfcfa4a1..7a13092c 100755 --- a/test/test_client.sh +++ b/test/test_client.sh @@ -137,11 +137,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + XML='a42
' # Add a set of entries using restconf diff --git a/test/test_copy_config.sh b/test/test_copy_config.sh index b6232066..0f3e5135 100755 --- a/test/test_copy_config.sh +++ b/test/test_copy_config.sh @@ -76,22 +76,22 @@ if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "wait backend" - wait_backend fi +new "wait backend" +wait_backend + if [ $RC -ne 0 ]; then new "kill old restconf daemon" stop_restconf_pre new "start restconf daemon" start_restconf -f $cfg - - new "wait restconf" - wait_restconf fi +new "wait restconf" +wait_restconf + new "Add config to candidate" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOeth/0/0ex:ethnone ]]>]]>" "^]]>]]>$" diff --git a/test/test_datastore_repair.sh b/test/test_datastore_repair.sh index dc537e87..4dee548f 100755 --- a/test/test_datastore_repair.sh +++ b/test/test_datastore_repair.sh @@ -93,10 +93,10 @@ function testrun(){ fi new "start backend -s startup -f $cfg -- -U" start_backend -s startup -f $cfg -- -U - - new "waiting" - wait_backend fi + + new "wait backend" + wait_backend new "netconf get config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO]]>]]>" "^$AFTER]]>]]>$" diff --git a/test/test_feature.sh b/test/test_feature.sh index f5e6d036..dfbcd098 100755 --- a/test/test_feature.sh +++ b/test/test_feature.sh @@ -153,11 +153,11 @@ if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "cli enabled feature" expectpart "$($clixon_cli -1f $cfg set x foo)" 0 "" diff --git a/test/test_identity.sh b/test/test_identity.sh index 1c23be90..d520205d 100755 --- a/test/test_identity.sh +++ b/test/test_identity.sh @@ -164,11 +164,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "Set crypto to aes" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOaes]]>]]>" "^]]>]]>$" diff --git a/test/test_leaf_default.sh b/test/test_leaf_default.sh index d28e0dc7..4dbd1032 100755 --- a/test/test_leaf_default.sh +++ b/test/test_leaf_default.sh @@ -118,11 +118,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "get config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO]]>]]>" "^$XML]]>]]>$" @@ -172,11 +172,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s startup -f $cfg" start_backend -s startup -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "get startup config" # Should have all defaults, except r1 that is set to 99 expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO]]>]]>" "^$XML]]>]]>$" @@ -231,11 +231,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s startup -f $cfg" start_backend -s startup -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "get startup config with presence" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO]]>]]>" "^$XML]]>]]>$" @@ -261,11 +261,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s startup -f $cfg" start_backend -s startup -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "get startup config with list default" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO]]>]]>" "^$XMLafalsefalse]]>]]>$" diff --git a/test/test_leafref.sh b/test/test_leafref.sh index 9ac15394..a7a414c3 100755 --- a/test/test_leafref.sh +++ b/test/test_leafref.sh @@ -122,11 +122,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "leafref base config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO$BASEXML]]>]]>" "^]]>]]>$" diff --git a/test/test_leafref_augment.sh b/test/test_leafref_augment.sh index 2a8e3c22..4c4c046a 100755 --- a/test/test_leafref_augment.sh +++ b/test/test_leafref_augment.sh @@ -139,11 +139,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # Test top-level, default prefix, correct leafref and typedef path XML=$(cat < diff --git a/test/test_leafref_state.sh b/test/test_leafref_state.sh index 301580cc..9ed123ad 100755 --- a/test/test_leafref_state.sh +++ b/test/test_leafref_state.sh @@ -82,10 +82,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg -- -sS $fstate" start_backend -s init -f $cfg -- -sS $fstate - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # Test top-level, default prefix, wrong leafref prefix and typedef path XML=$(cat < diff --git a/test/test_minmax.sh b/test/test_minmax.sh index c9aec8b7..87017918 100755 --- a/test/test_minmax.sh +++ b/test/test_minmax.sh @@ -112,11 +112,11 @@ if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" # start new backend start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "minmax: minimal: 1x a1,b1 (should be [1:2]" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOreplace 0 diff --git a/test/test_nacm.sh b/test/test_nacm.sh index 7b2e7460..6ea74780 100755 --- a/test/test_nacm.sh +++ b/test/test_nacm.sh @@ -136,11 +136,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "auth get" expectpart "$(curl -u andy:bar $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/nacm-example:x)" 0 "HTTP/$HVER 404" '{"ietf-restconf:errors":{"error":{"error-type":"application","error-tag":"invalid-value","error-severity":"error","error-message":"Instance does not exist"}}}' diff --git a/test/test_nacm_datanode.sh b/test/test_nacm_datanode.sh index e3df919c..b872b9b9 100755 --- a/test/test_nacm_datanode.sh +++ b/test/test_nacm_datanode.sh @@ -236,11 +236,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_nacm_datanode_paths.sh b/test/test_nacm_datanode_paths.sh index 366947bb..776f660e 100755 --- a/test/test_nacm_datanode_paths.sh +++ b/test/test_nacm_datanode_paths.sh @@ -110,11 +110,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "admin read OK" expectpart "$(curl -u andy:bar $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/nacm-example:table/parameters/parameter=a)" 0 "HTTP/$HVER 200" '{"nacm-example:parameter":\[{"name":"a","value":"72"}\]}' diff --git a/test/test_nacm_datanode_read.sh b/test/test_nacm_datanode_read.sh index b6d534ef..6e047b97 100755 --- a/test/test_nacm_datanode_read.sh +++ b/test/test_nacm_datanode_read.sh @@ -241,11 +241,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_nacm_datanode_write.sh b/test/test_nacm_datanode_write.sh index db211d0f..55fe39c6 100755 --- a/test/test_nacm_datanode_write.sh +++ b/test/test_nacm_datanode_write.sh @@ -237,11 +237,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_nacm_default.sh b/test/test_nacm_default.sh index 7054860e..3609604b 100755 --- a/test/test_nacm_default.sh +++ b/test/test_nacm_default.sh @@ -103,10 +103,8 @@ EOF fi new "start backend -s $db -f $cfg" start_backend -s $db -f $cfg - - new "wait backend" - wait_backend fi + new "wait backend" wait_backend @@ -117,6 +115,7 @@ EOF new "start restconf daemon" start_restconf -f $cfg fi + new "wait restconf" wait_restconf diff --git a/test/test_nacm_ext.sh b/test/test_nacm_ext.sh index 654494ef..156e6cbf 100755 --- a/test/test_nacm_ext.sh +++ b/test/test_nacm_ext.sh @@ -155,11 +155,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "auth get" expectpart "$(curl -u andy:bar $CURLOPTS -X GET $RCPROTO://localhost/restconf/data)" 0 "HTTP/$HVER 200" '{"data":{"clixon-example:state":{"op":\["41","42","43"\]}' diff --git a/test/test_nacm_module_read.sh b/test/test_nacm_module_read.sh index d06a50de..660308c0 100755 --- a/test/test_nacm_module_read.sh +++ b/test/test_nacm_module_read.sh @@ -138,11 +138,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_nacm_module_write.sh b/test/test_nacm_module_write.sh index b41d3dd3..6b1145c1 100755 --- a/test/test_nacm_module_write.sh +++ b/test/test_nacm_module_write.sh @@ -134,7 +134,7 @@ RULES=$(cat < EOF -) + ) new "test params: -f $cfg" diff --git a/test/test_nacm_protocol.sh b/test/test_nacm_protocol.sh index 1d093632..8d24818c 100755 --- a/test/test_nacm_protocol.sh +++ b/test/test_nacm_protocol.sh @@ -159,11 +159,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_nacm_recovery.sh b/test/test_nacm_recovery.sh index cb4b3a2a..c10228a7 100755 --- a/test/test_nacm_recovery.sh +++ b/test/test_nacm_recovery.sh @@ -97,21 +97,22 @@ EOF fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi + + new "wait backend" + wait_backend + if [ $RC -ne 0 ]; then new "kill old restconf daemon" stop_restconf_pre new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi + new "wait restconf" + wait_restconf + if $getp; then # default is read allowed so this should always succeed. new "get startup default ok" diff --git a/test/test_netconf.sh b/test/test_netconf.sh index 66db8293..dba65cf7 100755 --- a/test/test_netconf.sh +++ b/test/test_netconf.sh @@ -47,11 +47,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg -- -s" start_backend -s init -f $cfg -- -s - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # Framing. with -q to inhibit rcv hello new "Empty frame" expecteof "$clixon_netconf -qf $cfg" 0 ']]>]]>' 'rpcoperation-failederrorEmpty XML]]>]]>' diff --git a/test/test_netconf_hello.sh b/test/test_netconf_hello.sh index a19326b6..7460efbe 100755 --- a/test/test_netconf_hello.sh +++ b/test/test_netconf_hello.sh @@ -49,11 +49,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg -- -s" start_backend -s init -f $cfg -- -s - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # Hello new "Netconf snd hello with xmldecl" expecteof "$clixon_netconf -qf $cfg" 0 "urn:ietf:params:netconf:base:1.1]]>]]>" '^$' '^$' diff --git a/test/test_netconf_ssh_callhome.sh b/test/test_netconf_ssh_callhome.sh index dd227191..a243b54d 100755 --- a/test/test_netconf_ssh_callhome.sh +++ b/test/test_netconf_ssh_callhome.sh @@ -99,11 +99,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # Start callhome server-side in background thread callhomefn & diff --git a/test/test_order.sh b/test/test_order.sh index 44b90e18..fb10efe9 100755 --- a/test/test_order.sh +++ b/test/test_order.sh @@ -161,11 +161,11 @@ if [ $BE -ne 0 ]; then fi new "start backend" start_backend -s running -f $cfg -- -s - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # STATE (should not be ordered) #new "state data (should be unordered: 42,41,43)" # Eeh I changed that to sortered unless STATE_ORDERED_BY_SYSTEM diff --git a/test/test_pattern.sh b/test/test_pattern.sh index d9aeb7d5..35c6d416 100755 --- a/test/test_pattern.sh +++ b/test/test_pattern.sh @@ -415,11 +415,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "Test for RFC7950 Sec 9.4.7 pattern example 2 (length + pattern)" testrun rfc2 true 'AB' testrun rfc2 true '9A00' diff --git a/test/test_perf_restconf.sh b/test/test_perf_restconf.sh index 7ba33a3d..b07cd66b 100755 --- a/test/test_perf_restconf.sh +++ b/test/test_perf_restconf.sh @@ -144,7 +144,7 @@ sed -i '/Connection:/d' $foutput # Create a file to compare with if ${HAVE_LIBNGHTTP2}; then - if ${HAVE_LIBEVHTP}; then + if [ ${HAVE_LIBEVHTP} -a ${RCPROTO} = http ]; then # Add 101 switch protocols for http 1->2 upgrade echo "HTTP/1.1 101 Switching Protocols " > $ftest echo "Upgrade: h2c " >> $ftest diff --git a/test/test_perf_state_only.sh b/test/test_perf_state_only.sh index 9a2ecd9d..cce9111b 100755 --- a/test/test_perf_state_only.sh +++ b/test/test_perf_state_only.sh @@ -107,11 +107,11 @@ if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg -- -sS $fstate" start_backend -s init -f $cfg -- -sS $fstate - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + if [ $RC -ne 0 ]; then new "kill old restconf daemon" @@ -119,11 +119,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "cli get large config" # baseline on thinkpad i5-3320M CPU @ 2.60GHz and 500K entries: 39.71s $TIMEFN $clixon_cli -1f $cfg show xpath /interfaces urn:example:clixon 2>&1 > /dev/null | awk '/real/ {print $2}' diff --git a/test/test_restconf_internal.sh b/test/test_restconf_internal.sh index abb6fc97..845955c7 100755 --- a/test/test_restconf_internal.sh +++ b/test/test_restconf_internal.sh @@ -327,11 +327,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s none -f $cfg" start_backend -s none -f $cfg - - new "wait backend" - wait_backend fi +new "wait backend" +wait_backend + new "wait restconf" wait_restconf diff --git a/test/test_restconf_netns.sh b/test/test_restconf_netns.sh index c632545f..fe680059 100755 --- a/test/test_restconf_netns.sh +++ b/test/test_restconf_netns.sh @@ -54,7 +54,6 @@ test -d $certdir || mkdir $certdir cacerts $cakey $cacert servercerts $cakey $cacert $srvkey $srvcert -# XXX Note default port need to be 80 for wait_restconf to work RESTCONFIG=$(cat < true @@ -66,7 +65,7 @@ RESTCONFIG=$(cat <$RESTCONFDBG default -
0.0.0.0
+
127.0.0.1
80 false
@@ -165,7 +164,7 @@ if [ $RC -ne 0 ]; then fi new "wait restconf" -wait_restconf +wait_restconf http # force to http on host ns new "add sample config w netconf" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOa42
]]>]]>" "^]]>]]>$" @@ -216,7 +215,7 @@ RESTCONFIG=$(cat <$RESTCONFDBG none false - + default
127.0.0.1
80 @@ -289,8 +288,7 @@ if [ $RC -ne 0 ]; then fi new "wait restconf" -wait_restconf - +wait_restconf http # force to http on host ns sleep $DEMSLEEP new "Check zombies" diff --git a/test/test_restconf_notifications.sh b/test/test_restconf_notifications.sh index e1b4e374..75ce9d6a 100755 --- a/test/test_restconf_notifications.sh +++ b/test/test_restconf_notifications.sh @@ -136,11 +136,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "netconf event stream discovery RFC8040 Sec 6.2" expecteof "$clixon_netconf -D $DBG -qf $cfg" 0 "$DEFAULTHELLO]]>]]>" "EXAMPLEExample event streamtruexmlhttps://localhost/streams/EXAMPLE]]>]]>" diff --git a/test/test_restconf_op.sh b/test/test_restconf_op.sh index 50a6b8ed..23b82abc 100755 --- a/test/test_restconf_op.sh +++ b/test/test_restconf_op.sh @@ -94,11 +94,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "restconf POST tree without key" expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" -d '{"example:cont1":{"interface":{"type":"regular"}}}' $RCPROTO://localhost/restconf/data)" 0 "HTTP/$HVER 400" '{"ietf-restconf:errors":{"error":{"error-type":"application","error-tag":"missing-element","error-info":{"bad-element":"name"},"error-severity":"error","error-message":"Mandatory key"}}}' diff --git a/test/test_rpc.sh b/test/test_rpc.sh index 153906ac..f0d61b17 100755 --- a/test/test_rpc.sh +++ b/test/test_rpc.sh @@ -55,11 +55,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "rpc tests" # 1.First some positive tests vary media types diff --git a/test/test_sock.sh b/test/test_sock.sh index 8e303287..91df329b 100755 --- a/test/test_sock.sh +++ b/test/test_sock.sh @@ -55,11 +55,11 @@ EOF fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "wait backend" - wait_backend fi + new "wait backend" + wait_backend + new "$clixon_cli -1f $cfg show version" expectpart "$($clixon_cli -1f $cfg show version)" 0 "${CLIXON_VERSION}" diff --git a/test/test_submodule.sh b/test/test_submodule.sh index 0169dbbf..56396298 100755 --- a/test/test_submodule.sh +++ b/test/test_submodule.sh @@ -198,11 +198,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - - new "wait restconf" - wait_restconf fi +new "wait restconf" +wait_restconf + new "netconfig edit main module" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO
foofoo
]]>]]>" "^]]>]]>$" diff --git a/test/test_transaction.sh b/test/test_transaction.sh index 9e920a2a..41759948 100755 --- a/test/test_transaction.sh +++ b/test/test_transaction.sh @@ -119,11 +119,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg -l f$flog -- -t -v /x/y[a=$errnr]" start_backend -s init -f $cfg -l f$flog -- -t -v /x/y[a=$errnr] # -t means transaction logging - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + let nr=0 new "Basic transaction to add top-level x" diff --git a/test/test_transaction_restart.sh b/test/test_transaction_restart.sh index 24dc473c..0548e78b 100755 --- a/test/test_transaction_restart.sh +++ b/test/test_transaction_restart.sh @@ -97,11 +97,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg -l f$flog -- -t /foo" start_backend -s init -f $cfg -l f$flog -- -t /foo # -t means transaction logging (foo is dummy) - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + let nr=0 new "Basic transaction to add top-level x" diff --git a/test/test_type.sh b/test/test_type.sh index e64b240b..81660f35 100755 --- a/test/test_type.sh +++ b/test/test_type.sh @@ -240,11 +240,11 @@ EOF fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi + new "wait backend" + wait_backend + new "cli set transitive string. type is alpha followed by number and is defined in three levels of modules" expectpart "$($clixon_cli -1f $cfg -l o set c talle x99)" 0 '^$' diff --git a/test/test_type_range.sh b/test/test_type_range.sh index f06944e2..e1f0af6a 100755 --- a/test/test_type_range.sh +++ b/test/test_type_range.sh @@ -276,11 +276,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "test params: -f $cfg" # Test all int types diff --git a/test/test_union.sh b/test/test_union.sh index e1d21e40..61ca59b5 100755 --- a/test/test_union.sh +++ b/test/test_union.sh @@ -86,11 +86,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "cli set transitive string" expectpart "$($clixon_cli -1f $cfg -l o set c talle x)" 0 "^$" diff --git a/test/test_unique.sh b/test/test_unique.sh index af4a99e4..5b6b81db 100755 --- a/test/test_unique.sh +++ b/test/test_unique.sh @@ -89,11 +89,11 @@ if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" # start new backend start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # RFC test two-field caes new "Add not valid example" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOreplace diff --git a/test/test_upgrade_module.sh b/test/test_upgrade_module.sh index cc5bb13c..38d19c07 100755 --- a/test/test_upgrade_module.sh +++ b/test/test_upgrade_module.sh @@ -220,11 +220,11 @@ function testrun(){ fi new "start backend -s startup -f $cfg -l f$log -- -u" start_backend -s startup -f $cfg -l f$log -- -u - - new "waiting" - wait_backend fi + new "wait backend" + wait_backend + if $flag; then checklog "$match" $line else diff --git a/test/test_upgrade_simple.sh b/test/test_upgrade_simple.sh index af39bb91..b30d33df 100755 --- a/test/test_upgrade_simple.sh +++ b/test/test_upgrade_simple.sh @@ -59,11 +59,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "wait backend" - wait_backend fi +new "wait backend" +wait_backend + new "add hello world (with modstate)" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO]]>]]>" "^]]>]]>$" diff --git a/test/test_when_must.sh b/test/test_when_must.sh index 75a6a7e0..12c94da3 100755 --- a/test/test_when_must.sh +++ b/test/test_when_must.sh @@ -99,11 +99,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "when: add static route" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstaticr1]]>]]>" "^]]>]]>$" diff --git a/test/test_with_default.sh b/test/test_with_default.sh index 5c76d98a..b304ea51 100755 --- a/test/test_with_default.sh +++ b/test/test_with_default.sh @@ -74,11 +74,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # This is the base XML with three values in the server: notset, default, other XML='default42notsetother99' diff --git a/test/test_xpath_functions.sh b/test/test_xpath_functions.sh index 22d91465..f996ad1a 100755 --- a/test/test_xpath_functions.sh +++ b/test/test_xpath_functions.sh @@ -108,11 +108,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # contains new "contains: Set site to foo that validates site OK" expecteof "$clixon_netconf -qf $cfg -D $DBG" 0 "$DEFAULTHELLOfoo1242]]>]]>" "^]]>]]>" diff --git a/test/test_yang.sh b/test/test_yang.sh index 0595de62..263ef359 100755 --- a/test/test_yang.sh +++ b/test/test_yang.sh @@ -151,11 +151,11 @@ if [ "$BE" -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f "$cfg" - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "cli defined extension" expectpart "$($clixon_cli -1f $cfg show version)" 0 "${CLIXON_VERSION}" diff --git a/test/test_yang_extension.sh b/test/test_yang_extension.sh index d396cd73..2e8933c2 100755 --- a/test/test_yang_extension.sh +++ b/test/test_yang_extension.sh @@ -112,11 +112,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + # The main example implements ex:e4 new "Add extension foo (not implemented)" expecteof "$clixon_netconf -qf $cfg -D $DBG" 0 "$DEFAULTHELLOa string]]>]]>" "^applicationunknown-elementfooerror" diff --git a/test/test_yang_load.sh b/test/test_yang_load.sh index a39cf7be..e6465e73 100755 --- a/test/test_yang_load.sh +++ b/test/test_yang_load.sh @@ -82,11 +82,11 @@ if [ $BE -ne 0 ]; then fi new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "1. Set newex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" @@ -130,11 +130,11 @@ if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" # start new backend start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "Set oldex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" @@ -174,11 +174,11 @@ EOF if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "Set newex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" @@ -218,11 +218,11 @@ EOF if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "Set oldex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" @@ -262,11 +262,11 @@ EOF if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "Set newex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" @@ -308,10 +308,11 @@ EOF if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi + +new "wait backend" +wait_backend + new "Set oldex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" @@ -353,11 +354,11 @@ EOF if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "Set oldex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" @@ -399,11 +400,11 @@ EOF if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + new "Set oldex" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLOstr]]>]]>" "^]]>]]>$" diff --git a/test/test_yang_namespace.sh b/test/test_yang_namespace.sh index 39aa0115..5da0d545 100755 --- a/test/test_yang_namespace.sh +++ b/test/test_yang_namespace.sh @@ -72,11 +72,11 @@ if [ $BE -ne 0 ]; then new "start backend -s init -f $cfg" start_backend -s init -f $cfg - - new "waiting" - wait_backend fi +new "wait backend" +wait_backend + if [ $RC -ne 0 ]; then new "kill old restconf daemon" stop_restconf_pre @@ -84,10 +84,11 @@ if [ $RC -ne 0 ]; then new "start restconf daemon" start_restconf -f $cfg - new "waiting" - wait_restconf fi +new "wait restconf" +wait_restconf + new "netconf set x in example1" expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO42]]>]]>" "^]]>]]>$" diff --git a/util/Makefile.in b/util/Makefile.in index dd437e58..33da0c6d 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -68,14 +68,18 @@ LINKAGE = @LINKAGE@ INCLUDES = -I. @INCLUDES@ -I$(top_srcdir)/lib -I$(top_srcdir)/include ifeq ($(LINKAGE),static) - CLIXON_LIB = libclixon.a + CLIXON_LIB = libclixon.a + CLIXON_BACKEND_LIB = libclixon_backend.a # for util_validate else - CLIXON_LIB = libclixon$(SH_SUFFIX).$(CLIXON_MAJOR).$(CLIXON_MINOR) + CLIXON_LIB = libclixon$(SH_SUFFIX).$(CLIXON_MAJOR).$(CLIXON_MINOR) + CLIXON_BACKEND_LIB = libclixon_backend$(SH_SUFFIX).$(CLIXON_MAJOR).$(CLIXON_MINOR) endif # For dependency. A little strange that we rely on it being built in the src dir # even though it may exist in $(libdir). But the new version may not have been installed yet. -LIBDEPS = $(top_srcdir)/lib/src/$(CLIXON_LIB) +LIBDEPS = $(top_srcdir)/apps/backend/$(CLIXON_BACKEND_LIB) +LIBDEPS += $(top_srcdir)/lib/src/$(CLIXON_LIB) + # Utilities, unit testings. Not installed. APPSRC = clixon_util_xml.c @@ -107,6 +111,9 @@ all: $(APPS) $(top_srcdir)/lib/src/$(CLIXON_LIB): (cd $(top_srcdir)/lib/src && $(MAKE) $(MFLAGS) $(CLIXON_LIB)) +$(top_srcdir)/lib/src/$(CLIXON_BACKEND_LIB): + (cd $(top_srcdir)/apps/backend && $(MAKE) $(MFLAGS) $(CLIXON_BACKEND_LIB)) + clean: rm -f $(APPS) clixon_util_stream *.core rm -f *.gcda *.gcno *.gcov # coverage @@ -139,9 +146,13 @@ clixon_util_regexp: clixon_util_regexp.c $(LIBDEPS) clixon_util_socket: clixon_util_socket.c $(LIBDEPS) $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ +ifeq ($(LINKAGE),static) +clixon_util_validate: clixon_util_validate.c $(LIBDEPS) + $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) clixon_util_validate.c $(LIBS) $(LIBDEPS) -o $@ +else clixon_util_validate: clixon_util_validate.c $(LIBDEPS) $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -l clixon_backend -o $@ - +endif ifdef with_restconf clixon_util_stream: clixon_util_stream.c $(LIBDEPS) $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lcurl -o $@ diff --git a/util/README.md b/util/README.md index 917edc41..f345910d 100644 --- a/util/README.md +++ b/util/README.md @@ -4,4 +4,6 @@ This directory contains Clixon utility programs, ie, programs that are good to have for testing, analysis, etc, but not an actual part of delivered code. +Look inside C-code for documentation + Note, streams utility may need: libcurl4-openssl-dev or corresponding.