Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小楼昨夜-听风雨
TDengine
提交
cc74bdd8
T
TDengine
项目概览
小楼昨夜-听风雨
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc74bdd8
编写于
10月 19, 2020
作者:
H
Hui Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-1639]
上级
90bdea4c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
83 addition
and
60 deletion
+83
-60
tests/gotest/batchtest.bat
tests/gotest/batchtest.bat
+17
-0
tests/gotest/batchtest.sh
tests/gotest/batchtest.sh
+16
-3
tests/gotest/case001/case001.bat
tests/gotest/case001/case001.bat
+9
-0
tests/gotest/case001/case001.go
tests/gotest/case001/case001.go
+34
-1
tests/gotest/case001/case001.sh
tests/gotest/case001/case001.sh
+7
-56
未找到文件。
tests/gotest/batchtest.bat
0 → 100644
浏览文件 @
cc74bdd8
@echo
off
echo
====
start
Go
connector
test
cases
test
====
cd
/d
%~dp0
set
severIp
=
%
1
set
serverPort
=
%
2
if
"
%severIp%
"
==
""
(
set
severIp
=
127
.0.0.1
)
if
"
%serverPort%
"
==
""
(
set
serverPort
=
6030
)
cd
case001
case001
.bat
%severIp%
%serverPort%
rem cd case002
rem case002.bat
:: cd case002
:: case002.bat
tests/gotest/batchtest.sh
浏览文件 @
cc74bdd8
#!/bin/bash
bash ./case001/case001.sh
#bash ./case002/case002.sh
#bash ./case003/case003.sh
echo
"==== start Go connector test cases test ===="
severIp
=
$1
serverPort
=
$2
if
[
!
-n
"
$severIp
"
]
;
then
severIp
=
127.0.0.1
fi
if
[
!
-n
"
$serverPort
"
]
;
then
serverPort
=
6030
fi
bash ./case001/case001.sh
$severIp
$serverPort
#bash ./case002/case002.sh $severIp $serverPort
#bash ./case003/case003.sh $severIp $serverPort
tests/gotest/case001/case001.bat
0 → 100644
浏览文件 @
cc74bdd8
@echo
off
echo
====
start
run
cases001
.go
del
go
.
*
go
mod
init
demotest
go
build
demotest
.exe
-h
%
1
-p
%
2
cd
..
tests/gotest/case001/case001.go
浏览文件 @
cc74bdd8
...
...
@@ -16,20 +16,53 @@ package main
import
(
"database/sql"
"flag"
"fmt"
_
"github.com/taosdata/driver-go/taosSql"
"log"
"strconv"
"time"
)
type
config
struct
{
hostName
string
serverPort
int
user
string
password
string
}
var
configPara
config
var
url
string
func
init
()
{
flag
.
StringVar
(
&
configPara
.
hostName
,
"h"
,
"127.0.0.1"
,
"The host to connect to TDengine server."
)
flag
.
IntVar
(
&
configPara
.
serverPort
,
"p"
,
6030
,
"The TCP/IP port number to use for the connection to TDengine server."
)
flag
.
StringVar
(
&
configPara
.
user
,
"u"
,
"root"
,
"The TDengine user name to use when connecting to the server."
)
flag
.
StringVar
(
&
configPara
.
password
,
"P"
,
"taosdata"
,
"The password to use when connecting to the server."
)
flag
.
Parse
()
}
func
printAllArgs
()
{
fmt
.
Printf
(
"
\n
============= args parse result: =============
\n
"
)
fmt
.
Printf
(
"hostName: %v
\n
"
,
configPara
.
hostName
)
fmt
.
Printf
(
"serverPort: %v
\n
"
,
configPara
.
serverPort
)
fmt
.
Printf
(
"usr: %v
\n
"
,
configPara
.
user
)
fmt
.
Printf
(
"password: %v
\n
"
,
configPara
.
password
)
fmt
.
Printf
(
"================================================
\n
"
)
}
func
main
()
{
printAllArgs
()
taosDriverName
:=
"taosSql"
demodb
:=
"demodb"
demot
:=
"demot"
fmt
.
Printf
(
"
\n
======== start demo test ========
\n
"
)
url
=
"root:taosdata@/tcp("
+
configPara
.
hostName
+
":"
+
strconv
.
Itoa
(
configPara
.
serverPort
)
+
")/"
// open connect to taos server
db
,
err
:=
sql
.
Open
(
taosDriverName
,
"root:taosdata@/tcp(192.168.1.217:7100)/"
)
db
,
err
:=
sql
.
Open
(
taosDriverName
,
url
)
if
err
!=
nil
{
log
.
Fatalf
(
"Open database error: %s
\n
"
,
err
)
}
...
...
tests/gotest/case001/case001.sh
浏览文件 @
cc74bdd8
#!/bin/bash
##################################################
#
# Do go test
#
##################################################
echo
"==== start run cases001.go"
set
+e
#set -x
...
...
@@ -12,59 +8,14 @@ set +e
script_dir
=
"
$(
dirname
$(
readlink
-f
$0
))
"
#echo "pwd: $script_dir, para0: $0"
execName
=
$0
execName
=
`
echo
${
execName
##*/
}
`
goName
=
`
echo
${
execName
%.*
}
`
###### step 1: start one taosd
scriptDir
=
$script_dir
/../../script/sh
bash
$scriptDir
/stop_dnodes.sh
bash
$scriptDir
/deploy.sh
-n
dnode1
-i
1
bash
$scriptDir
/cfg.sh
-n
dnode1
-c
walLevel
-v
0
bash
$scriptDir
/exec.sh
-n
dnode1
-s
start
###### step 2: set config item
TAOS_CFG
=
/etc/taos/taos.cfg
HOSTNAME
=
`
hostname
-f
`
if
[
!
-f
${
TAOS_CFG
}
]
;
then
touch
-f
$TAOS_CFG
fi
echo
" "
>
$TAOS_CFG
echo
"firstEp
${
HOSTNAME
}
:7100"
>>
$TAOS_CFG
echo
"secondEp
${
HOSTNAME
}
:7200"
>>
$TAOS_CFG
echo
"serverPort 7100"
>>
$TAOS_CFG
#echo "dataDir $DATA_DIR" >> $TAOS_CFG
#echo "logDir $LOG_DIR" >> $TAOS_CFG
#echo "scriptDir ${CODE_DIR}/../script" >> $TAOS_CFG
echo
"numOfLogLines 100000000"
>>
$TAOS_CFG
echo
"dDebugFlag 135"
>>
$TAOS_CFG
echo
"mDebugFlag 135"
>>
$TAOS_CFG
echo
"sdbDebugFlag 135"
>>
$TAOS_CFG
echo
"rpcDebugFlag 135"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"cDebugFlag 135"
>>
$TAOS_CFG
echo
"httpDebugFlag 135"
>>
$TAOS_CFG
echo
"monitorDebugFlag 135"
>>
$TAOS_CFG
echo
"udebugFlag 135"
>>
$TAOS_CFG
echo
"tablemetakeeptimer 5"
>>
$TAOS_CFG
echo
"wal 0"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"locale en_US.UTF-8"
>>
$TAOS_CFG
echo
"enableCoreFile 1"
>>
$TAOS_CFG
echo
" "
>>
$TAOS_CFG
ulimit
-n
600000
ulimit
-c
unlimited
#
##sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
#
#execName=$0
#execName=`echo ${execName##*/}`
#goName=`echo ${execName%.*}`
###### step 3: start build
cd
$script_dir
rm
-f
go.
*
go mod init
$goName
go mod init
demotest
go build
sleep
1s
sudo
./
$goName
sleep
1s
./demotest
-h
$1
-p
$2
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录