diff --git a/tests/develop-test/3-connectors/java/test.sh b/tests/develop-test/3-connectors/java/test.sh index 8b43d1a44391c832735b5649258c1131f1133794..9a3e7cbb085d3214dce6c19cdd9aee3bced1dc09 100755 --- a/tests/develop-test/3-connectors/java/test.sh +++ b/tests/develop-test/3-connectors/java/test.sh @@ -1,20 +1,28 @@ #!/bin/bash -function stopTaosd { - echo "Stop taosd" - sudo systemctl stop taosd || echo 'no sudo or systemctl or stop fail' - PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + +function stopProcess { + echo "Stop $1" + sudo systemctl stop $1 || echo 'no sudo or systemctl or stop fail' + PID=`ps -ef|grep -w $1 | grep -v grep | awk '{print $2}'` while [ -n "$PID" ] do - pkill -TERM -x taosd + pkill -TERM -x $1 sleep 1 - PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'` + PID=`ps -ef|grep -w $1 | grep -v grep | awk '{print $2}'` done } -stopTaosd + +stopProcess taosadapter +stopProcess taosd rm -rf /var/lib/taos/* rm -rf /var/log/taos/* -nohup taosd -c /etc/taos/ > /dev/null 2>&1 & -nohup taosadapter -c /etc/taos/taosadapter.toml > /dev/null 2>&1 & + +curDir=$(dirname $(readlink -f "$0")) +taosdConfig=$curDir/../../../../packaging/cfg +adapterConfig=$curDir/../../../../src/plugins/taosadapter/example/config/taosadapter.toml + +nohup taosd -c ${taosdConfig} > /dev/null 2>&1 & +nohup taosadapter -c ${adapterConfig} > /dev/null 2>&1 & sleep 10 cd ../../../../