提交 1eace47c 编写于 作者: S Shengliang Guan

TD-1207

上级 f6e18e01
...@@ -20,8 +20,10 @@ ...@@ -20,8 +20,10 @@
extern "C" { extern "C" {
#endif #endif
#ifndef O_BINARY #ifndef WINDOWS
#ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0
#endif
#endif #endif
#ifndef STDERR_FILENO #ifndef STDERR_FILENO
......
wtest.bat -f issue/TD-2677.sim
wtest.bat -f issue/TD-2680.sim
wtest.bat -f issue/TD-2713.sim
wtest.bat -f general/alter/cached_schema_after_alter.sim
wtest.bat -f general/alter/count.sim
wtest.bat -f general/alter/dnode.sim
wtest.bat -f general/alter/import.sim
wtest.bat -f general/alter/insert1.sim
wtest.bat -f general/alter/insert2.sim
wtest.bat -f general/alter/metrics.sim
wtest.bat -f general/alter/table.sim
wtest.bat -f general/cache/new_metrics.sim
wtest.bat -f general/cache/restart_metrics.sim
wtest.bat -f general/cache/restart_table.sim
wtest.bat -f general/connection/connection.sim
wtest.bat -f general/column/commit.sim
wtest.bat -f general/column/metrics.sim
wtest.bat -f general/column/table.sim
wtest.bat -f general/compress/commitlog.sim
wtest.bat -f general/compress/compress.sim
wtest.bat -f general/compress/compress2.sim
wtest.bat -f general/compress/uncompress.sim
wtest.bat -f general/compute/avg.sim
wtest.bat -f general/compute/bottom.sim
wtest.bat -f general/compute/count.sim
wtest.bat -f general/compute/diff.sim
wtest.bat -f general/compute/diff2.sim
wtest.bat -f general/compute/first.sim
wtest.bat -f general/compute/interval.sim
wtest.bat -f general/compute/last.sim
wtest.bat -f general/compute/leastsquare.sim
wtest.bat -f general/compute/max.sim
wtest.bat -f general/compute/min.sim
wtest.bat -f general/compute/null.sim
wtest.bat -f general/compute/percentile.sim
wtest.bat -f general/compute/stddev.sim
wtest.bat -f general/compute/sum.sim
wtest.bat -f general/compute/top.sim
wtest.bat -f general/db/alter_option.sim
wtest.bat -f general/db/alter_tables_d2.sim
wtest.bat -f general/db/alter_tables_v1.sim
wtest.bat -f general/db/alter_tables_v4.sim
wtest.bat -f general/db/alter_vgroups.sim
wtest.bat -f general/db/basic.sim
wtest.bat -f general/db/basic1.sim
wtest.bat -f general/db/basic2.sim
wtest.bat -f general/db/basic3.sim
wtest.bat -f general/db/basic4.sim
wtest.bat -f general/db/basic5.sim
wtest.bat -f general/db/delete_reuse1.sim
wtest.bat -f general/db/delete_reuse2.sim
wtest.bat -f general/db/delete_reusevnode.sim
wtest.bat -f general/db/delete_reusevnode2.sim
wtest.bat -f general/db/delete_writing1.sim
wtest.bat -f general/db/delete_writing2.sim
wtest.bat -f general/db/delete.sim
wtest.bat -f general/db/len.sim
wtest.bat -f general/db/repeat.sim
wtest.bat -f general/db/tables.sim
wtest.bat -f general/db/vnodes.sim
wtest.bat -f general/db/nosuchfile.sim
wtest.bat -f general/field/2.sim
wtest.bat -f general/field/3.sim
wtest.bat -f general/field/4.sim
wtest.bat -f general/field/5.sim
wtest.bat -f general/field/6.sim
wtest.bat -f general/field/bigint.sim
wtest.bat -f general/field/binary.sim
wtest.bat -f general/field/bool.sim
wtest.bat -f general/field/single.sim
wtest.bat -f general/field/smallint.sim
wtest.bat -f general/field/tinyint.sim
wtest.bat -f general/http/autocreate.sim
wtest.bat -f general/http/chunked.sim
wtest.bat -f general/http/gzip.sim
wtest.bat -f general/http/restful.sim
wtest.bat -f general/http/restful_insert.sim
wtest.bat -f general/http/restful_limit.sim
wtest.bat -f general/http/restful_full.sim
wtest.bat -f general/http/prepare.sim
wtest.bat -f general/http/telegraf.sim
wtest.bat -f general/http/grafana_bug.sim
wtest.bat -f general/http/grafana.sim
wtest.bat -f general/import/basic.sim
wtest.bat -f general/import/commit.sim
wtest.bat -f general/import/large.sim
wtest.bat -f general/import/replica1.sim
wtest.bat -f general/insert/basic.sim
wtest.bat -f general/insert/insert_drop.sim
wtest.bat -f general/insert/query_block1_memory.sim
wtest.bat -f general/insert/query_block2_memory.sim
wtest.bat -f general/insert/query_block1_file.sim
wtest.bat -f general/insert/query_block2_file.sim
wtest.bat -f general/insert/query_file_memory.sim
wtest.bat -f general/insert/query_multi_file.sim
wtest.bat -f general/insert/tcp.sim
wtest.bat -f general/parser/alter.sim
wtest.bat -f general/parser/alter1.sim
wtest.bat -f general/parser/alter_stable.sim
wtest.bat -f general/parser/auto_create_tb.sim
wtest.bat -f general/parser/auto_create_tb_drop_tb.sim
wtest.bat -f general/parser/col_arithmetic_operation.sim
wtest.bat -f general/parser/columnValue.sim
wtest.bat -f general/parser/commit.sim
wtest.bat -f general/parser/create_db.sim
wtest.bat -f general/parser/create_mt.sim
wtest.bat -f general/parser/create_tb.sim
wtest.bat -f general/parser/dbtbnameValidate.sim
wtest.bat -f general/parser/import_commit1.sim
wtest.bat -f general/parser/import_commit2.sim
wtest.bat -f general/parser/import_commit3.sim
wtest.bat -f general/parser/insert_tb.sim
wtest.bat -f general/parser/first_last.sim
wtest.bat -f general/parser/lastrow.sim
wtest.bat -f general/parser/nchar.sim
wtest.bat -f general/parser/null_char.sim
wtest.bat -f general/parser/single_row_in_tb.sim
wtest.bat -f general/parser/select_from_cache_disk.sim
wtest.bat -f general/parser/mixed_blocks.sim
wtest.bat -f general/parser/selectResNum.sim
wtest.bat -f general/parser/limit.sim
wtest.bat -f general/parser/limit1.sim
wtest.bat -f general/parser/limit1_tblocks100.sim
wtest.bat -f general/parser/select_across_vnodes.sim
wtest.bat -f general/parser/slimit1.sim
wtest.bat -f general/parser/tbnameIn.sim
wtest.bat -f general/parser/projection_limit_offset.sim
wtest.bat -f general/parser/limit2.sim
wtest.bat -f general/parser/fill.sim
wtest.bat -f general/parser/fill_stb.sim
wtest.bat -f general/parser/where.sim
wtest.bat -f general/parser/slimit.sim
wtest.bat -f general/parser/select_with_tags.sim
wtest.bat -f general/parser/interp.sim
wtest.bat -f general/parser/tags_dynamically_specifiy.sim
wtest.bat -f general/parser/groupby.sim
wtest.bat -f general/parser/set_tag_vals.sim
wtest.bat -f general/parser/tags_filter.sim
wtest.bat -f general/parser/slimit_alter_tags.sim
wtest.bat -f general/parser/join.sim
wtest.bat -f general/parser/join_multivnode.sim
wtest.bat -f general/parser/binary_escapeCharacter.sim
wtest.bat -f general/parser/repeatAlter.sim
wtest.bat -f general/parser/union.sim
wtest.bat -f general/parser/topbot.sim
wtest.bat -f general/parser/function.sim
wtest.bat -f general/stable/disk.sim
wtest.bat -f general/stable/dnode3.sim
wtest.bat -f general/stable/metrics.sim
wtest.bat -f general/stable/refcount.sim
wtest.bat -f general/stable/show.sim
wtest.bat -f general/stable/values.sim
wtest.bat -f general/stable/vnode3.sim
wtest.bat -f general/table/autocreate.sim
wtest.bat -f general/table/basic1.sim
wtest.bat -f general/table/basic2.sim
wtest.bat -f general/table/basic3.sim
wtest.bat -f general/table/bigint.sim
wtest.bat -f general/table/binary.sim
wtest.bat -f general/table/bool.sim
wtest.bat -f general/table/column_name.sim
wtest.bat -f general/table/column_num.sim
wtest.bat -f general/table/column_value.sim
wtest.bat -f general/table/column2.sim
wtest.bat -f general/table/date.sim
wtest.bat -f general/table/db.table.sim
wtest.bat -f general/table/delete_reuse1.sim
wtest.bat -f general/table/delete_reuse2.sim
wtest.bat -f general/table/delete_writing.sim
wtest.bat -f general/table/describe.sim
wtest.bat -f general/table/double.sim
wtest.bat -f general/table/fill.sim
wtest.bat -f general/table/float.sim
wtest.bat -f general/table/int.sim
wtest.bat -f general/table/limit.sim
wtest.bat -f general/table/smallint.sim
wtest.bat -f general/table/table_len.sim
wtest.bat -f general/table/table.sim
wtest.bat -f general/table/tinyint.sim
wtest.bat -f general/table/vgroup.sim
wtest.bat -f general/tag/3.sim
wtest.bat -f general/tag/4.sim
wtest.bat -f general/tag/5.sim
wtest.bat -f general/tag/6.sim
wtest.bat -f general/tag/add.sim
wtest.bat -f general/tag/bigint.sim
wtest.bat -f general/tag/binary_binary.sim
wtest.bat -f general/tag/binary.sim
wtest.bat -f general/tag/bool_binary.sim
wtest.bat -f general/tag/bool_int.sim
wtest.bat -f general/tag/bool.sim
wtest.bat -f general/tag/change.sim
wtest.bat -f general/tag/column.sim
wtest.bat -f general/tag/commit.sim
wtest.bat -f general/tag/create.sim
wtest.bat -f general/tag/delete.sim
wtest.bat -f general/tag/double.sim
wtest.bat -f general/tag/filter.sim
wtest.bat -f general/tag/float.sim
wtest.bat -f general/tag/int_binary.sim
wtest.bat -f general/tag/int_float.sim
wtest.bat -f general/tag/int.sim
wtest.bat -f general/tag/set.sim
wtest.bat -f general/tag/smallint.sim
wtest.bat -f general/tag/tinyint.sim
wtest.bat -f general/user/authority.sim
wtest.bat -f general/user/monitor.sim
wtest.bat -f general/user/pass_alter.sim
wtest.bat -f general/user/pass_len.sim
wtest.bat -f general/user/user_create.sim
wtest.bat -f general/user/user_len.sim
wtest.bat -f general/vector/metrics_field.sim
wtest.bat -f general/vector/metrics_mix.sim
wtest.bat -f general/vector/metrics_query.sim
wtest.bat -f general/vector/metrics_tag.sim
wtest.bat -f general/vector/metrics_time.sim
wtest.bat -f general/vector/multi.sim
wtest.bat -f general/vector/single.sim
wtest.bat -f general/vector/table_field.sim
wtest.bat -f general/vector/table_mix.sim
wtest.bat -f general/vector/table_query.sim
wtest.bat -f general/vector/table_time.sim
wtest.bat -f general/wal/sync.sim
wtest.bat -f general/wal/kill.sim
wtest.bat -f general/wal/maxtables.sim
wtest.bat -f unique/account/account_create.sim
wtest.bat -f unique/account/account_delete.sim
wtest.bat -f unique/account/account_len.sim
wtest.bat -f unique/account/authority.sim
wtest.bat -f unique/account/basic.sim
wtest.bat -f unique/account/paras.sim
wtest.bat -f unique/account/pass_alter.sim
wtest.bat -f unique/account/pass_len.sim
wtest.bat -f unique/account/usage.sim
wtest.bat -f unique/account/user_create.sim
wtest.bat -f unique/account/user_len.sim
wtest.bat -f unique/big/balance.sim
wtest.bat -f unique/big/maxvnodes.sim
wtest.bat -f unique/big/tcp.sim
wtest.bat -f unique/cluster/alter.sim
wtest.bat -f unique/cluster/balance1.sim
wtest.bat -f unique/cluster/balance2.sim
wtest.bat -f unique/cluster/balance3.sim
wtest.bat -f unique/cluster/cache.sim
wtest.bat -f unique/cluster/vgroup100.sim
wtest.bat -f unique/column/replica3.sim
wtest.bat -f unique/db/commit.sim
wtest.bat -f unique/db/delete.sim
wtest.bat -f unique/db/delete_part.sim
wtest.bat -f unique/db/replica_add12.sim
wtest.bat -f unique/db/replica_add13.sim
wtest.bat -f unique/db/replica_add23.sim
wtest.bat -f unique/db/replica_reduce21.sim
wtest.bat -f unique/db/replica_reduce32.sim
wtest.bat -f unique/db/replica_reduce31.sim
wtest.bat -f unique/db/replica_part.sim
wtest.bat -f unique/dnode/alternativeRole.sim
wtest.bat -f unique/dnode/monitor.sim
wtest.bat -f unique/dnode/monitor_bug.sim
wtest.bat -f unique/dnode/simple.sim
wtest.bat -f unique/dnode/balance1.sim
wtest.bat -f unique/dnode/balance2.sim
wtest.bat -f unique/dnode/balance3.sim
wtest.bat -f unique/dnode/balancex.sim
wtest.bat -f unique/dnode/data1.sim
wtest.bat -f unique/dnode/m2.sim
wtest.bat -f unique/dnode/m3.sim
wtest.bat -f unique/dnode/lossdata.sim
wtest.bat -f unique/dnode/offline1.sim
wtest.bat -f unique/dnode/offline2.sim
wtest.bat -f unique/dnode/offline3.sim
wtest.bat -f unique/dnode/reason.sim
wtest.bat -f unique/dnode/remove1.sim
wtest.bat -f unique/dnode/remove2.sim
wtest.bat -f unique/dnode/vnode_clean.sim
wtest.bat -f unique/http/admin.sim
wtest.bat -f unique/http/opentsdb.sim
wtest.bat -f unique/import/replica2.sim
wtest.bat -f unique/import/replica3.sim
wtest.bat -f unique/stable/balance_replica1.sim
wtest.bat -f unique/stable/dnode2_stop.sim
wtest.bat -f unique/stable/dnode2.sim
wtest.bat -f unique/stable/dnode3.sim
wtest.bat -f unique/stable/replica2_dnode4.sim
wtest.bat -f unique/stable/replica2_vnode3.sim
wtest.bat -f unique/stable/replica3_dnode6.sim
wtest.bat -f unique/stable/replica3_vnode3.sim
wtest.bat -f unique/mnode/mgmt20.sim
wtest.bat -f unique/mnode/mgmt21.sim
wtest.bat -f unique/mnode/mgmt22.sim
wtest.bat -f unique/mnode/mgmt23.sim
wtest.bat -f unique/mnode/mgmt24.sim
wtest.bat -f unique/mnode/mgmt25.sim
wtest.bat -f unique/mnode/mgmt26.sim
wtest.bat -f unique/mnode/mgmt30.sim
wtest.bat -f unique/mnode/mgmt33.sim
wtest.bat -f unique/mnode/mgmt34.sim
wtest.bat -f unique/mnode/mgmtr2.sim
wtest.bat -f unique/vnode/many.sim
wtest.bat -f unique/vnode/replica2_basic2.sim
wtest.bat -f unique/vnode/replica2_repeat.sim
wtest.bat -f unique/vnode/replica3_basic.sim
wtest.bat -f unique/vnode/replica3_repeat.sim
wtest.bat -f unique/vnode/replica3_vgroup.sim
wtest.bat -f general/stream/metrics_del.sim
wtest.bat -f general/stream/metrics_replica1_vnoden.sim
wtest.bat -f general/stream/restart_stream.sim
wtest.bat -f general/stream/stream_3.sim
wtest.bat -f general/stream/stream_restart.sim
wtest.bat -f general/stream/table_del.sim
wtest.bat -f general/stream/table_replica1_vnoden.sim
wtest.bat -f unique/arbitrator/check_cluster_cfg_para.sim
#wtest.bat -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
wtest.bat -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
wtest.bat -f unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
#wtest.bat -f unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
#wtest.bat -f unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
wtest.bat -f unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
wtest.bat -f unique/arbitrator/dn3_mn1_replica_change.sim
#wtest.bat -f unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
# lower the priority while file corruption
#wtest.bat -f unique/arbitrator/dn3_mn1_vnode_change.sim
#wtest.bat -f unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
#wtest.bat -f unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
#wtest.bat -f unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim
wtest.bat -f unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
wtest.bat -f unique/arbitrator/dn3_mn1_vnode_delDir.sim
wtest.bat -f unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim
wtest.bat -f unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
wtest.bat -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim
wtest.bat -f unique/arbitrator/dn3_mn2_killDnode.sim
wtest.bat -f unique/arbitrator/insert_duplicationTs.sim
wtest.bat -f unique/arbitrator/offline_replica2_alterTable_online.sim
wtest.bat -f unique/arbitrator/offline_replica2_alterTag_online.sim
wtest.bat -f unique/arbitrator/offline_replica2_createTable_online.sim
wtest.bat -f unique/arbitrator/offline_replica2_dropDb_online.sim
wtest.bat -f unique/arbitrator/offline_replica2_dropTable_online.sim
wtest.bat -f unique/arbitrator/offline_replica3_alterTable_online.sim
wtest.bat -f unique/arbitrator/offline_replica3_alterTag_online.sim
wtest.bat -f unique/arbitrator/offline_replica3_createTable_online.sim
wtest.bat -f unique/arbitrator/offline_replica3_dropDb_online.sim
wtest.bat -f unique/arbitrator/offline_replica3_dropTable_online.sim
wtest.bat -f unique/arbitrator/replica_changeWithArbitrator.sim
wtest.bat -f unique/arbitrator/sync_replica2_alterTable_add.sim
wtest.bat -f unique/arbitrator/sync_replica2_alterTable_drop.sim
wtest.bat -f unique/arbitrator/sync_replica2_dropDb.sim
wtest.bat -f unique/arbitrator/sync_replica2_dropTable.sim
wtest.bat -f unique/arbitrator/sync_replica3_alterTable_add.sim
wtest.bat -f unique/arbitrator/sync_replica3_alterTable_drop.sim
wtest.bat -f unique/arbitrator/sync_replica3_dropDb.sim
wtest.bat -f unique/arbitrator/sync_replica3_dropTable.sim
wtest.bat -f unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
wtest.bat -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
wtest.bat -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
wtest.bat -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
wtest.bat -f general/connection/test_old_data.sim
wtest.bat -f unique/dnode/datatrans_3node.sim
wtest.bat -f unique/dnode/datatrans_3node_2.sim
@echo off
if %1 == -n set NODE_NAME=%2
if %1 == -c set CONFIG_NAME=%2
if %1 == -v set CONFIG_VALUE=%2
if %3 == -n set NODE_NAME=%4
if %3 == -c set CONFIG_NAME=%4
if %3 == -v set CONFIG_VALUE=%4
if %5 == -n set NODE_NAME=%6
if %5 == -c set CONFIG_NAME=%6
if %5 == -v set CONFIG_VALUE=%6
rem echo NODE_NAME: %NODE_NAME%
rem echo NODE: %NODE%
set SCRIPT_DIR=%~dp0..\
rem echo SCRIPT_DIR: %SCRIPT_DIR%
set BUILD_DIR=%SCRIPT_DIR%..\..\..\debug\build\bin\
set TSIM=%BUILD_DIR%tsim
rem echo BUILD_DIR: %BUILD_DIR%
rem echo TSIM: %TSIM%
set SIM_DIR=%SCRIPT_DIR%..\..\..\sim\
rem echo SIM_DIR: %SIM_DIR%
set NODE_DIR=%SIM_DIR%%NODE_NAME%\
rem echo NODE_DIR: %NODE_DIR%
set CFG_DIR=%NODE_DIR%cfg\
rem echo CFG_DIR: %CFG_DIR%
set LOG_DIR=%NODE_DIR%log\
rem echo LOG_DIR: %LOG_DIR%
set DATA_DIR=%NODE_DIR%data\
rem echo DATA_DIR: %DATA_DIR%
set TAOS_CFG=%CFG_DIR%taos.cfg
rem echo TAOS_CFG: %TAOS_CFG%
echo %CONFIG_NAME% %CONFIG_VALUE% >> %TAOS_CFG%
#!/bin/bash @echo off
echo "Executing deploy.sh" rem echo Executing deploy.sh
if [ $# != 4 ]; then if %1 == -n set NODE_NAME=%2
echo "argument list need input : " if %1 == -i set NODE=%2
echo " -n nodeName" if %3 == -n set NODE_NAME=%4
echo " -i nodePort" if %3 == -i set NODE=%4
exit 1
fi rem echo NODE_NAME: %NODE_NAME%
rem echo NODE: %NODE%
NODE_NAME=
NODE= set SCRIPT_DIR=%~dp0..\
while getopts "n:i:" arg rem echo SCRIPT_DIR: %SCRIPT_DIR%
do
case $arg in set BUILD_DIR=%SCRIPT_DIR%..\..\..\debug\build\bin\
n) set TSIM=%BUILD_DIR%tsim
NODE_NAME=$OPTARG rem echo BUILD_DIR: %BUILD_DIR%
;; rem echo TSIM: %TSIM%
i)
NODE=$OPTARG set SIM_DIR=%SCRIPT_DIR%..\..\..\sim\
;; rem echo SIM_DIR: %SIM_DIR%
?)
echo "unkonw argument" set NODE_DIR=%SIM_DIR%%NODE_NAME%\
;; rem echo NODE_DIR: %NODE_DIR%
esac
done set CFG_DIR=%NODE_DIR%cfg\
rem echo CFG_DIR: %CFG_DIR%
SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../ set LOG_DIR=%NODE_DIR%log\
SCRIPT_DIR=`pwd` rem echo LOG_DIR: %LOG_DIR%
echo "SCRIPT_DIR: $SCRIPT_DIR"
set DATA_DIR=%NODE_DIR%data\
IN_TDINTERNAL="community" rem echo DATA_DIR: %DATA_DIR%
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then
cd ../../.. set TAOS_CFG=%CFG_DIR%taos.cfg
else rem echo TAOS_CFG: %TAOS_CFG%
cd ../../
fi if not exist %SIM_DIR% mkdir %SIM_DIR%
if not exist %NODE_DIR% mkdir %NODE_DIR%
TAOS_DIR=`pwd` if exist %CFG_DIR% rmdir /s/q %CFG_DIR%
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` if exist %LOG_DIR% rmdir /s/q %LOG_DIR%
if exist %DATA_DIR% rmdir /s/q %DATA_DIR%
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then if not exist %CFG_DIR% mkdir %CFG_DIR%
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` if not exist %LOG_DIR% mkdir %LOG_DIR%
else if not exist %DATA_DIR% mkdir %DATA_DIR%
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2`
fi if %NODE% == 1 set NODE=7100
if %NODE% == 2 set NODE=7200
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build if %NODE% == 3 set NODE=7300
if %NODE% == 4 set NODE=7400
SIM_DIR=$TAOS_DIR/sim if %NODE% == 5 set NODE=7500
if %NODE% == 6 set NODE=7600
NODE_DIR=$SIM_DIR/$NODE_NAME if %NODE% == 7 set NODE=7700
EXE_DIR=$BUILD_DIR/bin if %NODE% == 8 set NODE=7800
CFG_DIR=$NODE_DIR/cfg
LOG_DIR=$NODE_DIR/log set "fqdn="
DATA_DIR=$NODE_DIR/data for /f "skip=1" %%A in (
'wmic computersystem get caption'
rm -rf $NODE_DIR ) do if not defined fqdn set "fqdn=%%A"
mkdir -p $SIM_DIR echo firstEp %fqdn% > %TAOS_CFG%
mkdir -p $NODE_DIR echo fqdn %fqdn% >> %TAOS_CFG%
mkdir -p $LOG_DIR echo serverPort %NODE% >> %TAOS_CFG%
mkdir -p $DATA_DIR echo dataDir %DATA_DIR% >> %TAOS_CFG%
echo logDir %LOG_DIR% >> %TAOS_CFG%
#cp -rf $TAOS_DIR/cfg $NODE_DIR/ echo debugFlag 0 >> %TAOS_CFG%
mkdir -p $CFG_DIR echo mDebugFlag 143 >> %TAOS_CFG%
echo sdbDebugFlag 143 >> %TAOS_CFG%
#allow normal user to read/write log echo dDebugFlag 143 >> %TAOS_CFG%
chmod -R 777 $NODE_DIR echo vDebugFlag 143 >> %TAOS_CFG%
echo tsdbDebugFlag 143 >> %TAOS_CFG%
TAOS_CFG=$NODE_DIR/cfg/taos.cfg echo cDebugFlag 143 >> %TAOS_CFG%
touch -f $TAOS_CFG echo jnidebugFlag 143 >> %TAOS_CFG%
echo odbcdebugFlag 143 >> %TAOS_CFG%
TAOS_FLAG=$SIM_DIR/tsim/flag echo httpDebugFlag 143 >> %TAOS_CFG%
if [ -f "$TAOS_FLAG" ] ; then echo monDebugFlag 143 >> %TAOS_CFG%
TAOS_CFG=/etc/taos/taos.cfg echo mqttDebugFlag 143 >> %TAOS_CFG%
DATA_DIR=/var/lib/taos echo qdebugFlag 143 >> %TAOS_CFG%
LOG_DIR=/var/log/taos echo rpcDebugFlag 143 >> %TAOS_CFG%
sudo rm -f /etc/taos/*.cfg echo tmrDebugFlag 131 >> %TAOS_CFG%
sudo cp -rf $TAOS_DIR/cfg/*.cfg /etc/taos echo udebugFlag 143 >> %TAOS_CFG%
sudo rm -rf $DATA_DIR echo sdebugFlag 143 >> %TAOS_CFG%
sudo rm -rf $LOG_DIR echo wdebugFlag 143 >> %TAOS_CFG%
fi echo cqdebugFlag 143 >> %TAOS_CFG%
echo monitor 0 >> %TAOS_CFG%
HOSTNAME=`hostname -f` echo monitorInterval 1 >> %TAOS_CFG%
echo http 0 >> %TAOS_CFG%
if [ $NODE -eq 1 ]; then echo slaveQuery 0 >> %TAOS_CFG%
NODE=7100 echo numOfThreadsPerCore 2.0 >> %TAOS_CFG%
elif [ $NODE -eq 2 ]; then echo defaultPass taosdata >> %TAOS_CFG%
NODE=7200 echo numOfLogLines 20000000 >> %TAOS_CFG%
elif [ $NODE -eq 3 ]; then echo mnodeEqualVnodeNum 0 >> %TAOS_CFG%
NODE=7300 echo balanceInterval 1 >> %TAOS_CFG%
elif [ $NODE -eq 4 ]; then echo clog 2 >> %TAOS_CFG%
NODE=7400 echo days 10 >> %TAOS_CFG%
elif [ $NODE -eq 5 ]; then echo statusInterval 1 >> %TAOS_CFG%
NODE=7500 echo maxVgroupsPerDb 4 >> %TAOS_CFG%
elif [ $NODE -eq 6 ]; then echo minTablesPerVnode 4 >> %TAOS_CFG%
NODE=7600 echo maxTablesPerVnode 1000 >> %TAOS_CFG%
elif [ $NODE -eq 7 ]; then echo tableIncStepPerVnode 10000 >> %TAOS_CFG%
NODE=7700 echo asyncLog 0 >> %TAOS_CFG%
elif [ $NODE -eq 8 ]; then echo numOfMnodes 1 >> %TAOS_CFG%
NODE=7800 echo locale en_US.UTF-8 >> %TAOS_CFG%
fi echo fsync 0 >> %TAOS_CFG%
echo telemetryReporting 0 >> %TAOS_CFG%
echo " " >> $TAOS_CFG
echo "firstEp ${HOSTNAME}:7100" >> $TAOS_CFG
echo "secondEp ${HOSTNAME}:7200" >> $TAOS_CFG
echo "serverPort ${NODE}" >> $TAOS_CFG
echo "dataDir $DATA_DIR" >> $TAOS_CFG
echo "logDir $LOG_DIR" >> $TAOS_CFG
echo "debugFlag 0" >> $TAOS_CFG
echo "mDebugFlag 143" >> $TAOS_CFG
echo "sdbDebugFlag 143" >> $TAOS_CFG
echo "dDebugFlag 143" >> $TAOS_CFG
echo "vDebugFlag 143" >> $TAOS_CFG
echo "tsdbDebugFlag 143" >> $TAOS_CFG
echo "cDebugFlag 143" >> $TAOS_CFG
echo "jnidebugFlag 143" >> $TAOS_CFG
echo "odbcdebugFlag 143" >> $TAOS_CFG
echo "httpDebugFlag 143" >> $TAOS_CFG
echo "monDebugFlag 143" >> $TAOS_CFG
echo "mqttDebugFlag 143" >> $TAOS_CFG
echo "qdebugFlag 143" >> $TAOS_CFG
echo "rpcDebugFlag 143" >> $TAOS_CFG
echo "tmrDebugFlag 131" >> $TAOS_CFG
echo "udebugFlag 143" >> $TAOS_CFG
echo "sdebugFlag 143" >> $TAOS_CFG
echo "wdebugFlag 143" >> $TAOS_CFG
echo "cqdebugFlag 143" >> $TAOS_CFG
echo "monitor 0" >> $TAOS_CFG
echo "monitorInterval 1" >> $TAOS_CFG
echo "http 0" >> $TAOS_CFG
echo "slaveQuery 0" >> $TAOS_CFG
echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG
echo "defaultPass taosdata" >> $TAOS_CFG
echo "numOfLogLines 20000000" >> $TAOS_CFG
echo "mnodeEqualVnodeNum 0" >> $TAOS_CFG
echo "balanceInterval 1" >> $TAOS_CFG
echo "clog 2" >> $TAOS_CFG
#echo "cache 1" >> $TAOS_CFG
echo "days 10" >> $TAOS_CFG
echo "statusInterval 1" >> $TAOS_CFG
echo "maxVgroupsPerDb 4" >> $TAOS_CFG
echo "minTablesPerVnode 4" >> $TAOS_CFG
echo "maxTablesPerVnode 1000" >> $TAOS_CFG
echo "tableIncStepPerVnode 10000" >> $TAOS_CFG
echo "asyncLog 0" >> $TAOS_CFG
echo "numOfMnodes 1" >> $TAOS_CFG
echo "locale en_US.UTF-8" >> $TAOS_CFG
echo "fsync 0" >> $TAOS_CFG
echo "telemetryReporting 0" >> $TAOS_CFG
echo " " >> $TAOS_CFG
#!/bin/bash @echo off
# if [ $# != 4 || $# != 5 ]; then rem echo Executing exec.sh
# echo "argument list need input : "
# echo " -n nodeName"
# echo " -s start/stop"
# echo " -c clear"
# exit 1
# fi
NODE_NAME= if %1 == -n set NODE_NAME=%2
EXEC_OPTON= if %1 == -s set EXEC_OPTON=%2
CLEAR_OPTION="false" if %3 == -n set NODE_NAME=%4
while getopts "n:s:u:x:ct" arg if %3 == -s set EXEC_OPTON=%4
do
case $arg in
n)
NODE_NAME=$OPTARG
;;
s)
EXEC_OPTON=$OPTARG
;;
c)
CLEAR_OPTION="clear"
;;
t)
SHELL_OPTION="true"
;;
u)
USERS=$OPTARG
;;
x)
SIGNAL=$OPTARG
;;
?)
echo "unkown argument"
;;
esac
done
SCRIPT_DIR=`dirname $0` rem echo NODE_NAME: %NODE_NAME%
cd $SCRIPT_DIR/../ rem echo NODE: %EXEC_OPTON%
SCRIPT_DIR=`pwd`
IN_TDINTERNAL="community" set SCRIPT_DIR=%~dp0..\
if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then rem echo SCRIPT_DIR: %SCRIPT_DIR%
cd ../../..
else
cd ../../
fi
TAOS_DIR=`pwd` set BUILD_DIR=%SCRIPT_DIR%..\..\..\debug\build\bin\
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` set TAOSD=%BUILD_DIR%taosd
rem echo BUILD_DIR: %BUILD_DIR%
rem echo TAOSD: %TAOSD%
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then set SIM_DIR=%SCRIPT_DIR%..\..\..\sim\
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2,3` rem echo SIM_DIR: %SIM_DIR%
else
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' --fields=2`
fi
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build set NODE_DIR=%SIM_DIR%%NODE_NAME%\
rem echo NODE_DIR: %NODE_DIR%
SIM_DIR=$TAOS_DIR/sim set CFG_DIR=%NODE_DIR%cfg\
NODE_DIR=$SIM_DIR/$NODE_NAME rem echo CFG_DIR: %CFG_DIR%
EXE_DIR=$BUILD_DIR/bin
CFG_DIR=$NODE_DIR/cfg
LOG_DIR=$NODE_DIR/log
DATA_DIR=$NODE_DIR/data
MGMT_DIR=$NODE_DIR/data/mgmt
TSDB_DIR=$NODE_DIR/data/tsdb
TAOS_CFG=$NODE_DIR/cfg/taos.cfg set TAOS_CFG=%CFG_DIR%taos.cfg
rem echo TAOS_CFG: %TAOS_CFG%
echo ------------ $EXEC_OPTON $NODE_NAME if %EXEC_OPTON% == start (
echo start %TAOSD% -c %CFG_DIR%
TAOS_FLAG=$SIM_DIR/tsim/flag start %TAOSD% -c %CFG_DIR%
if [ -f "$TAOS_FLAG" ]; then )
EXE_DIR=/usr/local/bin/taos
fi
if [ "$CLEAR_OPTION" = "clear" ]; then
echo rm -rf $MGMT_DIR $TSDB_DIR
rm -rf $TSDB_DIR
rm -rf $MGMT_DIR
fi
if [ "$EXEC_OPTON" = "start" ]; then
echo "ExcuteCmd:" $EXE_DIR/taosd -c $CFG_DIR
if [ "$SHELL_OPTION" = "true" ]; then
TT=`date +%s`
mkdir ${LOG_DIR}/${TT}
nohup valgrind --log-file=${LOG_DIR}/${TT}/valgrind.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
else
nohup $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
fi
else
#relative path
RCFG_DIR=sim/$NODE_NAME/cfg
PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]
do
if [ "$SIGNAL" = "SIGKILL" ]; then
echo try to kill by signal SIGKILL
kill -9 $PID
else
echo try to kill by signal SIGINT
kill -SIGINT $PID
fi
sleep 1
PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'`
done
fi
if %EXEC_OPTON% == stop (
rem echo wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" list INSTANCE
wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" call terminate > NUL 2>&1
)
#!/bin/sh @echo off
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'` rem echo taskkill /F /IM taosd.exe
if [ -n "$PID" ]; then
echo systemctl stop taosd
systemctl stop taosd
fi
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]; do
echo kill -9 $PID
pkill -9 taosd
fuser -k -n tcp 6030
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
done
PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]; do
echo kill -9 $PID
pkill -9 tarbitrator
fuser -k -n tcp 6040
PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
done
taskkill /F /IM taosd.exe > NUL 2>&1
\ No newline at end of file
@echo off @echo off
echo TDengine in windows echo TDengine in windows
echo Start TDengine Testing Case ... rem echo Start TDengine Testing Case ...
set "SCRIPT_DIR=%~dp0" set "SCRIPT_DIR=%~dp0"
echo SCRIPT_DIR: %SCRIPT_DIR% rem echo SCRIPT_DIR: %SCRIPT_DIR%
set "BUILD_DIR=%~dp0..\..\debug\build\bin" set "BUILD_DIR=%SCRIPT_DIR%..\..\..\debug\build\bin\"
set "TSIM=%~dp0..\..\debug\build\bin\tsim" set "TSIM=%BUILD_DIR%tsim"
echo BUILD_DIR: %BUILD_DIR% rem echo BUILD_DIR: %BUILD_DIR%
rem echo TSIM: %TSIM%
set "SIM_DIR=%~dp0..\..\sim" set "SIM_DIR=%SCRIPT_DIR%..\..\..\sim\"
echo SIM_DIR: %SIM_DIR% rem echo SIM_DIR: %SIM_DIR%
set "TSIM_DIR=%~dp0..\..\sim\tsim" set "TSIM_DIR=%SIM_DIR%tsim\"
echo TSIM_DIR: %TSIM_DIR% rem echo TSIM_DIR: %TSIM_DIR%
set "CFG_DIR=%~dp0..\..\sim\tsim\cfg" set "CFG_DIR=%TSIM_DIR%cfg\"
echo CFG_DIR: %CFG_DIR% rem echo CFG_DIR: %CFG_DIR%
set "LOG_DIR=%~dp0..\..\sim\tsim\log" set "LOG_DIR=%TSIM_DIR%log\"
echo LOG_DIR: %LOG_DIR% rem echo LOG_DIR: %LOG_DIR%
set "TAOS_CFG=%~dp0..\..\sim\tsim\cfg\taos.cfg" set "TAOS_CFG=%CFG_DIR%taos.cfg"
echo TAOS_CFG: %TAOS_CFG% rem echo TAOS_CFG: %TAOS_CFG%
if not exist %SIM_DIR% mkdir %SIM_DIR% if not exist %SIM_DIR% mkdir %SIM_DIR%
if not exist %TSIM_DIR% mkdir %TSIM_DIR% if not exist %TSIM_DIR% mkdir %TSIM_DIR%
...@@ -32,7 +33,13 @@ if exist %LOG_DIR% rmdir /s/q %LOG_DIR% ...@@ -32,7 +33,13 @@ if exist %LOG_DIR% rmdir /s/q %LOG_DIR%
if not exist %CFG_DIR% mkdir %CFG_DIR% if not exist %CFG_DIR% mkdir %CFG_DIR%
if not exist %LOG_DIR% mkdir %LOG_DIR% if not exist %LOG_DIR% mkdir %LOG_DIR%
echo firstEp localhost > %TAOS_CFG% set "fqdn="
for /f "skip=1" %%A in (
'wmic computersystem get caption'
) do if not defined fqdn set "fqdn=%%A"
echo firstEp %fqdn% > %TAOS_CFG%
echo fqdn %fqdn% >> %TAOS_CFG%
echo serverPort 7100 >> %TAOS_CFG% echo serverPort 7100 >> %TAOS_CFG%
echo logDir %LOG_DIR% >> %TAOS_CFG% echo logDir %LOG_DIR% >> %TAOS_CFG%
echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG% echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG%
...@@ -49,7 +56,7 @@ echo enableCoreFile 1 >> %TAOS_CFG% ...@@ -49,7 +56,7 @@ echo enableCoreFile 1 >> %TAOS_CFG%
set "FILE_NAME=testSuite.sim" set "FILE_NAME=testSuite.sim"
if "%1" == "-f" set "FILE_NAME=%2" if "%1" == "-f" set "FILE_NAME=%2"
echo FILE_NAME: %FILE_NAME% rem echo FILE_NAME: %FILE_NAME%
echo ExcuteCmd: %tsim% -c %CFG_DIR% -f %FILE_NAME% echo ExcuteCmd: %tsim% -c %CFG_DIR% -f %FILE_NAME%
%tsim% -c %CFG_DIR% -f %FILE_NAME% %TSIM% -c %CFG_DIR% -f %FILE_NAME%
\ No newline at end of file \ No newline at end of file
...@@ -301,11 +301,37 @@ bool simExecuteRunBackCmd(SScript *script, char *option) { ...@@ -301,11 +301,37 @@ bool simExecuteRunBackCmd(SScript *script, char *option) {
return true; return true;
} }
void simReplaceShToBat(char *dst) {
char* sh = strstr(dst, ".sh");
if (sh != NULL) {
int32_t dstLen = (int32_t)strlen(dst);
char *end = dst + dstLen;
*(end + 1) = 0;
for (char *p = end; p >= sh; p--) {
*(p + 1) = *p;
}
sh[0] = '.';
sh[1] = 'b';
sh[2] = 'a';
sh[3] = 't';
sh[4] = ' ';
}
simDebug("system cmd is %s", dst);
}
bool simExecuteSystemCmd(SScript *script, char *option) { bool simExecuteSystemCmd(SScript *script, char *option) {
char buf[4096] = {0}; char buf[4096] = {0};
#ifndef WINDOWS
sprintf(buf, "cd %s; ", tsScriptDir); sprintf(buf, "cd %s; ", tsScriptDir);
simVisuallizeOption(script, option, buf + strlen(buf)); simVisuallizeOption(script, option, buf + strlen(buf));
#else
sprintf(buf, "%s%s", tsScriptDir, option);
simReplaceShToBat(buf);
#endif
simLogSql(buf, true); simLogSql(buf, true);
int32_t code = system(buf); int32_t code = system(buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册