diff --git a/apps/restconf/restconf_main_evhtp.c b/apps/restconf/restconf_main_evhtp.c index 1f616bb7..cd424883 100644 --- a/apps/restconf/restconf_main_evhtp.c +++ b/apps/restconf/restconf_main_evhtp.c @@ -774,7 +774,14 @@ cx_evhtp_socket_extract(clicon_handle h, goto done; } *address = body; - *addrtype = yang_argument_get(ysub); + /* This is YANG type name of ip-address: + * typedef ip-address { + * type union { + * type inet:ipv4-address; <--- + * type inet:ipv6-address; <--- + * } + */ + *addrtype = yang_argument_get(ysub); if ((x = xpath_first(xs, nsc, "port")) != NULL && (str = xml_body(x)) != NULL){ if ((ret = parse_uint16(str, port, &reason)) < 0){ @@ -893,14 +900,11 @@ cx_evhtp_socket(clicon_handle h, goto done; /* ss is a server socket that the clients connect to. The callback therefore accepts clients on ss */ - /* XXX address in evhtp should be prefixed with eg "ipv4:" */ - // evutil_make_socket_closeonexec(ss); - // evutil_make_socket_nonblocking(ss); if (evhtp_accept_socket(htp, ss, SOCKET_LISTEN_BACKLOG) < 0) { /* accept_socket() does not close the descriptor * on error, but this function does. */ - evutil_closesocket(ss); + close(ss); goto done; } if (cx_htp_add(eh, htp) < 0) diff --git a/test/test_cli_auto_extension.sh b/test/test_cli_auto_extension.sh index 1a463800..16c5b52b 100755 --- a/test/test_cli_auto_extension.sh +++ b/test/test_cli_auto_extension.sh @@ -68,6 +68,7 @@ EOF # Yang specs must be here first for backend. But then the specs are changed but just for CLI # Annotate original Yang spec example directly # First annotate /table/parameter +# Had a problem with unknown in grouping -> test uses uses/grouping cat < $fyang module example { namespace "urn:example:clixon"; @@ -75,12 +76,8 @@ module example { import clixon-lib{ prefix cl; } - container table{ - list parameter{ - key name; - leaf name{ - type string; - } + + grouping pg { cl:autocli-op hide; /* This is the extension */ leaf value{ description "a value"; @@ -94,7 +91,15 @@ module example { leaf iv{ type string; } + } + } + container table{ + list parameter{ + key name; + leaf name{ + type string; } + uses pg; } } } diff --git a/test/test_netconf_notifications.sh b/test/test_netconf_notifications.sh index 9f4bd619..76fe2ca7 100755 --- a/test/test_netconf_notifications.sh +++ b/test/test_netconf_notifications.sh @@ -9,12 +9,7 @@ # - stream retention time # - native vs nchan implementation # Focussing on 1-3 -# 2a) start sub 8s - expect 2 notifications -# 2b) start sub 8s - stoptime after 5s - expect 1 notifications -# 2c) start sub 8s - replay from start -8s - expect 4 notifications -# 2d) start sub 8s - replay from start -8s to stop +4s - expect 3 notifications -# 2e) start sub 8s - replay from -90s w retention 60s - expect 10 notifications -# Note the sleeps are mainly for valgrind usage +# @see test_restconf_notifications.sh # Magic line must be first in script (see README.md) s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi diff --git a/test/test_stream.sh b/test/test_restconf_notifications.sh similarity index 100% rename from test/test_stream.sh rename to test/test_restconf_notifications.sh