Skip to content

Commit

Permalink
Test: mem.sh rm files, rm commit tests from datastore_multi
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Jun 23, 2024
1 parent 5b8828c commit 78cd42c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 40 deletions.
2 changes: 1 addition & 1 deletion apps/restconf/restconf_api_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ restconf_reply_header(void *req0,
*/
if (rc->rc_proto == HTTP_2){ // NO http/2
if (strcmp(name, "Connection") == 0){
clixon_debug(CLIXON_DBG_RESTCONF, "Skip: %s: %s", name, value);
clixon_debug(CLIXON_DBG_RESTCONF, "Skip: %s", name);
goto ok;
}
}
Expand Down
2 changes: 2 additions & 0 deletions test/mem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function memonce(){
if [ $testnr != 0 ]; then echo; fi
perfnr=1000 # Limit performance tests
testfile=$test
# clear test dir
sudo rm -rf /var/tmp/mem.sh
. ./$test
errcode=$?
endsuite
Expand Down
5 changes: 3 additions & 2 deletions test/test_cli_apipath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ if [ $BE -ne 0 ]; then
stop_backend -f $cfg
fi

endtest

rm -rf $dir

new "endtest"
endtest
35 changes: 0 additions & 35 deletions test/test_datastore_multi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,41 +296,6 @@ check_db running ${subfilename}
new "cli show config"
expectpart "$($clixon_cli -1 -f $cfg show config xml -- -m clixon-mount1 -M urn:example:mount1)" 0 "<top xmlns=\"urn:example:clixon\"><mylist><name>x</name><root><mount1 xmlns=\"urn:example:mount1\"><mylist1><name1>x1</name1></mylist1></mount1><extra xmlns=\"urn:example:mount1\"><extraval>foo</extraval></extra></root></mylist></top>"

s0=$($stat -c "%Y" $dir/running.d/${subfilename})
new "Change mount data"
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><top xmlns=\"urn:example:clixon\"><mylist><name>x</name><root><mount1 xmlns=\"urn:example:mount1\"><mylist1><name1>x1</name1><value1>foo</value1></mylist1></mount1></root></mylist></top></config></edit-config></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

sleep 1

new "netconf commit 3"
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><commit/></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

new "Check running subfile changed"
s1=$($stat -c "%Y" $dir/running.d/${subfilename})
if [ $s0 -eq $s1 ]; then
err "Timestamp changed" "$s0 = $s1"
fi

new "Add data to top-level (not mount)"
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><top xmlns=\"urn:example:clixon\"><mylist><name>y</name></mylist></top></config></edit-config></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

new "netconf commit 4"
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><commit/></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

sleep 1

new "Check running subfile not changed"
s2=$($stat -c "%Y" $dir/running.d/${subfilename})
if [ $s1 -ne $s2 ]; then # XXX Sometimes fails
err "Timestamp not changed" "$s1 != $s2"
fi

new "Reset secondary adds"
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><top xmlns=\"urn:example:clixon\"><mylist><name>x</name><root><mount1 xmlns=\"urn:example:mount1\"><mylist1><name1>x1</name1></mylist1></mount1><extra xmlns=\"urn:example:mount1\"><extraval>foo</extraval></extra></root></mylist></top></config><default-operation>replace</default-operation></edit-config></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

new "netconf commit 5"
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><commit/></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"

if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
Expand Down
6 changes: 4 additions & 2 deletions yang/clixon/clixon-config@2024-04-01.yang
Original file line number Diff line number Diff line change
Expand Up @@ -1146,9 +1146,11 @@ module clixon-config {
"Split configure datastore into multiple sub files
Uses .d/ directory structure with <digest>.xml and 0.xml as root
JSON not supported.
Splits are marked in YANG using extension xl:xmldb-split, (typical usage is
Splits are marked in YANG using extension xl:xmldb-split, (typical usage is
mount-points).
May not be used together with CLICON_BACKEND_PRIVILEGES=drop and root, since
Note that algorithm for not updating unchanged files only applies to edits,
commit copies all files regardless.
May not work together with CLICON_BACKEND_PRIVILEGES=drop and root, since
new files need to be created in XMLDB_DIR";
}
leaf CLICON_XML_CHANGELOG {
Expand Down

0 comments on commit 78cd42c

Please sign in to comment.