Test: mem.sh rm files, rm commit tests from datastore_multi

This commit is contained in:
Olof hagsand 2024-06-23 10:49:13 +02:00
parent 5b8828c530
commit 78cd42c15d
5 changed files with 10 additions and 40 deletions

View file

@ -102,7 +102,7 @@ restconf_reply_header(void *req0,
*/ */
if (rc->rc_proto == HTTP_2){ // NO http/2 if (rc->rc_proto == HTTP_2){ // NO http/2
if (strcmp(name, "Connection") == 0){ 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; goto ok;
} }
} }

View file

@ -69,6 +69,8 @@ function memonce(){
if [ $testnr != 0 ]; then echo; fi if [ $testnr != 0 ]; then echo; fi
perfnr=1000 # Limit performance tests perfnr=1000 # Limit performance tests
testfile=$test testfile=$test
# clear test dir
sudo rm -rf /var/tmp/mem.sh
. ./$test . ./$test
errcode=$? errcode=$?
endsuite endsuite

View file

@ -136,6 +136,7 @@ if [ $BE -ne 0 ]; then
stop_backend -f $cfg stop_backend -f $cfg
fi fi
endtest
rm -rf $dir rm -rf $dir
new "endtest"
endtest

View file

@ -296,41 +296,6 @@ check_db running ${subfilename}
new "cli show config" 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>" 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 if [ $BE -ne 0 ]; then
new "Kill backend" new "Kill backend"
# Check if premature kill # Check if premature kill

View file

@ -1148,7 +1148,9 @@ module clixon-config {
JSON not supported. 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). 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"; new files need to be created in XMLDB_DIR";
} }
leaf CLICON_XML_CHANGELOG { leaf CLICON_XML_CHANGELOG {