Making the tests self-contained wrt config file and lib.sh creating test scratch dir.

This commit is contained in:
Olof hagsand 2018-01-07 17:56:33 +01:00
parent b5b96cde0c
commit cefaf4717f
12 changed files with 256 additions and 78 deletions

View file

@ -6,20 +6,22 @@
# No test of ordered-by system is done yet
# (we may want to sort them alphabetically for better performance).
# include err() and new() functions
# include err() and new() functions and creates $dir
. ./lib.sh
cfg=/tmp/conf_yang.xml
fyang=/tmp/order.yang
cfg=$dir/conf_yang.xml
fyang=$dir/order.yang
# For memcheck
# clixon_netconf="valgrind --leak-check=full --show-leak-kinds=all clixon_netconf"
clixon_netconf=clixon_netconf
clixon_cli=clixon_cli
dbdir=/tmp/order
dbdir=$dir/order
new "Set up $dbdir"
rm -rf $dbdir
mkdir $dbdir
if [ ! -d $dbdir ]; then
mkdir $dbdir
fi
cat <<EOF > $cfg
<config>
@ -175,3 +177,5 @@ sudo clixon_backend -zf $cfg
if [ $? -ne 0 ]; then
err "kill backend"
fi
rm -rf $dir