提交 613c2adc 编写于 作者: H Haojun Liao

Merge branch 'develop' into feature/query

......@@ -135,7 +135,8 @@ typedef struct SVgObj {
char dbName[TSDB_ACCT_LEN + TSDB_DB_NAME_LEN];
int8_t inUse;
int8_t accessState;
int8_t reserved0[5];
int8_t status;
int8_t reserved0[4];
SVnodeGid vnodeGid[TSDB_MAX_REPLICA];
int8_t reserved1[7];
int8_t updateEnd[1];
......
......@@ -367,7 +367,6 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
pAccess++;
mnodeDecVgroupRef(pVgroup);
}
}
if (pDnode->status == TAOS_DN_STATUS_OFFLINE) {
......
......@@ -38,6 +38,11 @@
#include "mnodeVgroup.h"
#include "mnodePeer.h"
typedef enum {
TAOS_VG_STATUS_READY,
TAOS_VG_STATUS_DROPPING
} EVgroupStatus;
static void *tsVgroupSdb = NULL;
static int32_t tsVgUpdateSize = 0;
......@@ -279,7 +284,7 @@ void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t o
pNextV++;
}
if (i == openVnodes) {
if (i == openVnodes && pVgroup->status == TAOS_VG_STATUS_READY) {
mnodeSendCreateVgroupMsg(pVgroup, NULL);
}
......@@ -728,6 +733,7 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) {
}
static void mnodeSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) {
pVgroup->status = TAOS_VG_STATUS_DROPPING; // deleting
mDebug("vgId:%d, send drop all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle);
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp);
......
......@@ -441,7 +441,7 @@ void httpJsonPairStatus(JsonBuf* buf, int code) {
} else {
httpJsonPair(buf, "status", 6, "error", 5);
httpJsonItemToken(buf);
httpJsonPairIntVal(buf, "code", 4, code);
httpJsonPairIntVal(buf, "code", 4, code & 0XFFFF);
httpJsonItemToken(buf);
if (code == TSDB_CODE_MND_DB_NOT_SELECTED) {
httpJsonPair(buf, "desc", 4, "failed to create database", 23);
......
......@@ -174,9 +174,9 @@ void httpSendErrorRespWithDesc(HttpContext *pContext, int errNo, char *desc) {
}
if (desc == NULL) {
httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 1000, httpMsg[errNo]);
httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 5000, httpMsg[errNo]);
} else {
httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 1000, desc);
httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 5000, desc);
}
}
......@@ -184,7 +184,8 @@ void httpSendErrorResp(HttpContext *pContext, int errNo) { httpSendErrorRespWith
void httpSendTaosdErrorResp(HttpContext *pContext, int errCode) {
int httpCode = 400;
httpSendErrorRespImp(pContext, httpCode, "Bad Request", 1000, (char*)tstrerror(errCode));
httpSendErrorRespImp(pContext, httpCode, "Bad Request", errCode & 0XFFFF, (char*)tstrerror(errCode));
}
void httpSendTaosdInvalidSqlErrorResp(HttpContext *pContext, char* errMsg) {
......@@ -200,7 +201,7 @@ void httpSendTaosdInvalidSqlErrorResp(HttpContext *pContext, char* errMsg) {
} else {}
}
httpSendErrorRespImp(pContext, httpCode, "Bad Request", 1000, temp);
httpSendErrorRespImp(pContext, httpCode, "Bad Request", TSDB_CODE_TSC_INVALID_SQL & 0XFFFF, temp);
}
void httpSendSuccResp(HttpContext *pContext, char *desc) {
......
......@@ -641,7 +641,7 @@ static SRpcConn *rpcAllocateClientConn(SRpcInfo *pRpc) {
pConn->pRpc = pRpc;
pConn->sid = sid;
pConn->tranId = (uint16_t)(rand() & 0xFFFF);
pConn->tranId = (uint16_t)(random() & 0xFFFF);
pConn->ownId = htonl(pConn->sid);
pConn->linkUid = (uint32_t)((int64_t)pConn + (int64_t)getpid());
pConn->spi = pRpc->spi;
......@@ -1529,10 +1529,10 @@ static void rpcAddRef(SRpcInfo *pRpc)
static void rpcDecRef(SRpcInfo *pRpc)
{
if (atomic_sub_fetch_32(&pRpc->refCount, 1) == 0) {
rpcCloseConnCache(pRpc->pCache);
taosHashCleanup(pRpc->hash);
taosTmrCleanUp(pRpc->tmrCtrl);
taosIdPoolCleanUp(pRpc->idPool);
rpcCloseConnCache(pRpc->pCache);
tfree(pRpc->connList);
pthread_mutex_destroy(&pRpc->mutex);
......
......@@ -415,11 +415,11 @@ static int32_t tsdbCheckAndSetDefaultCfg(STsdbCfg *pCfg) {
// Check maxTables
if (pCfg->maxTables == -1) {
pCfg->maxTables = TSDB_DEFAULT_TABLES;
pCfg->maxTables = TSDB_DEFAULT_TABLES+1;
} else {
if (pCfg->maxTables < TSDB_MIN_TABLES || pCfg->maxTables > TSDB_MAX_TABLES) {
if (pCfg->maxTables - 1 < TSDB_MIN_TABLES || pCfg->maxTables - 1 > TSDB_MAX_TABLES) {
tsdbError("vgId:%d invalid maxTables configuration! maxTables %d TSDB_MIN_TABLES %d TSDB_MAX_TABLES %d",
pCfg->tsdbId, pCfg->maxTables, TSDB_MIN_TABLES, TSDB_MAX_TABLES);
pCfg->tsdbId, pCfg->maxTables - 1, TSDB_MIN_TABLES, TSDB_MAX_TABLES);
goto _err;
}
}
......
......@@ -575,7 +575,7 @@ void tsdbRefTable(STable *pTable) {
void tsdbUnRefTable(STable *pTable) {
int32_t ref = T_REF_DEC(pTable);
tsdbDebug("unref table uid:%"PRIu64", tid:%d, refCount:%d", TABLE_UID(pTable), TABLE_TID(pTable), ref);
tsdbTrace("unref table uid:%"PRIu64", tid:%d, refCount:%d", TABLE_UID(pTable), TABLE_TID(pTable), ref);
if (ref == 0) {
// tsdbDebug("destory table name:%s uid:%"PRIu64", tid:%d", TABLE_CHAR_NAME(pTable), TABLE_UID(pTable), TABLE_TID(pTable));
......
......@@ -193,7 +193,7 @@ static void* realloc_detect_leak(void* ptr, size_t size, const char* file, uint3
return malloc_detect_leak(size, file, line);
}
SMemBlock* blk = ((char*)ptr) - sizeof(SMemBlock);
SMemBlock* blk = (SMemBlock *)((char*)ptr) - sizeof(SMemBlock);
if (blk->magic != MEMBLK_MAGIC) {
if (fpAllocLog != NULL) {
fprintf(fpAllocLog, "%s:%d: memory is allocated by default allocator.\n", file, line);
......
......@@ -32,6 +32,7 @@ class TDTestCase:
tdDnodes.stop(1)
tdDnodes.deploy(1)
tdDnodes.start(1)
tdLog.sleep(5)
tdSql.execute('reset query cache')
tdSql.execute('drop database if exists db')
......@@ -61,6 +62,7 @@ class TDTestCase:
tdDnodes.stop(1)
tdLog.sleep(5)
tdDnodes.start(1)
tdLog.sleep(5)
tdLog.info("================= step5")
tdLog.info("import 10 data totally repetitive")
......
......@@ -81,7 +81,7 @@ if __name__ == "__main__":
else:
toBeKilled = "valgrind.bin"
killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -HUP " % toBeKilled
killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -HUP > /dev/null 2>&1" % toBeKilled
psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled
processID = subprocess.check_output(psCmd, shell=True)
......@@ -91,8 +91,17 @@ if __name__ == "__main__":
time.sleep(1)
processID = subprocess.check_output(psCmd, shell=True)
fuserCmd = "fuser -k -n tcp 6030"
os.system(fuserCmd)
for port in range(6030, 6041):
usePortPID = "lsof -i tcp:%d | grep LISTEn | awk '{print $2}'" % port
processID = subprocess.check_output(usePortPID, shell=True)
if processID:
killCmd = "kill -9 %s" % processID
os.system(killCmd)
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if valgrind:
time.sleep(2)
tdLog.info('stop All dnodes')
sys.exit(0)
......
......@@ -251,11 +251,16 @@ class TDDnode:
psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -INT %s" % processID
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8")
for port in range(6030, 6041):
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if self.valgrind:
time.sleep(2)
self.running = 0
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
......@@ -272,11 +277,16 @@ class TDDnode:
psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -KILL %s" % processID
killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8")
for port in range(6030, 6041):
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if self.valgrind:
time.sleep(2)
self.running = 0
tdLog.debug("dnode:%d is stopped by kill -KILL" % (self.index))
......@@ -325,7 +335,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -KILL %s" % processID
killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
......@@ -334,7 +344,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -KILL %s" % processID
killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
......@@ -440,7 +450,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -KILL %s" % processID
killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
......@@ -449,7 +459,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -KILL %s" % processID
killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
......
......@@ -54,43 +54,43 @@ print =============== step2 - login
system_content curl 127.0.0.1:6020/grafana/
print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/grafana/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/grafana/login/xx/xx/
print 3-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid user"}@ then
if $system_content != @{"status":"error","code":849,"desc":"mnode invalid user"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/grafana/root/1/123/1/1/3
print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/grafana/login/1/root/1/
print 5-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid user"}@ then
if $system_content != @{"status":"error","code":849,"desc":"mnode invalid user"}@ then
return -1
endi
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/grafana/root/1/login
print 6-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":5010,"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:6020/grafana/root/1/login
print 7-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1
endi
......
......@@ -77,7 +77,7 @@ endi
system_content curl 127.0.0.1:6020/rest/login/u2/aabcd_1234
print curl 127.0.0.1:6020/rest/login/u2/abcd_1234 -----> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then
if $system_content != @{"status":"error","code":3,"desc":"auth failure"}@ then
return -1
endi
......
......@@ -14,57 +14,57 @@ print =============== step1 - login
system_content curl 127.0.0.1:6020/rest/
print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/rest/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/rest/login
print 3-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
#4
system_content curl 127.0.0.1:6020/rest/login/root
print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/rest/login/root/123
print 5-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then
if $system_content != @{"status":"error","code":3,"desc":"auth failure"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/rest/login/root/123/1/1/3
print 6-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then
if $system_content != @{"status":"error","code":3,"desc":"auth failure"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/login/root/1
print 7-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then
if $system_content != @{"status":"error","code":3,"desc":"auth failure"}@ then
return -1
endi
#8
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/rest/login/root/1
print 8-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":5010,"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:6020/rest/login/root/1
print 9-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1
endi
......@@ -93,40 +93,40 @@ endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6020/rest/sql
print 13-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode database aleady exist"}@ then
if $system_content != @{"status":"error","code":897,"desc":"mnode database aleady exist"}@ then
return -1
endi
#14
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '' 127.0.0.1:6020/rest/sql
print 14-> $system_content
if $system_content != @{"status":"error","code":1012,"desc":"no sql input"}@ then
if $system_content != @{"status":"error","code":5012,"desc":"no sql input"}@ then
return -1
endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'use d1' 127.0.0.1:6020/rest/sql
#print 15-> $system_content
#if $system_content != @{"status":"error","code":1017,"desc":"no need to execute use db cmd"}@ then
#if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then
#if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
# return -1
#endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' use d1' 127.0.0.1:6020/rest/sql
#print 16-> $system_content
#if $system_content != @{"status":"error","code":1017,"desc":"no need to execute use db cmd"}@ then
#if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then
# return -1
#endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' used1' 127.0.0.1:6020/rest/sql
print 17-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"invalid SQL: invalid SQL: syntax error near 'used1'"}@ then
if $system_content != @{"status":"error","code":512,"desc":"invalid SQL: invalid SQL: syntax error near 'used1'"}@ then
return -1
endi
#18
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 127.0.0.1:6020/rest/sql
print 18-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode db not selected"}@ then
if $system_content != @{"status":"error","code":896,"desc":"mnode db not selected"}@ then
return -1
endi
......@@ -147,7 +147,7 @@ print =============== step3 - db
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1;' 127.0.0.1:6020/rest/sql
print 21-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid table name"}@ then
if $system_content != @{"status":"error","code":866,"desc":"mnode invalid table name"}@ then
return -1
endi
......
......@@ -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:6020/telegraf/
print $system_content
if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":5022,"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:6020/telegraf/
print $system_content
if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":5022,"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:6020/telegraf/d123456789012345678901234567890123456
print $system_content
if $system_content != @{"status":"error","code":1023,"desc":"database name too long"}@ then
if $system_content != @{"status":"error","code":5023,"desc":"database name too long"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": []}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1025,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":5025,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": [{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{"metrics": 12}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1025,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":5025,"desc":"metrics size is 0"}@ then
return -1
endi
#system_content curl -u root:taosdata -d '{"metrics": [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1
#print $system_content
#if $system_content != @{"status":"error","code":1026,"desc":"metrics size can not more than 50"}@ then
#if $system_content != @{"status":"error","code":5026,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":5027,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1028,"desc":"metric name type should be string"}@ then
if $system_content != @{"status":"error","code":5028,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1029,"desc":"metric name length is 0"}@ then
if $system_content != @{"status":"error","code":5029,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1030,"desc":"metric name length too long"}@ then
if $system_content != @{"status":"error","code":5030,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1031,"desc":"timestamp not find"}@ then
if $system_content != @{"status":"error","code":5031,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1032,"desc":"timestamp type should be integer"}@ then
if $system_content != @{"status":"error","code":5032,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1033,"desc":"timestamp value smaller than 0"}@ then
if $system_content != @{"status":"error","code":5033,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1034,"desc":"tags not find"}@ then
if $system_content != @{"status":"error","code":5034,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":5035,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":5035,"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:6020/telegraf/db/root/taosdata
#print $system_content
#if $system_content != @{"status":"error","code":1036,"desc":"tags size too long"}@ then
#if $system_content != @{"status":"error","code":5036,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":5035,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1038,"desc":"tag name is null"}@ then
if $system_content != @{"status":"error","code":5038,"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:6020/telegraf/db/root/taosdata1
#print $system_content
#if $system_content != @{"status":"error","code":1039,"desc":"tag name length too long"}@ then
#if $system_content != @{"status":"error","code":5039,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1040,"desc":"tag value type should be number or string"}@ then
if $system_content != @{"status":"error","code":5040,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1041,"desc":"tag value is null"}@ then
if $system_content != @{"status":"error","code":5041,"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":{"1022":"111"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1042,"desc":"table is null"}@ then
if $system_content != @{"status":"error","code":5042,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1043,"desc":"table name length too long"}@ then
if $system_content != @{"status":"error","code":5043,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1045,"desc":"fields size is 0"}@ then
if $system_content != @{"status":"error","code":5045,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1048,"desc":"field name is null"}@ then
if $system_content != @{"status":"error","code":5048,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1051,"desc":"field value is null"}@ then
if $system_content != @{"status":"error","code":5051,"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:6020/telegraf/db/root/taosdata1
print $system_content
if $system_content != @{"status":"error","code":1050,"desc":"field value type should be number or string"}@ then
if $system_content != @{"status":"error","code":5050,"desc":"field value type should be number or string"}@ then
return -1
endi
......
......@@ -124,7 +124,7 @@ run general/parser/slimit.sim
run general/parser/fill.sim
run general/parser/fill_stb.sim
run general/parser/interp.sim
# run general/parser/where.sim
run general/parser/where.sim
run general/parser/join.sim
run general/parser/join_multivnode.sim
run general/parser/select_with_tags.sim
......
......@@ -113,11 +113,11 @@ echo "logDir $LOG_DIR" >> $TAOS_CFG
echo "mDebugFlag 135" >> $TAOS_CFG
echo "sdbDebugFlag 135" >> $TAOS_CFG
echo "dDebugFlag 135" >> $TAOS_CFG
echo "vDebugFlag 143" >> $TAOS_CFG
echo "vDebugFlag 135" >> $TAOS_CFG
echo "cDebugFlag 135" >> $TAOS_CFG
echo "jnidebugFlag 135" >> $TAOS_CFG
echo "odbcdebugFlag 135" >> $TAOS_CFG
echo "httpDebugFlag 135" >> $TAOS_CFG
echo "httpDebugFlag 143" >> $TAOS_CFG
echo "monitorDebugFlag 131" >> $TAOS_CFG
echo "mqttDebugFlag 131" >> $TAOS_CFG
echo "qdebugFlag 135" >> $TAOS_CFG
......
......@@ -33,49 +33,49 @@ print =============== step1 - login
system_content curl 127.0.0.1:6020/admin/
print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/admin/xx
print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/admin/login
print 3-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/admin/login/root
print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/admin/login/root/123
print 5-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then
if $system_content != @{"status":"error","code":3,"desc":"auth failure"}@ then
return -1
endi
system_content curl 127.0.0.1:6020/admin/login/root/123/1/1/3
print 6-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then
if $system_content != @{"status":"error","code":3,"desc":"auth failure"}@ then
return -1
endi
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.' -d 'show databases' 127.0.0.1:6020/admin/login/root/1
print 7-> $system_content
if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1
endi
system_content curl -H 'Authorization: Taosd eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' 127.0.0.1:6020/admin/login/root/1
print 8-> $system_content
if $system_content != @{"status":"error","code":1053,"desc":"parse http auth token error"}@ then
if $system_content != @{"status":"error","code":5053,"desc":"parse http auth token error"}@ then
return -1
endi
......@@ -105,7 +105,7 @@ endi
system_content curl 127.0.0.1:6020/admin/logout
print 11 -----> $system_content
if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":5011,"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:6020/admin/all
print 23-> $system_content
if $system_content != @{"status":"error","code":1017,"desc":"no need to execute use db cmd"}@ then
if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then
return -1
endi
......
......@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
system sh/exec.sh -n dnode1 -s start
sleep 3000
......@@ -14,92 +13,92 @@ 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:6020/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":5057,"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:6020/opentsdb/db123456789012345678901234567890db
print $system_content
if $system_content != @{"status":"error","code":1058,"desc":"database name too long"}@ then
if $system_content != @{"status":"error","code":5058,"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:6020/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then
if $system_content != @{"status":"error","code":5057,"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:6020/opentsdb/db/put2
print $system_content
if $system_content != @{"status":"error","code":1009,"desc":"http url parse error"}@ then
if $system_content != @{"status":"error","code":5009,"desc":"http url parse error"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1060,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":5060,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1059,"desc":"invalid opentsdb json fromat"}@ then
if $system_content != @{"status":"error","code":5059,"desc":"invalid opentsdb json fromat"}@ then
return -1
endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1060,"desc":"metrics size is 0"}@ then
if $system_content != @{"status":"error","code":5060,"desc":"metrics size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1062,"desc":"metric name not find"}@ then
if $system_content != @{"status":"error","code":5062,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1063,"desc":"metric name type should be string"}@ then
if $system_content != @{"status":"error","code":5063,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1064,"desc":"metric name length is 0"}@ then
if $system_content != @{"status":"error","code":5064,"desc":"metric name length is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "ab1234567890123456789012345678ab1234567890123456789012345678","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"ab1234567890123456789012345678ab1234567890123456789012345678","stable":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb","table":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb_lga_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"status":"error","code":-2147482101,"desc":"tsdb timestamp is out of range"}}],"failed":1,"success":0,"affected_rows":0}@ then
if $system_content != @{"errors":[{"datapoint":{"metric":"ab1234567890123456789012345678ab1234567890123456789012345678","stable":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb","table":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb_lga_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"status":"error","code":1547,"desc":"tsdb timestamp is out of range"}}],"failed":1,"success":0,"affected_rows":0}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1066,"desc":"timestamp not find"}@ then
if $system_content != @{"status":"error","code":5066,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1067,"desc":"timestamp type should be integer"}@ then
if $system_content != @{"status":"error","code":5067,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1068,"desc":"timestamp value smaller than 0"}@ then
if $system_content != @{"status":"error","code":5068,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1078,"desc":"value not find"}@ then
if $system_content != @{"status":"error","code":5078,"desc":"value not find"}@ then
return -1
endi
......@@ -107,49 +106,49 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1069,"desc":"tags not find"}@ then
if $system_content != @{"status":"error","code":5069,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1070,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":5070,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1070,"desc":"tags size is 0"}@ then
if $system_content != @{"status":"error","code":5070,"desc":"tags size is 0"}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","group1": "1","group1": "1","group1": "1","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbbbbbb","table":"sys_cpu_d_bbbbbbb_lga_1_1_1_1_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","group1":"1","group1":"1","group1":"1","group1":"1","host":"web01"},"status":"error","code":-2147482782,"desc":"failed to create table"}}],"failed":1,"success":0,"affected_rows":0}@ then
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbbbbbb","table":"sys_cpu_d_bbbbbbb_lga_1_1_1_1_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","group1":"1","group1":"1","group1":"1","group1":"1","host":"web01"},"status":"error","code":866,"desc":"failed to create table"}}],"failed":1,"success":0,"affected_rows":0}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1073,"desc":"tag name is null"}@ then
if $system_content != @{"status":"error","code":5073,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1074,"desc":"tag name length too long"}@ then
if $system_content != @{"status":"error","code":5074,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1077,"desc":"tag value can not more than 64"}@ then
if $system_content != @{"status":"error","code":5077,"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:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1076,"desc":"tag value is null"}@ then
if $system_content != @{"status":"error","code":5076,"desc":"tag value is null"}@ then
return -1
endi
......@@ -175,11 +174,11 @@ if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-
endi
print =============== step3 - multi-query data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846401000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402000,"value": 18,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846405000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402000,"value": 18,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846401000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}},{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web02","timestamp":1346846402000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web02"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":2,"affected_rows":2}@ then
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846405000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}},{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web02","timestamp":1346846402000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web02"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":2,"affected_rows":2}@ then
return -1
endi
......@@ -187,7 +186,7 @@ system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_w
print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000],["2012-09-05 20:00:01.000",18.000000000]],"rows":2}@ then
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000],["2012-09-05 20:00:05.000",18.000000000]],"rows":2}@ then
return -1
endi
......@@ -200,7 +199,7 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows":
endi
print =============== step4 - summary-put data
system_content curl -u root:taosdata -d '[{"metric": "sys_mem","timestamp": 1346846400000,"value": 8,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_mem","timestamp": 1346846401000,"value": 9,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put?details=false
system_content curl -u root:taosdata -d '[{"metric": "sys_mem","timestamp": 1346846400000,"value": 8,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_mem","timestamp": 1346846405000,"value": 9,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put?details=false
print $system_content
......@@ -212,7 +211,7 @@ system_content curl -u root:taosdata -d 'select * from db.sys_mem_d_bbb_lga_1_w
print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",8.000000000],["2012-09-05 20:00:01.000",9.000000000]],"rows":2}@ then
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",8.000000000],["2012-09-05 20:00:05.000",9.000000000]],"rows":2}@ then
return -1
endi
......@@ -234,7 +233,7 @@ system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 134
system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' 127.0.0.1:6020/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[7]],"rows":1}@ then
return -1
endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册