Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3af6d957
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3af6d957
编写于
9月 14, 2020
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1311
上级
7dd32d26
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
135 addition
and
128 deletion
+135
-128
src/inc/taoserror.h
src/inc/taoserror.h
+3
-3
src/plugins/http/inc/httpAuth.h
src/plugins/http/inc/httpAuth.h
+3
-3
src/plugins/http/inc/httpParser.h
src/plugins/http/inc/httpParser.h
+0
-1
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+13
-13
src/plugins/http/src/httpParser.c
src/plugins/http/src/httpParser.c
+15
-15
src/plugins/http/src/httpResp.c
src/plugins/http/src/httpResp.c
+4
-0
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+7
-3
src/plugins/http/src/httpSql.c
src/plugins/http/src/httpSql.c
+1
-1
tests/script/general/http/grafana.sim
tests/script/general/http/grafana.sim
+5
-5
tests/script/general/http/restful_full.sim
tests/script/general/http/restful_full.sim
+7
-7
tests/script/general/http/telegraf.sim
tests/script/general/http/telegraf.sim
+32
-32
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+16
-16
tests/script/unique/http/admin.sim
tests/script/unique/http/admin.sim
+8
-8
tests/script/unique/http/opentsdb.sim
tests/script/unique/http/opentsdb.sim
+21
-21
未找到文件。
src/inc/taoserror.h
浏览文件 @
3af6d957
...
...
@@ -303,8 +303,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_HTTP_TG_TIMESTAMP_NULL, 0, 0x1169, "timestamp
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TIMESTAMP_TYPE
,
0
,
0x116A
,
"timestamp type should be integer"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TIMESTAMP_VAL_NULL
,
0
,
0x116B
,
"timestamp value smaller than 0"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAGS_NULL
,
0
,
0x116C
,
"tags not find"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAGS_SIZE_0
,
0
,
0x116D
,
"tags size
too long
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAGS_SIZE_LONG
,
0
,
0x116E
,
"tags size
is 0
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAGS_SIZE_0
,
0
,
0x116D
,
"tags size
is 0
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAGS_SIZE_LONG
,
0
,
0x116E
,
"tags size
too long
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAG_NULL
,
0
,
0x116F
,
"tag is null"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAG_NAME_NULL
,
0
,
0x1170
,
"tag name is null"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_TG_TAG_NAME_SIZE
,
0
,
0x1171
,
"tag name length too long"
)
...
...
@@ -345,7 +345,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_HTTP_OP_TAG_VALUE_TYPE, 0, 0x11A2, "tag value
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_TAG_VALUE_NULL
,
0
,
0x11A3
,
"tag value is null"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_TAG_VALUE_TOO_LONG
,
0
,
0x11A4
,
"tag value can not more than 64"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_VALUE_NULL
,
0
,
0x11A5
,
"value not find"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_VALUE_TYPE
,
0
,
0x11A
5
,
"value type should be boolean, number or string"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_VALUE_TYPE
,
0
,
0x11A
6
,
"value type should be boolean, number or string"
)
#ifdef TAOS_ERROR_C
};
...
...
src/plugins/http/inc/httpAuth.h
浏览文件 @
3af6d957
...
...
@@ -16,8 +16,8 @@
#ifndef TDENGINE_HTTP_TOKEN_H
#define TDENGINE_HTTP_TOKEN_H
bool
httpParseBasicAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
);
bool
httpParseTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
);
bool
httpGenTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
maxLen
);
int32_t
httpParseBasicAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
);
int32_t
httpParseTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
);
int32_t
httpGenTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
maxLen
);
#endif
\ No newline at end of file
src/plugins/http/inc/httpParser.h
浏览文件 @
3af6d957
...
...
@@ -84,7 +84,6 @@ typedef struct HttpParser {
HttpString
path
[
HTTP_MAX_URL
];
char
*
method
;
char
*
target
;
char
*
target_raw
;
char
*
version
;
char
*
reasonPhrase
;
char
*
key
;
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
3af6d957
...
...
@@ -23,28 +23,28 @@
#define KEY_DES_4 4971256377704625728L
bool
httpParseBasicAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
)
{
int32_t
httpParseBasicAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
)
{
token
[
len
]
=
'\0'
;
int32_t
outlen
=
0
;
char
*
base64
=
(
char
*
)
base64_decode
(
token
,
len
,
&
outlen
);
if
(
base64
==
NULL
||
outlen
==
0
)
{
httpError
(
"context:%p, fd:%d, basic token:%s parsed error"
,
pContext
,
pContext
->
fd
,
token
);
free
(
base64
);
return
false
;
return
-
1
;
}
char
*
user
=
strstr
(
base64
,
":"
);
if
(
user
==
NULL
)
{
httpError
(
"context:%p, fd:%d, basic token:%s invalid format"
,
pContext
,
pContext
->
fd
,
token
);
free
(
base64
);
return
false
;
return
-
1
;
}
int32_t
user_len
=
(
int32_t
)(
user
-
base64
);
if
(
user_len
<
1
||
user_len
>=
TSDB_USER_LEN
)
{
httpError
(
"context:%p, fd:%d, basic token:%s parse user error"
,
pContext
,
pContext
->
fd
,
token
);
free
(
base64
);
return
false
;
return
-
1
;
}
strncpy
(
pContext
->
user
,
base64
,
(
size_t
)
user_len
);
pContext
->
user
[
user_len
]
=
0
;
...
...
@@ -54,36 +54,36 @@ bool httpParseBasicAuthToken(HttpContext *pContext, char *token, int32_t len) {
if
(
pass_len
<
1
||
pass_len
>=
TSDB_PASSWORD_LEN
)
{
httpError
(
"context:%p, fd:%d, basic token:%s parse password error"
,
pContext
,
pContext
->
fd
,
token
);
free
(
base64
);
return
false
;
return
-
1
;
}
strncpy
(
pContext
->
pass
,
password
,
(
size_t
)
pass_len
);
pContext
->
pass
[
pass_len
]
=
0
;
free
(
base64
);
httpDebug
(
"context:%p, fd:%d, basic token parsed success, user:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
user
);
return
true
;
return
0
;
}
bool
httpParseTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
)
{
int32_t
httpParseTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
len
)
{
token
[
len
]
=
'\0'
;
int32_t
outlen
=
0
;
unsigned
char
*
base64
=
base64_decode
(
token
,
len
,
&
outlen
);
if
(
base64
==
NULL
||
outlen
==
0
)
{
httpError
(
"context:%p, fd:%d, taosd token:%s parsed error"
,
pContext
,
pContext
->
fd
,
token
);
if
(
base64
)
free
(
base64
);
return
false
;
return
01
;
}
if
(
outlen
!=
(
TSDB_USER_LEN
+
TSDB_PASSWORD_LEN
))
{
httpError
(
"context:%p, fd:%d, taosd token:%s length error"
,
pContext
,
pContext
->
fd
,
token
);
free
(
base64
);
return
false
;
return
-
1
;
}
char
*
descrypt
=
taosDesDecode
(
KEY_DES_4
,
(
char
*
)
base64
,
outlen
);
if
(
descrypt
==
NULL
)
{
httpError
(
"context:%p, fd:%d, taosd token:%s descrypt error"
,
pContext
,
pContext
->
fd
,
token
);
free
(
base64
);
return
false
;
return
-
1
;
}
else
{
tstrncpy
(
pContext
->
user
,
descrypt
,
sizeof
(
pContext
->
user
));
tstrncpy
(
pContext
->
pass
,
descrypt
+
TSDB_USER_LEN
,
sizeof
(
pContext
->
pass
));
...
...
@@ -92,11 +92,11 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int32_t len) {
pContext
->
user
);
free
(
base64
);
free
(
descrypt
);
return
true
;
return
0
;
}
}
bool
httpGenTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
maxLen
)
{
int32_t
httpGenTaosdAuthToken
(
HttpContext
*
pContext
,
char
*
token
,
int32_t
maxLen
)
{
char
buffer
[
sizeof
(
pContext
->
user
)
+
sizeof
(
pContext
->
pass
)]
=
{
0
};
size_t
size
=
sizeof
(
pContext
->
user
);
tstrncpy
(
buffer
,
pContext
->
user
,
size
);
...
...
@@ -113,5 +113,5 @@ bool httpGenTaosdAuthToken(HttpContext *pContext, char *token, int32_t maxLen) {
httpDebug
(
"context:%p, fd:%d, generate taosd token:%s"
,
pContext
,
pContext
->
fd
,
token
);
return
true
;
return
0
;
}
src/plugins/http/src/httpParser.c
浏览文件 @
3af6d957
...
...
@@ -112,7 +112,8 @@ static int32_t httpAppendString(HttpString *str, const char *s, int32_t len) {
str
->
pos
=
0
;
str
->
size
=
32
;
str
->
str
=
malloc
(
str
->
size
);
}
else
if
(
str
->
pos
+
len
+
1
>
str
->
size
)
{
}
else
if
(
str
->
pos
+
len
+
1
>=
str
->
size
)
{
str
->
size
+=
len
;
str
->
size
*=
10
;
str
->
str
=
realloc
(
str
->
str
,
str
->
size
);
}
else
{
...
...
@@ -130,7 +131,6 @@ static void httpClearString(HttpString *str) {
if
(
str
->
str
)
{
str
->
str
[
0
]
=
'\0'
;
str
->
pos
=
0
;
str
->
size
=
0
;
}
}
...
...
@@ -138,7 +138,9 @@ static int32_t httpOnError(HttpParser *parser, int32_t httpCode, int32_t parseCo
HttpContext
*
pContext
=
parser
->
pContext
;
if
(
httpCode
!=
0
)
parser
->
httpCode
=
httpCode
;
if
(
parseCode
!=
0
)
parser
->
parseCode
=
parseCode
;
httpError
(
"context:%p, fd:%d, parse failed, httpCode:%d parseCode:%d"
,
pContext
,
pContext
->
fd
,
httpCode
,
parseCode
);
httpError
(
"context:%p, fd:%d, parse failed, httpCode:%d parseCode:%d reason:%s"
,
pContext
,
pContext
->
fd
,
httpCode
,
parseCode
&
0XFFFF
,
tstrerror
(
parseCode
));
return
0
;
}
...
...
@@ -309,19 +311,19 @@ static int32_t httpOnParseHeaderField(HttpParser *parser, const char *key, const
}
return
0
;
}
else
{
free
(
t
);
free
(
s
);
parser
->
authType
=
HTTP_INVALID_AUTH
;
httpError
(
"context:%p, fd:%d, invalid auth, t:%s s:%s"
,
pContext
,
pContext
->
fd
,
t
,
s
);
httpOnError
(
parser
,
0
,
TSDB_CODE_HTTP_INVALID_AUTH_TYPE
);
free
(
t
);
free
(
s
);
return
-
1
;
}
}
else
{
free
(
t
);
free
(
s
);
parser
->
authType
=
HTTP_INVALID_AUTH
;
httpError
(
"context:%p, fd:%d, parse auth failed, t:%s s:%s"
,
pContext
,
pContext
->
fd
,
t
,
s
);
httpOnError
(
parser
,
0
,
TSDB_CODE_HTTP_INVALID_AUTH_FORMAT
);
free
(
t
);
free
(
s
);
return
-
1
;
}
}
...
...
@@ -334,14 +336,15 @@ static int32_t httpOnBody(HttpParser *parser, const char *chunk, int32_t len) {
HttpString
*
buf
=
&
parser
->
body
;
if
(
parser
->
parseCode
!=
TSDB_CODE_SUCCESS
)
return
-
1
;
int32_t
avail
=
buf
->
size
-
buf
->
pos
;
if
(
len
+
1
>=
avail
)
{
int32_t
newSize
=
buf
->
pos
+
len
+
1
;
if
(
newSize
>=
buf
->
size
)
{
if
(
buf
->
size
>=
HTTP_BUFFER_SIZE
)
{
httpError
(
"context:%p, fd:%d, failed parse body, exceeding buffer size %d"
,
pContext
,
pContext
->
fd
,
buf
->
size
);
httpOnError
(
parser
,
0
,
TSDB_CODE_HTTP_REQUSET_TOO_BIG
);
return
-
1
;
}
else
{
int32_t
newSize
=
buf
->
size
*
10
;
newSize
=
MAX
(
newSize
,
32
);
newSize
*=
10
;
newSize
=
MIN
(
newSize
,
HTTP_BUFFER_SIZE
);
buf
->
str
=
realloc
(
buf
->
str
,
newSize
);
if
(
buf
->
str
==
NULL
)
{
...
...
@@ -442,7 +445,6 @@ void httpInitParser(HttpParser *parser) {
free
(
parser
->
method
);
parser
->
method
=
NULL
;
free
(
parser
->
target
);
parser
->
target
=
NULL
;
free
(
parser
->
target_raw
);
parser
->
target_raw
=
NULL
;
free
(
parser
->
version
);
parser
->
version
=
NULL
;
free
(
parser
->
reasonPhrase
);
parser
->
reasonPhrase
=
NULL
;
free
(
parser
->
key
);
parser
->
key
=
NULL
;
...
...
@@ -481,7 +483,6 @@ void httpDestroyParser(HttpParser *parser) {
free
(
parser
->
method
);
parser
->
method
=
NULL
;
free
(
parser
->
target
);
parser
->
target
=
NULL
;
free
(
parser
->
target_raw
);
parser
->
target_raw
=
NULL
;
free
(
parser
->
version
);
parser
->
version
=
NULL
;
free
(
parser
->
reasonPhrase
);
parser
->
reasonPhrase
=
NULL
;
free
(
parser
->
key
);
parser
->
key
=
NULL
;
...
...
@@ -638,9 +639,8 @@ static int32_t httpParserOnTarget(HttpParser *parser, HTTP_PARSER_STATE state, c
}
break
;
}
parser
->
target_raw
=
strdup
(
parser
->
str
.
str
);
parser
->
target
=
httpDecodeUrl
(
parser
->
str
.
str
);
if
(
!
parser
->
target_raw
||
!
parser
->
target
)
{
parser
->
target
=
strdup
(
parser
->
str
.
str
);
if
(
!
parser
->
target
)
{
httpError
(
"context:%p, fd:%d, parser state:%d, char:[%c]%02x, oom"
,
pContext
,
pContext
->
fd
,
state
,
c
,
c
);
ok
=
-
1
;
httpOnError
(
parser
,
507
,
TSDB_CODE_HTTP_PARSE_TARGET_FAILED
);
...
...
src/plugins/http/src/httpResp.c
浏览文件 @
3af6d957
...
...
@@ -136,6 +136,10 @@ void httpSendErrorResp(HttpContext *pContext, int32_t errNo) {
else
httpCode
=
400
;
if
(
pContext
->
parser
->
httpCode
!=
0
)
{
httpCode
=
pContext
->
parser
->
httpCode
;
}
char
*
httpCodeStr
=
httpGetStatusDesc
(
httpCode
);
httpSendErrorRespImp
(
pContext
,
httpCode
,
httpCodeStr
,
errNo
&
0XFFFF
,
tstrerror
(
errNo
));
}
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
3af6d957
...
...
@@ -319,21 +319,25 @@ static bool httpReadData(HttpContext *pContext) {
if
(
ok
)
{
httpError
(
"context:%p, fd:%d, parse failed, ret:%d code:%d close connect"
,
pContext
,
pContext
->
fd
,
ok
,
pParser
->
parseCode
);
httpSendErrorResp
(
pContext
,
pParser
->
parseCode
);
httpNotifyContextClose
(
pContext
);
return
false
;
}
if
(
pParser
->
parseCode
)
{
httpError
(
"context:%p, fd:%d, parse failed, code:%d close connect"
,
pContext
,
pContext
->
fd
,
pParser
->
parseCode
);
httpSendErrorResp
(
pContext
,
pParser
->
parseCode
);
httpNotifyContextClose
(
pContext
);
return
false
;
}
if
(
pParser
->
parsed
)
{
if
(
!
pParser
->
parsed
)
{
httpDebug
(
"context:%p, fd:%d, read not over yet, len:%d"
,
pContext
,
pContext
->
fd
,
pParser
->
body
.
pos
);
return
false
;
}
else
{
httpDebug
(
"context:%p, fd:%d, len:%d, body:%s"
,
pContext
,
pContext
->
fd
,
pParser
->
body
.
pos
,
pParser
->
body
.
str
);
return
true
;
}
return
true
;
}
else
if
(
nread
<
0
)
{
if
(
errno
==
EINTR
||
errno
==
EAGAIN
||
errno
==
EWOULDBLOCK
)
{
httpDebug
(
"context:%p, fd:%d, read from socket error:%d, wait another event"
,
pContext
,
pContext
->
fd
,
errno
);
...
...
src/plugins/http/src/httpSql.c
浏览文件 @
3af6d957
...
...
@@ -344,7 +344,7 @@ void httpProcessSingleSqlCmd(HttpContext *pContext) {
void
httpProcessLoginCmd
(
HttpContext
*
pContext
)
{
char
token
[
128
]
=
{
0
};
if
(
!
httpGenTaosdAuthToken
(
pContext
,
token
,
128
)
)
{
if
(
httpGenTaosdAuthToken
(
pContext
,
token
,
128
)
!=
0
)
{
httpSendErrorResp
(
pContext
,
TSDB_CODE_HTTP_GEN_TAOSD_TOKEN_ERR
);
}
else
{
httpDebug
(
"context:%p, fd:%d, user:%s, login via http, return token:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
user
,
...
...
tests/script/general/http/grafana.sim
浏览文件 @
3af6d957
...
...
@@ -54,13 +54,13 @@ print =============== step2 - login
system_content curl 127.0.0.1:7111/grafana/
print 1-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:7111/grafana/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
...
...
@@ -72,7 +72,7 @@ endi
system_content curl 127.0.0.1:7111/grafana/root/1/123/1/1/3
print 4-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
...
...
@@ -84,13 +84,13 @@ endi
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:7111/grafana/root/1/login
print 6-> $system_content
if $system_content != @{"status":"error","code":
5010
,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":
4386
,"desc":"invalid type of Authorization"}@ then
return -1
endi
system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:7111/grafana/root/1/login
print 7-> $system_content
if $system_content != @{"status":"error","code":
5010,"desc":"invalid type
of Authorization"}@ then
if $system_content != @{"status":"error","code":
4387,"desc":"invalid format
of Authorization"}@ then
return -1
endi
...
...
tests/script/general/http/restful_full.sim
浏览文件 @
3af6d957
...
...
@@ -14,26 +14,26 @@ print =============== step1 - login
system_content curl 127.0.0.1:7111/rest/
print 1-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:7111/rest/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:7111/rest/login
print 3-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
#4
system_content curl 127.0.0.1:7111/rest/login/root
print 4-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
...
...
@@ -58,13 +58,13 @@ endi
#8
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:7111/rest/login/root/1
print 8-> $system_content
if $system_content != @{"status":"error","code":
5010
,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":
4386
,"desc":"invalid type of Authorization"}@ then
return -1
endi
system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:7111/rest/login/root/1
print 9-> $system_content
if $system_content != @{"status":"error","code":
5010,"desc":"invalid type
of Authorization"}@ then
if $system_content != @{"status":"error","code":
4387,"desc":"invalid format
of Authorization"}@ then
return -1
endi
...
...
@@ -100,7 +100,7 @@ endi
#14
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '' 127.0.0.1:7111/rest/sql
print 14-> $system_content
if $system_content != @{"status":"error","code":
5012
,"desc":"no sql input"}@ then
if $system_content != @{"status":"error","code":
4359
,"desc":"no sql input"}@ then
return -1
endi
...
...
tests/script/general/http/telegraf.sim
浏览文件 @
3af6d957
...
...
@@ -16,224 +16,224 @@ print =============== step1 - parse
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/
print $system_content
if $system_content != @{"status":"error","code":
5022
,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":
4448
,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/
print $system_content
if $system_content != @{"status":"error","code":
5022
,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":
4448
,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/d123456789012345678901234567890123456
print $system_content
if $system_content != @{"status":"error","code":
5023
,"desc":"database name too long"}@ then
if $system_content != @{"status":"error","code":
4449
,"desc":"database name too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5027
,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":
4453
,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5027
,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":
4453
,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5027
,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":
4453
,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": []}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5025
,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":
4451
,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": [{}]}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5027
,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":
4453
,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": 12}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5025
,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":
4451
,"desc":"metrics size is 0"}@ then
return -1
endi
#system_content curl -u root:taosdata -d '{"metrics": [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]}' 127.0.0.1:7111/telegraf/db/root/taosdata1
#print $system_content
#if $system_content != @{"status":"error","code":
5026
,"desc":"metrics size can not more than 50"}@ then
#if $system_content != @{"status":"error","code":
4452
,"desc":"metrics size can not more than 50"}@ then
# return -1
#endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5027
,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":
4453
,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":111,"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5028
,"desc":"metric name type should be string"}@ then
if $system_content != @{"status":"error","code":
4454
,"desc":"metric name type should be string"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5029
,"desc":"metric name length is 0"}@ then
if $system_content != @{"status":"error","code":
4455
,"desc":"metric name length is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5030
,"desc":"metric name length too long"}@ then
if $system_content != @{"status":"error","code":
4456
,"desc":"metric name length too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"}}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5031
,"desc":"timestamp not find"}@ then
if $system_content != @{"status":"error","code":
4457
,"desc":"timestamp not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":""}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5032
,"desc":"timestamp type should be integer"}@ then
if $system_content != @{"status":"error","code":
4458
,"desc":"timestamp type should be integer"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":-1}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5033
,"desc":"timestamp value smaller than 0"}@ then
if $system_content != @{"status":"error","code":
4459
,"desc":"timestamp value smaller than 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5034
,"desc":"tags not find"}@ then
if $system_content != @{"status":"error","code":
4460
,"desc":"tags not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5035
,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":
4461
,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":"","timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5035
,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":
4461
,"desc":"tags size is 0"}@ then
return -1
endi
#system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor","host":"windows","instance":"1","objectname":"Processor","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata
#print $system_content
#if $system_content != @{"status":"error","code":
5036
,"desc":"tags size too long"}@ then
#if $system_content != @{"status":"error","code":
4461
,"desc":"tags size too long"}@ then
# return -1
#endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5035
,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":
4461
,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5038
,"desc":"tag name is null"}@ then
if $system_content != @{"status":"error","code":
4464
,"desc":"tag name is null"}@ then
return -1
endi
#system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host111111111111222222222222222222222":""},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
#print $system_content
#if $system_content != @{"status":"error","code":
5039
,"desc":"tag name length too long"}@ then
#if $system_content != @{"status":"error","code":
4465
,"desc":"tag name length too long"}@ then
# return -1
#endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":true},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5040
,"desc":"tag value type should be number or string"}@ then
if $system_content != @{"status":"error","code":
4466
,"desc":"tag value type should be number or string"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5041
,"desc":"tag value is null"}@ then
if $system_content != @{"status":"error","code":
4467
,"desc":"tag value is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"5022":"111"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5042
,"desc":"table is null"}@ then
if $system_content != @{"status":"error","code":
4468
,"desc":"table is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5043
,"desc":"table name length too long"}@ then
if $system_content != @{"status":"error","code":
4469
,"desc":"table name length too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5045
,"desc":"fields size is 0"}@ then
if $system_content != @{"status":"error","code":
4471
,"desc":"fields size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5048
,"desc":"field name is null"}@ then
if $system_content != @{"status":"error","code":
4474
,"desc":"field name is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":"","Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5051
,"desc":"field value is null"}@ then
if $system_content != @{"status":"error","code":
4477
,"desc":"field value is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":true,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":
5050
,"desc":"field value type should be number or string"}@ then
if $system_content != @{"status":"error","code":
4476
,"desc":"field value type should be number or string"}@ then
return -1
endi
...
...
tests/script/sh/deploy.sh
浏览文件 @
3af6d957
...
...
@@ -111,23 +111,23 @@ echo "serverPort ${NODE}" >> $TAOS_CFG
echo
"dataDir
$DATA_DIR
"
>>
$TAOS_CFG
echo
"logDir
$LOG_DIR
"
>>
$TAOS_CFG
echo
"debugFlag 0"
>>
$TAOS_CFG
echo
"mDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"sdbDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"dDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"vDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"tsdbDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"cDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"jnidebugFlag 13
5
"
>>
$TAOS_CFG
echo
"odbcdebugFlag 13
5
"
>>
$TAOS_CFG
echo
"httpDebugFlag
135
"
>>
$TAOS_CFG
echo
"monitorDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"mqttDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"qdebugFlag 13
5
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"mDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"sdbDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"dDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"vDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"tsdbDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"cDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"jnidebugFlag 13
1
"
>>
$TAOS_CFG
echo
"odbcdebugFlag 13
1
"
>>
$TAOS_CFG
echo
"httpDebugFlag
207
"
>>
$TAOS_CFG
echo
"monitorDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"mqttDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"qdebugFlag 13
1
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"udebugFlag 13
5
"
>>
$TAOS_CFG
echo
"sdebugFlag 13
5
"
>>
$TAOS_CFG
echo
"wdebugFlag 13
5
"
>>
$TAOS_CFG
echo
"udebugFlag 13
1
"
>>
$TAOS_CFG
echo
"sdebugFlag 13
1
"
>>
$TAOS_CFG
echo
"wdebugFlag 13
1
"
>>
$TAOS_CFG
echo
"monitor 0"
>>
$TAOS_CFG
echo
"monitorInterval 1"
>>
$TAOS_CFG
echo
"http 0"
>>
$TAOS_CFG
...
...
tests/script/unique/http/admin.sim
浏览文件 @
3af6d957
...
...
@@ -33,25 +33,25 @@ print =============== step1 - login
system_content curl 127.0.0.1:7111/admin/
print 1-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:7111/admin/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:7111/admin/login
print 3-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:7111/admin/login/root
print 4-> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
...
...
@@ -69,13 +69,13 @@ endi
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.' -d 'show databases' 127.0.0.1:7111/admin/login/root/1
print 7-> $system_content
if $system_content != @{"status":"error","code":
5010
,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":
4386
,"desc":"invalid type of Authorization"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' 127.0.0.1:7111/admin/login/root/1
print 8-> $system_content
if $system_content != @{"status":"error","code":
5053,"desc":"parse http auth token error
"}@ then
if $system_content != @{"status":"error","code":
4389,"desc":"invalid taosd Authorization
"}@ then
return -1
endi
...
...
@@ -105,7 +105,7 @@ endi
system_content curl 127.0.0.1:7111/admin/logout
print 11 -----> $system_content
if $system_content != @{"status":"error","code":
5011
,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":
4357
,"desc":"no auth info input"}@ then
return -1
endi
...
...
@@ -168,7 +168,7 @@ print =============== step7 - use dbs
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'use d1;' 127.0.0.1:7111/admin/all
print 23-> $system_content
if $system_content != @{"status":"error","code":
5017
,"desc":"no need to execute use db cmd"}@ then
if $system_content != @{"status":"error","code":
4360
,"desc":"no need to execute use db cmd"}@ then
return -1
endi
...
...
tests/script/unique/http/opentsdb.sim
浏览文件 @
3af6d957
...
...
@@ -13,62 +13,62 @@ print ============================ dnode1 start
print =============== step1 - parse
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":
5057
,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":
4496
,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db123456789012345678901234567890db
print $system_content
if $system_content != @{"status":"error","code":
5058
,"desc":"database name too long"}@ then
if $system_content != @{"status":"error","code":
4497
,"desc":"database name too long"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":
5057
,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":
4496
,"desc":"database name can not be null"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db/put2
print $system_content
if $system_content != @{"status":"error","code":
5009,"desc":"http url parse error
"}@ then
if $system_content != @{"status":"error","code":
4354,"desc":"invalid url format
"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5060
,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":
4499
,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5059
,"desc":"invalid opentsdb json fromat"}@ then
if $system_content != @{"status":"error","code":
4498
,"desc":"invalid opentsdb json fromat"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5060
,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":
4499
,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5062
,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":
4501
,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": 1,"timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5063
,"desc":"metric name type should be string"}@ then
if $system_content != @{"status":"error","code":
4502
,"desc":"metric name type should be string"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5064
,"desc":"metric name length is 0"}@ then
if $system_content != @{"status":"error","code":
4503
,"desc":"metric name length is 0"}@ then
return -1
endi
...
...
@@ -80,25 +80,25 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5066
,"desc":"timestamp not find"}@ then
if $system_content != @{"status":"error","code":
4505
,"desc":"timestamp not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": "2","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5067
,"desc":"timestamp type should be integer"}@ then
if $system_content != @{"status":"error","code":
4506
,"desc":"timestamp type should be integer"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": -1,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5068
,"desc":"timestamp value smaller than 0"}@ then
if $system_content != @{"status":"error","code":
4507
,"desc":"timestamp value smaller than 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5078
,"desc":"value not find"}@ then
if $system_content != @{"status":"error","code":
4517
,"desc":"value not find"}@ then
return -1
endi
...
...
@@ -106,19 +106,19 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5069
,"desc":"tags not find"}@ then
if $system_content != @{"status":"error","code":
4508
,"desc":"tags not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5070
,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":
4509
,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": 0}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5070
,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":
4509
,"desc":"tags size is 0"}@ then
return -1
endi
...
...
@@ -130,25 +130,25 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5073
,"desc":"tag name is null"}@ then
if $system_content != @{"status":"error","code":
4512
,"desc":"tag name is null"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host01123456789001123456789001123456789001123456789001123456789001123456789": "01"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5074
,"desc":"tag name length too long"}@ then
if $system_content != @{"status":"error","code":
4513
,"desc":"tag name length too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web011234567890011234567890011234567890011234567890011234567890011234567890011234567890011234567890"}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5077
,"desc":"tag value can not more than 64"}@ then
if $system_content != @{"status":"error","code":
4516
,"desc":"tag value can not more than 64"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": ""}}]' 127.0.0.1:7111/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":
5076
,"desc":"tag value is null"}@ then
if $system_content != @{"status":"error","code":
4515
,"desc":"tag value is null"}@ then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录