mv stream->restconf_notif, cli-auto test change for grouping/extension bug

This commit is contained in:
Olof hagsand 2021-01-28 11:27:07 +01:00
parent 8f68f601d4
commit 200e258ded
4 changed files with 21 additions and 17 deletions

View file

@ -774,7 +774,14 @@ cx_evhtp_socket_extract(clicon_handle h,
goto done; goto done;
} }
*address = body; *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 && if ((x = xpath_first(xs, nsc, "port")) != NULL &&
(str = xml_body(x)) != NULL){ (str = xml_body(x)) != NULL){
if ((ret = parse_uint16(str, port, &reason)) < 0){ if ((ret = parse_uint16(str, port, &reason)) < 0){
@ -893,14 +900,11 @@ cx_evhtp_socket(clicon_handle h,
goto done; goto done;
/* ss is a server socket that the clients connect to. The callback /* ss is a server socket that the clients connect to. The callback
therefore accepts clients on ss */ 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) { if (evhtp_accept_socket(htp, ss, SOCKET_LISTEN_BACKLOG) < 0) {
/* accept_socket() does not close the descriptor /* accept_socket() does not close the descriptor
* on error, but this function does. * on error, but this function does.
*/ */
evutil_closesocket(ss); close(ss);
goto done; goto done;
} }
if (cx_htp_add(eh, htp) < 0) if (cx_htp_add(eh, htp) < 0)

View file

@ -68,6 +68,7 @@ EOF
# Yang specs must be here first for backend. But then the specs are changed but just for CLI # Yang specs must be here first for backend. But then the specs are changed but just for CLI
# Annotate original Yang spec example directly # Annotate original Yang spec example directly
# First annotate /table/parameter # First annotate /table/parameter
# Had a problem with unknown in grouping -> test uses uses/grouping
cat <<EOF > $fyang cat <<EOF > $fyang
module example { module example {
namespace "urn:example:clixon"; namespace "urn:example:clixon";
@ -75,12 +76,8 @@ module example {
import clixon-lib{ import clixon-lib{
prefix cl; prefix cl;
} }
container table{
list parameter{ grouping pg {
key name;
leaf name{
type string;
}
cl:autocli-op hide; /* This is the extension */ cl:autocli-op hide; /* This is the extension */
leaf value{ leaf value{
description "a value"; description "a value";
@ -94,7 +91,15 @@ module example {
leaf iv{ leaf iv{
type string; type string;
} }
}
}
container table{
list parameter{
key name;
leaf name{
type string;
} }
uses pg;
} }
} }
} }

View file

@ -9,12 +9,7 @@
# - stream retention time # - stream retention time
# - native vs nchan implementation # - native vs nchan implementation
# Focussing on 1-3 # Focussing on 1-3
# 2a) start sub 8s - expect 2 notifications # @see test_restconf_notifications.sh
# 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
# Magic line must be first in script (see README.md) # Magic line must be first in script (see README.md)
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi