test: python asan
This commit is contained in:
parent
ed7eb1cbf1
commit
4dc1b33414
|
@ -3,6 +3,7 @@
|
|||
set +e
|
||||
#set -x
|
||||
|
||||
export LD_PRELOAD=
|
||||
SCRIPT_DIR=`dirname $0`
|
||||
cd $SCRIPT_DIR/../
|
||||
SCRIPT_DIR=`pwd`
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
set +e
|
||||
#set -x
|
||||
|
||||
export LD_PRELOAD=
|
||||
UNAME_BIN=`which uname`
|
||||
OS_TYPE=`$UNAME_BIN`
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
set +e
|
||||
#set -x
|
||||
|
||||
export LD_PRELOAD=
|
||||
UNAME_BIN=`which uname`
|
||||
OS_TYPE=`$UNAME_BIN`
|
||||
|
||||
export LD_PRELOAD=
|
||||
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
|
||||
if [ -n "$PID" ]; then
|
||||
echo systemctl stop taosd
|
||||
|
|
|
@ -555,5 +555,5 @@ if __name__ == "__main__":
|
|||
conn.close()
|
||||
if asan:
|
||||
tdDnodes.StopAllSigint()
|
||||
tdLog.info("address sanitizer mode finished")
|
||||
tdLog.info("Address sanitizer mode finished")
|
||||
sys.exit(0)
|
||||
|
|
|
@ -45,13 +45,11 @@ declare -x SIM_DIR=$TOP_DIR/sim
|
|||
PROGRAM=$BUILD_DIR/build/bin/tsim
|
||||
PRG_DIR=$SIM_DIR/tsim
|
||||
ASAN_DIR=$SIM_DIR/asan
|
||||
SYSTEM_TEST_DIR=$CODE_DIR/tests/system-test
|
||||
|
||||
chmod -R 777 $PRG_DIR
|
||||
echo "------------------------------------------------------------------------"
|
||||
echo "Start TDengine Testing Case ..."
|
||||
echo "BUILD_DIR: $BUILD_DIR"
|
||||
echo "SYSTEM_TEST_DIR : $SYSTEM_TEST_DIR"
|
||||
echo "SIM_DIR : $SIM_DIR"
|
||||
echo "CODE_DIR : $CODE_DIR"
|
||||
echo "ASAN_DIR : $ASAN_DIR"
|
||||
|
@ -61,24 +59,36 @@ rm -rf $SIM_DIR/*
|
|||
mkdir -p $PRG_DIR
|
||||
mkdir -p $ASAN_DIR
|
||||
|
||||
cd $SYSTEM_TEST_DIR
|
||||
cd $CODE_DIR
|
||||
ulimit -n 600000
|
||||
ulimit -c unlimited
|
||||
|
||||
#sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
|
||||
|
||||
echo "ExcuteCmd:" $*
|
||||
echo "AsanDir:" $ASAN_DIR/psim.info
|
||||
AsanFile=$ASAN_DIR/psim.asan
|
||||
echo "AsanFile:" $AsanFile
|
||||
|
||||
export LD_PRELOAD=libasan.so.5
|
||||
$* -a 2> $ASAN_DIR/psim.info
|
||||
$* -a 2> $AsanFile
|
||||
|
||||
result=$?
|
||||
echo "Execute result:" $result
|
||||
export LD_PRELOAD=
|
||||
AsanFileLen=`cat $AsanFile | wc -l`
|
||||
while [ $AsanFileLen -lt 10 ]
|
||||
do
|
||||
sleep 1
|
||||
`cat $AsanFile | wc -l`
|
||||
done
|
||||
echo "AsanFileLen:" $AsanFileLen
|
||||
|
||||
if [ $result -eq 0 ]; then
|
||||
$CODE_DIR/tests/script/sh/checkAsan.sh
|
||||
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
|
||||
echo "Execute script failure"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue