test: python asan

This commit is contained in:
Shengliang Guan 2022-11-20 21:26:54 +08:00
parent 4dc1b33414
commit 15c0bb9446
6 changed files with 18 additions and 8 deletions

View File

@ -162,7 +162,11 @@ class TDDnode:
def setAsan(self, value):
self.asan = value
if value:
self.execPath = os.path.abspath(self.path + "/tests/script/sh/exec.sh")
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
self.execPath = os.path.abspath(self.path + "/community/tests/script/sh/exec.sh")
else:
self.execPath = os.path.abspath(self.path + "/tests/script/sh/exec.sh")
def getDataSize(self):
totalSize = 0
@ -670,8 +674,13 @@ class TDDnodes:
def setAsan(self, value):
self.asan = value
if value:
self.stopDnodesPath = os.path.abspath(self.path + "/tests/script/sh/stop_dnodes.sh")
self.stopDnodesSigintPath = os.path.abspath(self.path + "/tests/script/sh/sigint_stop_dnodes.sh")
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
self.stopDnodesPath = os.path.abspath(self.path + "/community/tests/script/sh/stop_dnodes.sh")
self.stopDnodesSigintPath = os.path.abspath(self.path + "/community/tests/script/sh/sigint_stop_dnodes.sh")
else:
self.stopDnodesPath = os.path.abspath(self.path + "/tests/script/sh/stop_dnodes.sh")
self.stopDnodesSigintPath = os.path.abspath(self.path + "/tests/script/sh/sigint_stop_dnodes.sh")
tdLog.info("run in address sanitizer mode")
def setKillValgrind(self, value):

View File

@ -3,7 +3,7 @@
set +e
#set -x
export LD_PRELOAD=
unset LD_PRELOAD
SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd`

View File

@ -11,7 +11,7 @@
set +e
#set -x
export LD_PRELOAD=
unset LD_PRELOAD
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`

View File

@ -3,7 +3,7 @@
set +e
#set -x
export LD_PRELOAD=
unset LD_PRELOAD
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`

View File

@ -3,7 +3,7 @@
set +e
#set -x
export LD_PRELOAD=
unset LD_PRELOAD
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`

View File

@ -69,10 +69,11 @@ echo "ExcuteCmd:" $*
AsanFile=$ASAN_DIR/psim.asan
echo "AsanFile:" $AsanFile
unset LD_PRELOAD
export LD_PRELOAD=libasan.so.5
$* -a 2> $AsanFile
export LD_PRELOAD=
unset LD_PRELOAD
AsanFileLen=`cat $AsanFile | wc -l`
while [ $AsanFileLen -lt 10 ]
do