提交 42243430 编写于 作者: S Shengliang Guan

add test cases

上级 073f6b5e
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "dndDnode.h" #include "dndDnode.h"
#include "dndTransport.h" #include "dndTransport.h"
#include "dndVnodes.h" #include "dndVnodes.h"
#include "dndMnode.h"
static int32_t dndInitMgmtWorker(SDnode *pDnode); static int32_t dndInitMgmtWorker(SDnode *pDnode);
static void dndCleanupMgmtWorker(SDnode *pDnode); static void dndCleanupMgmtWorker(SDnode *pDnode);
...@@ -28,10 +29,10 @@ static int32_t dndReadDnodes(SDnode *pDnode); ...@@ -28,10 +29,10 @@ static int32_t dndReadDnodes(SDnode *pDnode);
static int32_t dndWriteDnodes(SDnode *pDnode); static int32_t dndWriteDnodes(SDnode *pDnode);
static void *dnodeThreadRoutine(void *param); static void *dnodeThreadRoutine(void *param);
static void dndProcessConfigDnodeReq(SDnode *pDnode, SRpcMsg *pMsg); static int32_t dndProcessConfigDnodeReq(SDnode *pDnode, SRpcMsg *pMsg);
static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg); static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pMsg);
static void dndProcessAuthRsp(SDnode *pDnode, SRpcMsg *pMsg); static void dndProcessAuthRsp(SDnode *pDnode, SRpcMsg *pMsg);
static void dndProcessGrantRsp(SDnode *pDnode, SRpcMsg *pMsg); static void dndProcessGrantRsp(SDnode *pDnode, SRpcMsg *pMsg);
int32_t dndGetDnodeId(SDnode *pDnode) { int32_t dndGetDnodeId(SDnode *pDnode) {
SDnodeMgmt *pMgmt = &pDnode->dmgmt; SDnodeMgmt *pMgmt = &pDnode->dmgmt;
...@@ -458,13 +459,11 @@ static void dndProcessAuthRsp(SDnode *pDnode, SRpcMsg *pMsg) { assert(1); } ...@@ -458,13 +459,11 @@ static void dndProcessAuthRsp(SDnode *pDnode, SRpcMsg *pMsg) { assert(1); }
static void dndProcessGrantRsp(SDnode *pDnode, SRpcMsg *pMsg) { assert(1); } static void dndProcessGrantRsp(SDnode *pDnode, SRpcMsg *pMsg) { assert(1); }
static void dndProcessConfigDnodeReq(SDnode *pDnode, SRpcMsg *pMsg) { static int32_t dndProcessConfigDnodeReq(SDnode *pDnode, SRpcMsg *pMsg) {
dError("config msg is received, but not supported yet"); dError("config msg is received, but not supported yet");
SCfgDnodeMsg *pCfg = pMsg->pCont; SCfgDnodeMsg *pCfg = pMsg->pCont;
int32_t code = TSDB_CODE_OPS_NOT_SUPPORT; return TSDB_CODE_OPS_NOT_SUPPORT;
SRpcMsg rspMsg = {.handle = pMsg->handle, .pCont = NULL, .contLen = 0, .code = code};
rpcSendResponse(&rspMsg);
} }
void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pMsg) { void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pMsg) {
...@@ -646,11 +645,8 @@ static void dndProcessMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) { ...@@ -646,11 +645,8 @@ static void dndProcessMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) {
case TDMT_DND_DROP_MNODE: case TDMT_DND_DROP_MNODE:
code = dndProcessDropMnodeReq(pDnode, pMsg); code = dndProcessDropMnodeReq(pDnode, pMsg);
break; break;
case TDMT_DND_NETWORK_TEST:
dndProcessStartupReq(pDnode, pMsg);
break;
case TDMT_DND_CONFIG_DNODE: case TDMT_DND_CONFIG_DNODE:
dndProcessConfigDnodeReq(pDnode, pMsg); code = dndProcessConfigDnodeReq(pDnode, pMsg);
break; break;
case TDMT_MND_STATUS_RSP: case TDMT_MND_STATUS_RSP:
dndProcessStatusRsp(pDnode, pMsg); dndProcessStatusRsp(pDnode, pMsg);
......
...@@ -31,6 +31,7 @@ void Testbase::InitLog(const char* path) { ...@@ -31,6 +31,7 @@ void Testbase::InitLog(const char* path) {
tsdbDebugFlag = 0; tsdbDebugFlag = 0;
cqDebugFlag = 0; cqDebugFlag = 0;
tscEmbeddedInUtil = 1; tscEmbeddedInUtil = 1;
tsAsyncLog = 0;
taosRemoveDir(path); taosRemoveDir(path);
taosMkDir(path); taosMkDir(path);
...@@ -47,7 +48,7 @@ void Testbase::Init(const char* path, int16_t port) { ...@@ -47,7 +48,7 @@ void Testbase::Init(const char* path, int16_t port) {
char firstEp[TSDB_EP_LEN] = {0}; char firstEp[TSDB_EP_LEN] = {0};
snprintf(firstEp, TSDB_EP_LEN, "%s:%u", fqdn, port); snprintf(firstEp, TSDB_EP_LEN, "%s:%u", fqdn, port);
InitLog("/tmp/tdlog"); InitLog("/tmp/td");
server.Start(path, fqdn, port, firstEp); server.Start(path, fqdn, port, firstEp);
client.Init("root", "taosdata", fqdn, port); client.Init("root", "taosdata", fqdn, port);
taosMsleep(1100); taosMsleep(1100);
......
...@@ -58,4 +58,11 @@ if $data03 != 0 then ...@@ -58,4 +58,11 @@ if $data03 != 0 then
return -1 return -1
endi endi
print =============== show vgroups
sql use d4
if $rows == 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -23,6 +23,15 @@ endi ...@@ -23,6 +23,15 @@ endi
print $data00 $data01 $data02 print $data00 $data01 $data02
sql create table st2 (ts timestamp, i float) tags (j bigint)
sql show stables
if $rows != 2 then
return -1
endi
print $data00 $data01 $data02
print $data00 $data11 $data12
return return
print =============== create child table print =============== create child table
......
...@@ -7,5 +7,7 @@ ...@@ -7,5 +7,7 @@
# ---- db # ---- db
./test.sh -f general/db/basic1.sim ./test.sh -f general/db/basic1.sim
# ---- table
./test.sh -f general/table/basic1.sim
#======================b1-end=============== #======================b1-end===============
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册