fix test scripts according to jeff's suggestion.
This commit is contained in:
parent
423fa69620
commit
9ea0e2f770
10
.travis.yml
10
.travis.yml
|
@ -51,7 +51,7 @@ matrix:
|
|||
./test-all.sh $TRAVIS_EVENT_TYPE || travis_terminate $?
|
||||
|
||||
cd ${TRAVIS_BUILD_DIR}/tests/pytest
|
||||
./valgrind-test.sh 2>&1 > mem-error-out.txt
|
||||
./valgrind-test.sh 2>&1 > mem-error-out.log
|
||||
sleep 1
|
||||
|
||||
# Color setting
|
||||
|
@ -61,9 +61,9 @@ matrix:
|
|||
GREEN_UNDERLINE='\033[4;32m'
|
||||
NC='\033[0m'
|
||||
|
||||
grep 'start to execute\|ERROR SUMMARY' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-mem-error-out.txt
|
||||
grep 'start to execute\|ERROR SUMMARY' mem-error-out.log|grep -v 'grep'|uniq|tee uniq-mem-error-out.log
|
||||
|
||||
for memError in `grep 'ERROR SUMMARY' uniq-mem-error-out.txt | awk '{print $4}'`
|
||||
for memError in `grep 'ERROR SUMMARY' uniq-mem-error-out.log | awk '{print $4}'`
|
||||
do
|
||||
if [ -n "$memError" ]; then
|
||||
if [ "$memError" -gt 12 ]; then
|
||||
|
@ -74,8 +74,8 @@ matrix:
|
|||
fi
|
||||
done
|
||||
|
||||
grep 'start to execute\|definitely lost:' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-definitely-lost-out.txt
|
||||
for defiMemError in `grep 'definitely lost:' uniq-definitely-lost-out.txt | awk '{print $7}'`
|
||||
grep 'start to execute\|definitely lost:' mem-error-out.log|grep -v 'grep'|uniq|tee uniq-definitely-lost-out.log
|
||||
for defiMemError in `grep 'definitely lost:' uniq-definitely-lost-out.log | awk '{print $7}'`
|
||||
do
|
||||
if [ -n "$defiMemError" ]; then
|
||||
if [ "$defiMemError" -gt 13 ]; then
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
ulimit -c unlimited
|
||||
|
||||
python3 ./test.py -f insert/basic.py
|
||||
python3 ./test.py -f insert/int.py
|
||||
python3 ./test.py -f insert/float.py
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
ulimit -c unlimited
|
||||
|
||||
# insert
|
||||
python3 ./test.py $1 -f insert/basic.py
|
||||
python3 ./test.py $1 -s && sleep 1
|
||||
|
|
|
@ -38,9 +38,9 @@ class TDSimClient:
|
|||
tdLog.exit(cmd)
|
||||
|
||||
def deploy(self):
|
||||
self.logDir = "%s/pysim/psim/log" % (self.path,)
|
||||
self.cfgDir = "%s/pysim/psim/cfg" % (self.path)
|
||||
self.cfgPath = "%s/pysim/psim/cfg/taos.cfg" % (self.path)
|
||||
self.logDir = "%s/sim/psim/log" % (self.path,)
|
||||
self.cfgDir = "%s/sim/psim/cfg" % (self.path)
|
||||
self.cfgPath = "%s/sim/psim/cfg/taos.cfg" % (self.path)
|
||||
|
||||
cmd = "rm -rf " + self.logDir
|
||||
if os.system(cmd) != 0:
|
||||
|
@ -113,10 +113,10 @@ class TDDnode:
|
|||
return totalSize
|
||||
|
||||
def deploy(self):
|
||||
self.logDir = "%s/pysim/dnode%d/log" % (self.path, self.index)
|
||||
self.dataDir = "%s/pysim/dnode%d/data" % (self.path, self.index)
|
||||
self.cfgDir = "%s/pysim/dnode%d/cfg" % (self.path, self.index)
|
||||
self.cfgPath = "%s/pysim/dnode%d/cfg/taos.cfg" % (
|
||||
self.logDir = "%s/sim/dnode%d/log" % (self.path, self.index)
|
||||
self.dataDir = "%s/sim/dnode%d/data" % (self.path, self.index)
|
||||
self.cfgDir = "%s/sim/dnode%d/cfg" % (self.path, self.index)
|
||||
self.cfgPath = "%s/sim/dnode%d/cfg/taos.cfg" % (
|
||||
self.path, self.index)
|
||||
|
||||
cmd = "rm -rf " + self.dataDir
|
||||
|
@ -298,11 +298,11 @@ class TDDnode:
|
|||
tdLog.exit(cmd)
|
||||
|
||||
def getDnodeRootDir(self, index):
|
||||
dnodeRootDir = "%s/pysim/psim/dnode%d" % (self.path, index)
|
||||
dnodeRootDir = "%s/sim/psim/dnode%d" % (self.path, index)
|
||||
return dnodeRootDir
|
||||
|
||||
def getDnodesRootDir(self):
|
||||
dnodesRootDir = "%s/pysim/psim" % (self.path)
|
||||
dnodesRootDir = "%s/sim/psim" % (self.path)
|
||||
return dnodesRootDir
|
||||
|
||||
|
||||
|
@ -455,7 +455,7 @@ class TDDnodes:
|
|||
# tdLog.exit(cmd)
|
||||
|
||||
def getDnodesRootDir(self):
|
||||
dnodesRootDir = "%s/pysim" % (self.path)
|
||||
dnodesRootDir = "%s/sim" % (self.path)
|
||||
return dnodesRootDir
|
||||
|
||||
def getSimCfgPath(self):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# != 6 ]; then
|
||||
echo "argument list need input : "
|
||||
|
@ -33,10 +33,19 @@ SCRIPT_DIR=`dirname $0`
|
|||
cd $SCRIPT_DIR/../
|
||||
SCRIPT_DIR=`pwd`
|
||||
|
||||
cd ../../
|
||||
TDINTERNAL="TDinternal"
|
||||
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
else
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
TAOS_DIR=`pwd`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/debug/build
|
||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||
|
||||
SIM_DIR=$TAOS_DIR/sim
|
||||
|
||||
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||
|
|
|
@ -36,12 +36,20 @@ cd $SCRIPT_DIR/../
|
|||
SCRIPT_DIR=`pwd`
|
||||
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
||||
|
||||
cd ../../
|
||||
TDINTERNAL="TDinternal"
|
||||
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
else
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
TAOS_DIR=`pwd`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/debug/build
|
||||
SIM_DIR=$TAOS_DIR/sim
|
||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||
|
||||
SIM_DIR=$TAOS_DIR/sim
|
||||
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||
EXE_DIR=$BUILD_DIR/bin
|
||||
CFG_DIR=$NODE_DIR/cfg
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
echo "Executing deploy.sh"
|
||||
|
||||
|
@ -31,10 +31,19 @@ cd $SCRIPT_DIR/../
|
|||
SCRIPT_DIR=`pwd`
|
||||
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
||||
|
||||
cd ../../
|
||||
TDINTERNAL="TDinternal"
|
||||
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
else
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
TAOS_DIR=`pwd`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/debug/build
|
||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||
|
||||
SIM_DIR=$TAOS_DIR/sim
|
||||
|
||||
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# if [ $# != 4 || $# != 5 ]; then
|
||||
# echo "argument list need input : "
|
||||
|
@ -42,10 +42,19 @@ SCRIPT_DIR=`dirname $0`
|
|||
cd $SCRIPT_DIR/../
|
||||
SCRIPT_DIR=`pwd`
|
||||
|
||||
cd ../../
|
||||
TDINTERNAL="TDinternal"
|
||||
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
else
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
TAOS_DIR=`pwd`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/debug/build
|
||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||
|
||||
SIM_DIR=$TAOS_DIR/sim
|
||||
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||
EXE_DIR=$BUILD_DIR/bin
|
||||
|
@ -86,9 +95,9 @@ else
|
|||
if [ -n "$PID" ]; then
|
||||
if [ "$SIGNAL" = "SIGINT" ]; then
|
||||
echo killed by signal
|
||||
sudo kill -sigint $PID
|
||||
kill -sigint $PID
|
||||
else
|
||||
sudo kill -9 $PID
|
||||
kill -9 $PID
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -39,10 +39,19 @@ SCRIPT_DIR=`dirname $0`
|
|||
cd $SCRIPT_DIR/../
|
||||
SCRIPT_DIR=`pwd`
|
||||
|
||||
cd ../../
|
||||
TDINTERNAL="TDinternal"
|
||||
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
else
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
TAOS_DIR=`pwd`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/../debug/build
|
||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||
|
||||
SIM_DIR=$TAOS_DIR/sim
|
||||
NODE_DIR=$SIM_DIR/arbitrator
|
||||
EXE_DIR=$BUILD_DIR/bin
|
||||
|
@ -57,8 +66,8 @@ else
|
|||
#relative path
|
||||
PID=`ps -ef|grep tarbitrator | grep -v grep | awk '{print $2}'`
|
||||
if [ -n "$PID" ]; then
|
||||
sudo kill -9 $PID
|
||||
sudo pkill -9 tarbitrator
|
||||
kill -9 $PID
|
||||
pkill -9 tarbitrator
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -42,10 +42,19 @@ SCRIPT_DIR=`dirname $0`
|
|||
cd $SCRIPT_DIR/../
|
||||
SCRIPT_DIR=`pwd`
|
||||
|
||||
cd ../../
|
||||
TDINTERNAL="TDinternal"
|
||||
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
else
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
TAOS_DIR=`pwd`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/../debug/build
|
||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
||||
|
||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||
|
||||
SIM_DIR=$TAOS_DIR/sim
|
||||
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||
EXE_DIR=$BUILD_DIR/bin
|
||||
|
@ -91,9 +100,9 @@ else
|
|||
if [ -n "$PID" ]; then
|
||||
if [ "$SIGNAL" = "SIGINT" ]; then
|
||||
echo killed by signal
|
||||
sudo kill -sigint $PID
|
||||
kill -sigint $PID
|
||||
else
|
||||
sudo kill -9 $PID
|
||||
kill -9 $PID
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -40,9 +40,20 @@ cd .
|
|||
# Get responsible directories
|
||||
CODE_DIR=`dirname $0`
|
||||
CODE_DIR=`pwd`
|
||||
cd ../../
|
||||
|
||||
TDINTERNAL="TDinternal"
|
||||
if [[ "$CODE_DIR" == *"$TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
else
|
||||
cd ../../
|
||||
fi
|
||||
|
||||
TOP_DIR=`pwd`
|
||||
BUILD_DIR=$TOP_DIR/debug/build
|
||||
|
||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
||||
|
||||
BUILD_DIR=$TOP_DIR/$BIN_DIR
|
||||
|
||||
SIM_DIR=$TOP_DIR/sim
|
||||
|
||||
if [ $ASYNC -eq 0 ]; then
|
||||
|
@ -51,11 +62,6 @@ else
|
|||
PROGRAM="$BUILD_DIR/bin/tsim -a"
|
||||
fi
|
||||
|
||||
if [ $UNIQUE -eq 0 ]; then
|
||||
PROGRAM=$BUILD_DIR/bin/tsim
|
||||
else
|
||||
PROGRAM="$TOP_DIR/../debug/build/bin/tsim"
|
||||
fi
|
||||
|
||||
PRG_DIR=$SIM_DIR/tsim
|
||||
CFG_DIR=$PRG_DIR/cfg
|
||||
|
|
|
@ -9,10 +9,10 @@ NC='\033[0m'
|
|||
|
||||
echo "### run TSIM script ###"
|
||||
cd script
|
||||
./test.sh -f basicSuite.sim 2>&1 | grep 'success\|failed\|fault' | grep -v 'default' | tee out.txt
|
||||
./test.sh -f basicSuite.sim 2>&1 | grep 'success\|failed\|fault' | grep -v 'default' | tee out.log
|
||||
|
||||
totalSuccess=`grep 'success' out.txt | wc -l`
|
||||
totalBasic=`grep success out.txt | grep Suite | wc -l`
|
||||
totalSuccess=`grep 'success' out.log | wc -l`
|
||||
totalBasic=`grep success out.log | grep Suite | wc -l`
|
||||
|
||||
if [ "$totalSuccess" -gt "0" ]; then
|
||||
totalSuccess=`expr $totalSuccess - $totalBasic`
|
||||
|
@ -20,7 +20,7 @@ fi
|
|||
|
||||
echo -e "${GREEN} ### Total $totalSuccess TSIM case(s) succeed! ### ${NC}"
|
||||
|
||||
totalFailed=`grep 'failed\|fault' out.txt | wc -l`
|
||||
totalFailed=`grep 'failed\|fault' out.log | wc -l`
|
||||
# echo -e "${RED} ### Total $totalFailed TSIM case(s) failed! ### ${NC}"
|
||||
|
||||
if [ "$totalFailed" -ne "0" ]; then
|
||||
|
@ -33,17 +33,17 @@ echo "### run Python script ###"
|
|||
cd ../pytest
|
||||
|
||||
if [ "$1" == "cron" ]; then
|
||||
./fulltest.sh 2>&1 | grep 'successfully executed\|failed\|fault' | grep -v 'default'| tee pytest-out.txt
|
||||
./fulltest.sh 2>&1 | grep 'successfully executed\|failed\|fault' | grep -v 'default'| tee pytest-out.log
|
||||
else
|
||||
./smoketest.sh 2>&1 | grep 'successfully executed\|failed\|fault' | grep -v 'default'| tee pytest-out.txt
|
||||
./smoketest.sh 2>&1 | grep 'successfully executed\|failed\|fault' | grep -v 'default'| tee pytest-out.log
|
||||
fi
|
||||
totalPySuccess=`grep 'successfully executed' pytest-out.txt | wc -l`
|
||||
totalPySuccess=`grep 'successfully executed' pytest-out.log | wc -l`
|
||||
|
||||
if [ "$totalPySuccess" -gt "0" ]; then
|
||||
echo -e "${GREEN} ### Total $totalPySuccess python case(s) succeed! ### ${NC}"
|
||||
fi
|
||||
|
||||
totalPyFailed=`grep 'failed\|fault' pytest-out.txt | wc -l`
|
||||
totalPyFailed=`grep 'failed\|fault' pytest-out.log | wc -l`
|
||||
if [ "$totalPyFailed" -ne "0" ]; then
|
||||
echo -e "${RED} ### Total $totalPyFailed python case(s) failed! ### ${NC}"
|
||||
# exit $totalPyFailed
|
||||
|
|
Loading…
Reference in New Issue