提交 15c0bb94 编写于 作者: S Shengliang Guan

test: python asan

上级 4dc1b334
...@@ -162,6 +162,10 @@ class TDDnode: ...@@ -162,6 +162,10 @@ class TDDnode:
def setAsan(self, value): def setAsan(self, value):
self.asan = value self.asan = value
if value: if value:
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") self.execPath = os.path.abspath(self.path + "/tests/script/sh/exec.sh")
def getDataSize(self): def getDataSize(self):
...@@ -670,6 +674,11 @@ class TDDnodes: ...@@ -670,6 +674,11 @@ class TDDnodes:
def setAsan(self, value): def setAsan(self, value):
self.asan = value self.asan = value
if value: if value:
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.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") self.stopDnodesSigintPath = os.path.abspath(self.path + "/tests/script/sh/sigint_stop_dnodes.sh")
tdLog.info("run in address sanitizer mode") tdLog.info("run in address sanitizer mode")
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
set +e set +e
#set -x #set -x
export LD_PRELOAD= unset LD_PRELOAD
SCRIPT_DIR=`dirname $0` SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd` SCRIPT_DIR=`pwd`
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
set +e set +e
#set -x #set -x
export LD_PRELOAD= unset LD_PRELOAD
UNAME_BIN=`which uname` UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN` OS_TYPE=`$UNAME_BIN`
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
set +e set +e
#set -x #set -x
export LD_PRELOAD= unset LD_PRELOAD
UNAME_BIN=`which uname` UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN` OS_TYPE=`$UNAME_BIN`
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
set +e set +e
#set -x #set -x
export LD_PRELOAD= unset LD_PRELOAD
UNAME_BIN=`which uname` UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN` OS_TYPE=`$UNAME_BIN`
......
...@@ -69,10 +69,11 @@ echo "ExcuteCmd:" $* ...@@ -69,10 +69,11 @@ echo "ExcuteCmd:" $*
AsanFile=$ASAN_DIR/psim.asan AsanFile=$ASAN_DIR/psim.asan
echo "AsanFile:" $AsanFile echo "AsanFile:" $AsanFile
unset LD_PRELOAD
export LD_PRELOAD=libasan.so.5 export LD_PRELOAD=libasan.so.5
$* -a 2> $AsanFile $* -a 2> $AsanFile
export LD_PRELOAD= unset LD_PRELOAD
AsanFileLen=`cat $AsanFile | wc -l` AsanFileLen=`cat $AsanFile | wc -l`
while [ $AsanFileLen -lt 10 ] while [ $AsanFileLen -lt 10 ]
do do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册