提交 9ea0e2f7 编写于 作者: S Shuduo Sang

fix test scripts according to jeff's suggestion.

上级 423fa696
...@@ -51,7 +51,7 @@ matrix: ...@@ -51,7 +51,7 @@ matrix:
./test-all.sh $TRAVIS_EVENT_TYPE || travis_terminate $? ./test-all.sh $TRAVIS_EVENT_TYPE || travis_terminate $?
cd ${TRAVIS_BUILD_DIR}/tests/pytest 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 sleep 1
# Color setting # Color setting
...@@ -61,9 +61,9 @@ matrix: ...@@ -61,9 +61,9 @@ matrix:
GREEN_UNDERLINE='\033[4;32m' GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m' 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 do
if [ -n "$memError" ]; then if [ -n "$memError" ]; then
if [ "$memError" -gt 12 ]; then if [ "$memError" -gt 12 ]; then
...@@ -74,8 +74,8 @@ matrix: ...@@ -74,8 +74,8 @@ matrix:
fi fi
done done
grep 'start to execute\|definitely lost:' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-definitely-lost-out.txt 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.txt | awk '{print $7}'` for defiMemError in `grep 'definitely lost:' uniq-definitely-lost-out.log | awk '{print $7}'`
do do
if [ -n "$defiMemError" ]; then if [ -n "$defiMemError" ]; then
if [ "$defiMemError" -gt 13 ]; then if [ "$defiMemError" -gt 13 ]; then
......
#!/bin/bash #!/bin/bash
ulimit -c unlimited
python3 ./test.py -f insert/basic.py python3 ./test.py -f insert/basic.py
python3 ./test.py -f insert/int.py python3 ./test.py -f insert/int.py
python3 ./test.py -f insert/float.py python3 ./test.py -f insert/float.py
......
#!/bin/bash #!/bin/bash
ulimit -c unlimited
# insert # insert
python3 ./test.py $1 -f insert/basic.py python3 ./test.py $1 -f insert/basic.py
python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -s && sleep 1
......
...@@ -38,9 +38,9 @@ class TDSimClient: ...@@ -38,9 +38,9 @@ class TDSimClient:
tdLog.exit(cmd) tdLog.exit(cmd)
def deploy(self): def deploy(self):
self.logDir = "%s/pysim/psim/log" % (self.path,) self.logDir = "%s/sim/psim/log" % (self.path,)
self.cfgDir = "%s/pysim/psim/cfg" % (self.path) self.cfgDir = "%s/sim/psim/cfg" % (self.path)
self.cfgPath = "%s/pysim/psim/cfg/taos.cfg" % (self.path) self.cfgPath = "%s/sim/psim/cfg/taos.cfg" % (self.path)
cmd = "rm -rf " + self.logDir cmd = "rm -rf " + self.logDir
if os.system(cmd) != 0: if os.system(cmd) != 0:
...@@ -113,10 +113,10 @@ class TDDnode: ...@@ -113,10 +113,10 @@ class TDDnode:
return totalSize return totalSize
def deploy(self): def deploy(self):
self.logDir = "%s/pysim/dnode%d/log" % (self.path, self.index) self.logDir = "%s/sim/dnode%d/log" % (self.path, self.index)
self.dataDir = "%s/pysim/dnode%d/data" % (self.path, self.index) self.dataDir = "%s/sim/dnode%d/data" % (self.path, self.index)
self.cfgDir = "%s/pysim/dnode%d/cfg" % (self.path, self.index) self.cfgDir = "%s/sim/dnode%d/cfg" % (self.path, self.index)
self.cfgPath = "%s/pysim/dnode%d/cfg/taos.cfg" % ( self.cfgPath = "%s/sim/dnode%d/cfg/taos.cfg" % (
self.path, self.index) self.path, self.index)
cmd = "rm -rf " + self.dataDir cmd = "rm -rf " + self.dataDir
...@@ -298,11 +298,11 @@ class TDDnode: ...@@ -298,11 +298,11 @@ class TDDnode:
tdLog.exit(cmd) tdLog.exit(cmd)
def getDnodeRootDir(self, index): def getDnodeRootDir(self, index):
dnodeRootDir = "%s/pysim/psim/dnode%d" % (self.path, index) dnodeRootDir = "%s/sim/psim/dnode%d" % (self.path, index)
return dnodeRootDir return dnodeRootDir
def getDnodesRootDir(self): def getDnodesRootDir(self):
dnodesRootDir = "%s/pysim/psim" % (self.path) dnodesRootDir = "%s/sim/psim" % (self.path)
return dnodesRootDir return dnodesRootDir
...@@ -455,7 +455,7 @@ class TDDnodes: ...@@ -455,7 +455,7 @@ class TDDnodes:
# tdLog.exit(cmd) # tdLog.exit(cmd)
def getDnodesRootDir(self): def getDnodesRootDir(self):
dnodesRootDir = "%s/pysim" % (self.path) dnodesRootDir = "%s/sim" % (self.path)
return dnodesRootDir return dnodesRootDir
def getSimCfgPath(self): def getSimCfgPath(self):
......
#!/bin/sh #!/bin/bash
if [ $# != 6 ]; then if [ $# != 6 ]; then
echo "argument list need input : " echo "argument list need input : "
...@@ -33,10 +33,19 @@ SCRIPT_DIR=`dirname $0` ...@@ -33,10 +33,19 @@ SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
cd ../../ TDINTERNAL="TDinternal"
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
cd ../../..
else
cd ../../
fi
TAOS_DIR=`pwd` 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 SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/$NODE_NAME NODE_DIR=$SIM_DIR/$NODE_NAME
......
...@@ -36,12 +36,20 @@ cd $SCRIPT_DIR/../ ...@@ -36,12 +36,20 @@ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
echo "SCRIPT_DIR: $SCRIPT_DIR" echo "SCRIPT_DIR: $SCRIPT_DIR"
cd ../../ TDINTERNAL="TDinternal"
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
cd ../../..
else
cd ../../
fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
BUILD_DIR=$TAOS_DIR/debug/build BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
SIM_DIR=$TAOS_DIR/sim
BUILD_DIR=$TAOS_DIR/$BIN_DIR
SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/$NODE_NAME NODE_DIR=$SIM_DIR/$NODE_NAME
EXE_DIR=$BUILD_DIR/bin EXE_DIR=$BUILD_DIR/bin
CFG_DIR=$NODE_DIR/cfg CFG_DIR=$NODE_DIR/cfg
......
#!/bin/sh #!/bin/bash
echo "Executing deploy.sh" echo "Executing deploy.sh"
...@@ -31,10 +31,19 @@ cd $SCRIPT_DIR/../ ...@@ -31,10 +31,19 @@ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
echo "SCRIPT_DIR: $SCRIPT_DIR" echo "SCRIPT_DIR: $SCRIPT_DIR"
cd ../../ TDINTERNAL="TDinternal"
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
cd ../../..
else
cd ../../
fi
TAOS_DIR=`pwd` 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 SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/$NODE_NAME NODE_DIR=$SIM_DIR/$NODE_NAME
......
#!/bin/sh #!/bin/bash
# if [ $# != 4 || $# != 5 ]; then # if [ $# != 4 || $# != 5 ]; then
# echo "argument list need input : " # echo "argument list need input : "
...@@ -42,10 +42,19 @@ SCRIPT_DIR=`dirname $0` ...@@ -42,10 +42,19 @@ SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
cd ../../ TDINTERNAL="TDinternal"
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
cd ../../..
else
cd ../../
fi
TAOS_DIR=`pwd` 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 SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/$NODE_NAME NODE_DIR=$SIM_DIR/$NODE_NAME
EXE_DIR=$BUILD_DIR/bin EXE_DIR=$BUILD_DIR/bin
...@@ -86,9 +95,9 @@ else ...@@ -86,9 +95,9 @@ else
if [ -n "$PID" ]; then if [ -n "$PID" ]; then
if [ "$SIGNAL" = "SIGINT" ]; then if [ "$SIGNAL" = "SIGINT" ]; then
echo killed by signal echo killed by signal
sudo kill -sigint $PID kill -sigint $PID
else else
sudo kill -9 $PID kill -9 $PID
fi fi
fi fi
fi fi
......
...@@ -39,10 +39,19 @@ SCRIPT_DIR=`dirname $0` ...@@ -39,10 +39,19 @@ SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
cd ../../ TDINTERNAL="TDinternal"
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
cd ../../..
else
cd ../../
fi
TAOS_DIR=`pwd` 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 SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/arbitrator NODE_DIR=$SIM_DIR/arbitrator
EXE_DIR=$BUILD_DIR/bin EXE_DIR=$BUILD_DIR/bin
...@@ -57,8 +66,8 @@ else ...@@ -57,8 +66,8 @@ else
#relative path #relative path
PID=`ps -ef|grep tarbitrator | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep tarbitrator | grep -v grep | awk '{print $2}'`
if [ -n "$PID" ]; then if [ -n "$PID" ]; then
sudo kill -9 $PID kill -9 $PID
sudo pkill -9 tarbitrator pkill -9 tarbitrator
fi fi
fi fi
...@@ -42,10 +42,19 @@ SCRIPT_DIR=`dirname $0` ...@@ -42,10 +42,19 @@ SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
cd ../../ TDINTERNAL="TDinternal"
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
cd ../../..
else
cd ../../
fi
TAOS_DIR=`pwd` 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 SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/$NODE_NAME NODE_DIR=$SIM_DIR/$NODE_NAME
EXE_DIR=$BUILD_DIR/bin EXE_DIR=$BUILD_DIR/bin
...@@ -91,9 +100,9 @@ else ...@@ -91,9 +100,9 @@ else
if [ -n "$PID" ]; then if [ -n "$PID" ]; then
if [ "$SIGNAL" = "SIGINT" ]; then if [ "$SIGNAL" = "SIGINT" ]; then
echo killed by signal echo killed by signal
sudo kill -sigint $PID kill -sigint $PID
else else
sudo kill -9 $PID kill -9 $PID
fi fi
fi fi
fi fi
......
...@@ -40,9 +40,20 @@ cd . ...@@ -40,9 +40,20 @@ cd .
# Get responsible directories # Get responsible directories
CODE_DIR=`dirname $0` CODE_DIR=`dirname $0`
CODE_DIR=`pwd` CODE_DIR=`pwd`
cd ../../
TDINTERNAL="TDinternal"
if [[ "$CODE_DIR" == *"$TDINTERNAL"* ]]; then
cd ../../..
else
cd ../../
fi
TOP_DIR=`pwd` 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 SIM_DIR=$TOP_DIR/sim
if [ $ASYNC -eq 0 ]; then if [ $ASYNC -eq 0 ]; then
...@@ -51,11 +62,6 @@ else ...@@ -51,11 +62,6 @@ else
PROGRAM="$BUILD_DIR/bin/tsim -a" PROGRAM="$BUILD_DIR/bin/tsim -a"
fi 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 PRG_DIR=$SIM_DIR/tsim
CFG_DIR=$PRG_DIR/cfg CFG_DIR=$PRG_DIR/cfg
......
...@@ -9,10 +9,10 @@ NC='\033[0m' ...@@ -9,10 +9,10 @@ NC='\033[0m'
echo "### run TSIM script ###" echo "### run TSIM script ###"
cd 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` totalSuccess=`grep 'success' out.log | wc -l`
totalBasic=`grep success out.txt | grep Suite | wc -l` totalBasic=`grep success out.log | grep Suite | wc -l`
if [ "$totalSuccess" -gt "0" ]; then if [ "$totalSuccess" -gt "0" ]; then
totalSuccess=`expr $totalSuccess - $totalBasic` totalSuccess=`expr $totalSuccess - $totalBasic`
...@@ -20,7 +20,7 @@ fi ...@@ -20,7 +20,7 @@ fi
echo -e "${GREEN} ### Total $totalSuccess TSIM case(s) succeed! ### ${NC}" 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}" # echo -e "${RED} ### Total $totalFailed TSIM case(s) failed! ### ${NC}"
if [ "$totalFailed" -ne "0" ]; then if [ "$totalFailed" -ne "0" ]; then
...@@ -33,17 +33,17 @@ echo "### run Python script ###" ...@@ -33,17 +33,17 @@ echo "### run Python script ###"
cd ../pytest cd ../pytest
if [ "$1" == "cron" ]; then 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 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 fi
totalPySuccess=`grep 'successfully executed' pytest-out.txt | wc -l` totalPySuccess=`grep 'successfully executed' pytest-out.log | wc -l`
if [ "$totalPySuccess" -gt "0" ]; then if [ "$totalPySuccess" -gt "0" ]; then
echo -e "${GREEN} ### Total $totalPySuccess python case(s) succeed! ### ${NC}" echo -e "${GREEN} ### Total $totalPySuccess python case(s) succeed! ### ${NC}"
fi fi
totalPyFailed=`grep 'failed\|fault' pytest-out.txt | wc -l` totalPyFailed=`grep 'failed\|fault' pytest-out.log | wc -l`
if [ "$totalPyFailed" -ne "0" ]; then if [ "$totalPyFailed" -ne "0" ]; then
echo -e "${RED} ### Total $totalPyFailed python case(s) failed! ### ${NC}" echo -e "${RED} ### Total $totalPyFailed python case(s) failed! ### ${NC}"
# exit $totalPyFailed # exit $totalPyFailed
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册