提交 4dc1b334 编写于 作者: S Shengliang Guan

test: python asan

上级 ed7eb1cb
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
set +e set +e
#set -x #set -x
export LD_PRELOAD=
SCRIPT_DIR=`dirname $0` SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
set +e set +e
#set -x #set -x
export LD_PRELOAD=
UNAME_BIN=`which uname` UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN` OS_TYPE=`$UNAME_BIN`
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
set +e set +e
#set -x #set -x
export LD_PRELOAD=
UNAME_BIN=`which uname` UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN` OS_TYPE=`$UNAME_BIN`
export LD_PRELOAD=
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'` PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
if [ -n "$PID" ]; then if [ -n "$PID" ]; then
echo systemctl stop taosd echo systemctl stop taosd
......
...@@ -555,5 +555,5 @@ if __name__ == "__main__": ...@@ -555,5 +555,5 @@ if __name__ == "__main__":
conn.close() conn.close()
if asan: if asan:
tdDnodes.StopAllSigint() tdDnodes.StopAllSigint()
tdLog.info("address sanitizer mode finished") tdLog.info("Address sanitizer mode finished")
sys.exit(0) sys.exit(0)
...@@ -45,13 +45,11 @@ declare -x SIM_DIR=$TOP_DIR/sim ...@@ -45,13 +45,11 @@ declare -x SIM_DIR=$TOP_DIR/sim
PROGRAM=$BUILD_DIR/build/bin/tsim PROGRAM=$BUILD_DIR/build/bin/tsim
PRG_DIR=$SIM_DIR/tsim PRG_DIR=$SIM_DIR/tsim
ASAN_DIR=$SIM_DIR/asan ASAN_DIR=$SIM_DIR/asan
SYSTEM_TEST_DIR=$CODE_DIR/tests/system-test
chmod -R 777 $PRG_DIR chmod -R 777 $PRG_DIR
echo "------------------------------------------------------------------------" echo "------------------------------------------------------------------------"
echo "Start TDengine Testing Case ..." echo "Start TDengine Testing Case ..."
echo "BUILD_DIR: $BUILD_DIR" echo "BUILD_DIR: $BUILD_DIR"
echo "SYSTEM_TEST_DIR : $SYSTEM_TEST_DIR"
echo "SIM_DIR : $SIM_DIR" echo "SIM_DIR : $SIM_DIR"
echo "CODE_DIR : $CODE_DIR" echo "CODE_DIR : $CODE_DIR"
echo "ASAN_DIR : $ASAN_DIR" echo "ASAN_DIR : $ASAN_DIR"
...@@ -61,24 +59,36 @@ rm -rf $SIM_DIR/* ...@@ -61,24 +59,36 @@ rm -rf $SIM_DIR/*
mkdir -p $PRG_DIR mkdir -p $PRG_DIR
mkdir -p $ASAN_DIR mkdir -p $ASAN_DIR
cd $SYSTEM_TEST_DIR cd $CODE_DIR
ulimit -n 600000 ulimit -n 600000
ulimit -c unlimited ulimit -c unlimited
#sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e #sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
echo "ExcuteCmd:" $* echo "ExcuteCmd:" $*
echo "AsanDir:" $ASAN_DIR/psim.info AsanFile=$ASAN_DIR/psim.asan
echo "AsanFile:" $AsanFile
export LD_PRELOAD=libasan.so.5 export LD_PRELOAD=libasan.so.5
$* -a 2> $ASAN_DIR/psim.info $* -a 2> $AsanFile
result=$? export LD_PRELOAD=
echo "Execute result:" $result AsanFileLen=`cat $AsanFile | wc -l`
while [ $AsanFileLen -lt 10 ]
if [ $result -eq 0 ]; then do
$CODE_DIR/tests/script/sh/checkAsan.sh sleep 1
`cat $AsanFile | wc -l`
done
echo "AsanFileLen:" $AsanFileLen
AsanFileSuccessLen=`grep -w successfully $AsanFile | wc -l`
echo "AsanFileSuccessLen:" $AsanFileSuccessLen
if [ $AsanFileSuccessLen -gt 0 ]; then
echo "Execute script successfully and check asan"
$CODE_DIR/../script/sh/checkAsan.sh
else else
echo "Execute script failure"
exit 1 exit 1
fi fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册