Merge pull request #29372 from freemine/freemine.test.script.bug.fix
fix ps/grep/kill flaws found in test.script
This commit is contained in:
commit
3095542c64
|
@ -7,13 +7,21 @@ unset LD_PRELOAD
|
||||||
UNAME_BIN=`which uname`
|
UNAME_BIN=`which uname`
|
||||||
OS_TYPE=`$UNAME_BIN`
|
OS_TYPE=`$UNAME_BIN`
|
||||||
|
|
||||||
|
psby() {
|
||||||
|
if [ "$OS_TYPE" != "Darwin" ]; then
|
||||||
|
ps -C $1
|
||||||
|
else
|
||||||
|
ps a -c
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
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
|
||||||
systemctl stop taosd
|
systemctl stop taosd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PID=`ps -ef|grep -w taosd | grep -v grep | grep -v taosanode | awk '{print $2}'`
|
PID=`psby taosd | grep -w "[t]aosd" | awk '{print $1}' | head -n 1`
|
||||||
while [ -n "$PID" ]; do
|
while [ -n "$PID" ]; do
|
||||||
echo kill -9 $PID
|
echo kill -9 $PID
|
||||||
#pkill -9 taosd
|
#pkill -9 taosd
|
||||||
|
@ -24,10 +32,10 @@ while [ -n "$PID" ]; do
|
||||||
else
|
else
|
||||||
lsof -nti:6030 | xargs kill -9
|
lsof -nti:6030 | xargs kill -9
|
||||||
fi
|
fi
|
||||||
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
PID=`psby taosd | grep -w "[t]aosd" | awk '{print $1}' | head -n 1`
|
||||||
done
|
done
|
||||||
|
|
||||||
PID=`ps -ef|grep -w taos | grep -v grep | grep -v taosanode|awk '{print $2}'`
|
PID=`psby taos | grep -w "[t]aos" | awk '{print $1}' | head -n 1`
|
||||||
while [ -n "$PID" ]; do
|
while [ -n "$PID" ]; do
|
||||||
echo kill -9 $PID
|
echo kill -9 $PID
|
||||||
#pkill -9 taos
|
#pkill -9 taos
|
||||||
|
@ -38,10 +46,10 @@ while [ -n "$PID" ]; do
|
||||||
else
|
else
|
||||||
lsof -nti:6030 | xargs kill -9
|
lsof -nti:6030 | xargs kill -9
|
||||||
fi
|
fi
|
||||||
PID=`ps -ef|grep -w taos | grep -v grep |grep -v taosanode| awk '{print $2}'`
|
PID=`psby taos | grep -w "[t]aos" | awk '{print $1}' | head -n 1`
|
||||||
done
|
done
|
||||||
|
|
||||||
PID=`ps -ef|grep -w tmq_sim | grep -v grep | grep -v taosanode|awk '{print $2}'`
|
PID=`psby tmq_sim | grep -w "[t]mq_sim" | awk '{print $1}' | head -n 1`
|
||||||
while [ -n "$PID" ]; do
|
while [ -n "$PID" ]; do
|
||||||
echo kill -9 $PID
|
echo kill -9 $PID
|
||||||
#pkill -9 tmq_sim
|
#pkill -9 tmq_sim
|
||||||
|
@ -52,5 +60,5 @@ while [ -n "$PID" ]; do
|
||||||
else
|
else
|
||||||
lsof -nti:6030 | xargs kill -9
|
lsof -nti:6030 | xargs kill -9
|
||||||
fi
|
fi
|
||||||
PID=`ps -ef|grep -w tmq_sim | grep -v grep | grep -v taosanode| awk '{print $2}'`
|
PID=`psby tmq_sim | grep -w "[t]mq_sim" | awk '{print $1}' | head -n 1`
|
||||||
done
|
done
|
||||||
|
|
|
@ -43,9 +43,9 @@ CODE_DIR=`pwd`
|
||||||
|
|
||||||
IN_TDINTERNAL="community"
|
IN_TDINTERNAL="community"
|
||||||
if [[ "$CODE_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$CODE_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
cd ../../..
|
pushd ../../..
|
||||||
else
|
else
|
||||||
cd ../../
|
pushd ../../
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TOP_DIR=`pwd`
|
TOP_DIR=`pwd`
|
||||||
|
@ -119,6 +119,8 @@ 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
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
||||||
if [ -n "$FILE_NAME" ]; then
|
if [ -n "$FILE_NAME" ]; then
|
||||||
echo "------------------------------------------------------------------------"
|
echo "------------------------------------------------------------------------"
|
||||||
if [ $VALGRIND -eq 1 ]; then
|
if [ $VALGRIND -eq 1 ]; then
|
||||||
|
|
Loading…
Reference in New Issue