Skip to content

Commit

Permalink
Test: mem test delays
Browse files Browse the repository at this point in the history
Yang-lib capabilty fix
  • Loading branch information
olofhagsand committed Oct 21, 2024
1 parent 7903a92 commit 315e554
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Expected: October 2024

Users may have to change how they access the system

* Capability announce urn:ietf:params:netconf:capability:yang-library:1.1 (instead of 1.0)
* RFC 7950->8526
* New version string on the form: `7.1.0-1+11+g2b25294`
* Restconf: Better RFC compliance with Accept errors: 406 vs 415
* Removed YANG line-number in error-messages for memory optimization
Expand Down
4 changes: 2 additions & 2 deletions lib/src/clixon_netconf_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ netconf_content_int2str(netconf_content nr)
* MUST announce the modules it implements by implementing the YANG module
* "ietf-yang-library" (RFC7895) and listing all implemented modules in the
* "/modules-state/module" list.
* MUST advertise urn:ietf:params:netconf:capability:yang-library:1.0?
* MUST advertise urn:ietf:params:netconf:capability:yang-library:1.1?
* revision=<date>&module-set-id=<id> in the <hello> message.
*
* Question: should the NETCONF in RFC6241 sections 8.2-8.9 be announced both
Expand Down Expand Up @@ -1860,7 +1860,7 @@ netconf_capabilites(clixon_handle h,
that it supports multiple protocol versions. */
cprintf(cb, "<capability>%s</capability>", NETCONF_BASE_CAPABILITY_1_0);

/* Check if RFC7895 loaded and revision found */
/* Check if RFC8526 (RFC7950 1.0) loaded and revision found */
if ((ietf_yang_library_revision = yang_modules_revision(h)) != NULL){
if (xml_chardata_encode(&encstr, 0, "urn:ietf:params:netconf:capability:yang-library:1.1?revision=%s&module-set-id=%s",
ietf_yang_library_revision,
Expand Down
1 change: 1 addition & 0 deletions test/test_netconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ new "asynchronous confirmed commit"
sleep 60 | cat <(echo "$HELLONO11<rpc $DEFAULTNS><commit><confirmed/><confirm-timeout>60</confirm-timeout></commit></rpc>]]>]]>") -| $clixon_netconf -qf $cfg >> /dev/null &
PIDS=($(jobs -l % | cut -c 6- | awk '{print $1}'))

sleep 1
new "try lock should fail"
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><lock><target><running/></target></lock></rpc>" "<rpc-reply $DEFAULTNS><rpc-error><error-type>protocol</error-type><error-tag>lock-denied</error-tag><error-info><session-id>[0-9]*</session-id></error-info><error-severity>error</error-severity><error-message>Operation failed, "

Expand Down
2 changes: 1 addition & 1 deletion test/test_netconf_hello.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ expecteof "$clixon_netconf -qef $cfg" 0 "<?xml version=\"1.0\" encoding=\"UTF-8\

new "netconf snd + rcv hello"
expecteof "$clixon_netconf -f $cfg" 0 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello $DEFAULTONLY><capabilities><capability>urn:ietf:params:netconf:base:1.1</capability></capabilities></hello>]]>]]>" "^<hello $DEFAULTONLY><capabilities><capability>urn:ietf:params:netconf:base:1.1</capability><capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:capability:yang-library:1.0?revision=2019-01-04&amp;module-set-id=42</capability>
<capability>urn:ietf:params:netconf:capability:yang-library:1.1?revision=2019-01-04&amp;module-set-id=42</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.1</capability>
<capability>urn:ietf:params:netconf:capability:xpath:1.0</capability>
Expand Down
3 changes: 3 additions & 0 deletions test/test_restconf_internal_usecases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function rpcstatus()
$DEFAULTHELLO$rpc
EOF
)
# echo "$retx"
# Check pid
expect="<pid $LIBNS>[0-9]*</pid>"
match=$(echo "$retx" | grep --null -Go "$expect")
Expand Down Expand Up @@ -447,6 +448,8 @@ EOF
new "Create server"
expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config>$RESTCONFIG1</config></edit-config></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

sleep 1

new "commit create"
expecteof_netconf "$clixon_netconf -qef $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><commit/></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

Expand Down

0 comments on commit 315e554

Please sign in to comment.