- Fixed [clixon_proc can't start new process with PATH env #202](https://github.com/clicon/clixon/issues/202)

- Memory errors in tests
This commit is contained in:
Olof hagsand 2021-04-14 17:01:17 +02:00
parent 1af3a7bcfe
commit 172cfd69b3
7 changed files with 28 additions and 17 deletions

View file

@ -94,6 +94,7 @@ Developers may need to change their code
### Corrected Bugs
* Fixed [clixon_proc can't start new process with PATH env #202](https://github.com/clicon/clixon/issues/202)
* Fixed ["aux" folder issue with Windows. #198](https://github.com/clicon/clixon/issues/198)
* Fixed [changing interface name not support with openconfig module #195](https://github.com/clicon/clixon/issues/195)
* Fixed [making cli_show_options's output more human readable #199](https://github.com/clicon/clixon/issues/199)

View file

@ -322,7 +322,7 @@ clixon_proc_background(char **argv,
}
}
#endif /* HAVE_SETNS */
if (execv(argv[0], argv) < 0) {
if (execvp(argv[0], argv) < 0) {
clicon_err(OE_UNIX, errno, "execv");
exit(1);
}

View file

@ -447,7 +447,7 @@ ys_new(enum rfc_6020 keyw)
/*! Free a single yang statement, dont remove children
*
* @param[in] ys Yang node to remove
* @param[in] self Free own node
* @param[in] self Free own node including child vector
* @retval 0 OK
* @retval -1 Error
* @see ys_free
@ -476,6 +476,8 @@ ys_free1(yang_stmt *ys,
free(ys->ys_when_xpath);
if (ys->ys_when_nsc)
cvec_free(ys->ys_when_nsc);
if (ys->ys_stmt)
free(ys->ys_stmt);
if (self)
free(ys);
return 0;
@ -526,8 +528,6 @@ ys_free(yang_stmt *ys)
if ((yc = ys->ys_stmt[i]) != NULL)
ys_free(yc);
}
if (ys->ys_stmt)
free(ys->ys_stmt);
ys_free1(ys, 1);
return 0;
}

View file

@ -50,14 +50,16 @@ function memonce(){
;;
esac
err=0
memerr=0
for test in $pattern; do
if [ $testnr != 0 ]; then echo; fi
perfnr=1000 # Limit performance tests
testfile=$test
. ./$test
errcode=$?
if [ $errcode -ne 0 ]; then
err=1
memerr=1
echo -e "\e[31mError in $test errcode=$errcode"
echo -ne "\e[0m"
exit $errcode
@ -100,6 +102,8 @@ done
# Then actual run
testnr=0
memerr=0
for cmd1 in $cmds; do
if [ $testnr != 0 ]; then echo; fi
println "Mem test $cmd1 begin"
@ -107,7 +111,7 @@ for cmd1 in $cmds; do
println "Mem test $cmd1 done"
done
if [ $err -eq 0 ]; then
if [ $memerr -eq 0 ]; then
echo OK
else
echo -e "\e[31mError"

View file

@ -91,7 +91,13 @@ function testrun(){
pid=$(cat $pidfile)
new "netconf get stats"
res=$(echo '<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><stats xmlns="http://clicon.org/lib"/></rpc>]]>]]>' | $clixon_netconf -qf $cfg)
res=$(echo "$DEFAULTHELLO<rpc $DEFAULTNS><stats $LIBNS/></rpc>]]>]]>" | $clixon_netconf -qf $cfg)
echo "res:$res"
err0=$(echo "$res" | $clixon_util_xpath -p "/rpc-reply/rpc-error")
err=${err0#"nodeset:"}
if [ -n "$err" ]; then
err1 "<rpc-reply><global>" "$err"
fi
objects=$(echo "$res" | $clixon_util_xpath -p "/rpc-reply/global/xmlnr" | awk -F ">" '{print $2}' | awk -F "<" '{print $1}')
echo "Total"
@ -105,8 +111,11 @@ function testrun(){
fi
for db in running candidate startup; do
echo "$db"
resdb=$(echo "$res" | $clixon_util_xpath -p "/rpc-reply/datastore[name=\"$db\"]")
resdb=${resdb#"nodeset:0:"}
resdb0=$(echo "$res" | $clixon_util_xpath -p "/rpc-reply/datastore[name=\"$db\"]")
resdb=${resdb0#"nodeset:0:"}
if [ "$resdb0" = "$resdb" ]; then
err1 "nodeset:0:" "$resdb0"
fi
echo -n " objects: "
echo $resdb | $clixon_util_xpath -p "datastore/nr" | awk -F ">" '{print $2}' | awk -F "<" '{print $1}'
echo -n " mem: "

View file

@ -169,15 +169,12 @@ pid1=$pid
if [ $pid1 -eq 0 ]; then err "Pid" 0; fi
new "Check $pid1 exists"
while kill -0 $pid1 2> /dev/null; do
while sudo kill -0 $pid1 2> /dev/null; do
new "kill $pid1 externally"
sudo kill $pid1
sleep $DEMSLEEP
done
new "3. get status: Check killed"
rpcstatus false stopped
if [ $pid -ne 0 ]; then err "Pid" "$pid"; fi
@ -353,7 +350,7 @@ if [ $pid1 -eq $pid2 ]; then
fi
new "Get restconf config 2: no server"
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/clixon-restconf:restconf 2>&1)" 7 "Failed to connect" "Connection refused"
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/clixon-restconf:restconf 2>&1)" 7 # curl 7.58: "Failed to connect" "Connection refused", curl 7.74: "Couldn't connect to server"
if [ $BE -ne 0 ]; then
new "Kill backend"

View file

@ -47,8 +47,8 @@ SHELL = /bin/sh
# VAGRANTS += freebsd/FreeBSD-12.1-STABLE
VAGRANTS =
# internal or fcgi
RESTCONF=internal
# native or fcgi
RESTCONF=native
-include site.mk