未验证 提交 26aabe94 编写于 作者: S slguan 提交者: GitHub

Merge pull request #1672 from taosdata/feature/mpeer

[TD-148] add test scripts
......@@ -22,6 +22,7 @@
#include "ttime.h"
#include "tutil.h"
#include "tsocket.h"
#include "tbalance.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtLog.h"
......@@ -98,6 +99,9 @@ static int32_t mgmtDnodeActionDelete(SSdbOper *pOper) {
}
}
mgmtDropMnode(pDnode->dnodeId);
balanceNotify();
mTrace("dnode:%d, all vgroups:%d is dropped from sdb", pDnode->dnodeId, numOfVgroups);
return TSDB_CODE_SUCCESS;
}
......@@ -432,7 +436,7 @@ static int32_t mgmtDropDnodeByIp(uint32_t ip) {
SDnodeObj *pDnode = mgmtGetDnodeByIp(ip);
if (pDnode == NULL) {
mError("dnode:%s, is not exist", taosIpStr(ip));
return TSDB_CODE_INVALID_VALUE;
return TSDB_CODE_DNODE_NOT_EXIST;
}
if (pDnode->privateIp == dnodeGetMnodeMasteIp()) {
......@@ -514,18 +518,6 @@ static int32_t mgmtGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++;
pShow->bytes[cols] = 8;
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
strcpy(pSchema[cols].name, "create time");
pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++;
pShow->bytes[cols] = 10;
pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
strcpy(pSchema[cols].name, "status");
pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++;
pShow->bytes[cols] = 2;
pSchema[cols].type = TSDB_DATA_TYPE_SMALLINT;
strcpy(pSchema[cols].name, "open vnodes");
......@@ -538,13 +530,17 @@ static int32_t mgmtGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++;
#ifdef _VPEER
pShow->bytes[cols] = 18;
pShow->bytes[cols] = 10;
pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
strcpy(pSchema[cols].name, "balance");
strcpy(pSchema[cols].name, "status");
pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++;
pShow->bytes[cols] = 8;
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
strcpy(pSchema[cols].name, "create time");
pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++;
#endif
pMeta->numOfColumns = htons(cols);
pShow->numOfColumns = cols;
......@@ -590,14 +586,6 @@ static int32_t mgmtRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, voi
strcpy(pWrite, ipstr);
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
*(int64_t *)pWrite = pDnode->createdTime;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
strcpy(pWrite, mgmtGetDnodeStatusStr(pDnode->status));
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
*(int16_t *)pWrite = pDnode->openVnodes;
cols++;
......@@ -605,13 +593,16 @@ static int32_t mgmtRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, voi
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
*(int16_t *)pWrite = pDnode->totalVnodes;
cols++;
#ifdef _VPEER
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
strcpy(pWrite, mgmtGetDnodeStatusStr(pDnode->status));
cols++;
#endif
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
*(int64_t *)pWrite = pDnode->createdTime;
cols++;
numOfRows++;
mgmtReleaseDnode(pDnode);
}
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 3
system sh/exec_up.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode2 -s start
sql connect
sleep 2000
sql create dnode 192.168.0.2
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.2
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
print ============== step1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
return -1
endi
if $data3_192.168.0.2 != null then
return -1
endi
$y = 1
step1:
print ============== step2
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
system sh/exec.sh -n dnode2 -s start
sql create dnode 192.168.0.2
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
goto show2
endi
if $data3_192.168.0.2 != slave then
goto show2
endi
print ============== step3
sql drop dnode 192.168.0.2
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
goto show4
endi
if $data3_192.168.0.2 != null then
goto show4
endi
sql show dnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != 4 then
goto show4
endi
if $data3_192.168.0.2 != null then
goto show4
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 2000
$y = $y + 1
print ===> loop times: $y
if $y < 10 then
goto step1
endi
\ No newline at end of file
......@@ -18,13 +18,12 @@ system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
return -1
endi
......@@ -41,73 +40,30 @@ show2:
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
goto show2
endi
if $data3_192.168.0.2 != slave then
if $data3_2 != slave then
goto show2
endi
print ============== step3
sql drop dnode 192.168.0.1 -x error1
print should not drop master
return -1
error1:
sql_error drop dnode 192.168.0.1 -x error1
print should not drop master
print ============== step4
system sh/exec_up.sh -n dnode1 -s stop
sleep 8000
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != undecided then
goto show4
endi
if $data3_192.168.0.2 != master then
goto show4
endi
sql_error show mnodes
print error of no master
print ============== step5
sql drop dnode 192.168.0.1
sleep 8000
$x = 0
show5:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != null then
goto show5
endi
if $data3_192.168.0.2 != master then
goto show5
endi
sql_error drop dnode 192.168.0.1
print error of no master
print ============== step6
system sh/deploy.sh -n dnode1 -m 192.168.0.2 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.1
system sh/exec_up.sh -n dnode1 -s start
sql create dnode 192.168.0.1
sleep 5000
$x = 0
show6:
......@@ -118,12 +74,12 @@ show6:
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != slave then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
goto show6
endi
if $data3_192.168.0.2 != master then
if $data3_2 != slave then
goto show6
endi
......@@ -141,15 +97,15 @@ show7:
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
print 192.168.0.3 ==> $data3_192.168.0.3
if $data3_192.168.0.1 != slave then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
print 192.168.0.3 ==> $data3_3
if $data3_1 != master then
goto show7
endi
if $data3_192.168.0.2 != master then
if $data3_2 != slave then
goto show7
endi
if $data3_192.168.0.3 != null then
if $data3_3 != null then
goto show7
endi
......@@ -17,19 +17,18 @@ system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.2
print ============== step1
system sh/exec.sh -n dnode1 -s start
sleep 3000
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
return -1
endi
print ============== step2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode 192.168.0.2
$x = 0
......@@ -41,24 +40,24 @@ show2:
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
goto show2
endi
if $data3_192.168.0.2 != slave then
if $data3_2 != slave then
goto show2
endi
print ============== step3
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
sql create dnode 192.168.0.3
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -78,9 +77,9 @@ sql drop dnode 192.168.0.2
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -95,7 +94,7 @@ if $dnode3Role != slave then
return -1
endi
system sh/exec.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode2 -s stop
print ============== step5
sleep 2000
......@@ -103,13 +102,13 @@ sql create dnode 192.168.0.2
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.3
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -125,49 +124,14 @@ if $dnode3Role != slave then
endi
print ============== step6
system sh/exec.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode1 -s stop
sleep 10000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
if $dnode1Role != undecided then
return -1
endi
if $dnode2Role != null then
return -1
endi
if $dnode3Role != master then
return -1
endi
sql_error show mnodes
print ============== step7
sql drop dnode 192.168.0.1
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
if $dnode1Role != null then
return -1
endi
if $dnode2Role != slave then
return -1
endi
if $dnode3Role != master then
return -1
endi
sql_error drop dnode 192.168.0.1
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
\ No newline at end of file
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
......@@ -17,19 +17,18 @@ system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.2
print ============== step1
system sh/exec.sh -n dnode1 -s start
sleep 3000
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
return -1
endi
print ============== step2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode 192.168.0.2
$x = 0
......@@ -41,57 +40,25 @@ show2:
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
goto show2
endi
if $data3_192.168.0.2 != slave then
if $data3_2 != slave then
goto show2
endi
print ============== step3
system sh/exec.sh -n dnode1 -s stop
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
if $dnode1Role != undecided then
return -1
endi
if $dnode2Role != master then
return -1
endi
system sh/exec_up.sh -n dnode1 -s stop
sql_error show mnodes
print ============== step4
sql drop dnode 192.168.0.1
sleep 6000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
if $dnode1Role != null then
return -1
endi
if $dnode2Role != master then
return -1
endi
sql_error drop dnode 192.168.0.1
print ============== step5
system sh/deploy.sh -n dnode1 -m 192.168.0.2 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.1
system sh/exec.sh -n dnode1 -s start
sql create dnode 192.168.0.1
sql show mnodes
system sh/exec_up.sh -n dnode1 -s start
sql_error create dnode 192.168.0.1
$x = 0
step5:
......@@ -101,12 +68,13 @@ step5:
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != slave then
sql show mnodes -x step5
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
goto step5
endi
if $data3_192.168.0.2 != master then
if $data3_2 != slave then
goto step5
endi
\ No newline at end of file
......@@ -17,19 +17,18 @@ system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.2
print ============== step1
system sh/exec.sh -n dnode1 -s start
sleep 3000
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
return -1
endi
print ============== step2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode 192.168.0.2
$x = 0
......@@ -41,24 +40,24 @@ show2:
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
goto show2
endi
if $data3_192.168.0.2 != slave then
if $data3_2 != slave then
goto show2
endi
print ============== step3
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
sql create dnode 192.168.0.3
sleep 6000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -78,9 +77,9 @@ sql drop dnode 192.168.0.2
sleep 6000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......
......@@ -17,19 +17,18 @@ system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.2
print ============== step1
system sh/exec.sh -n dnode1 -s start
sleep 3000
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
return -1
endi
print ============== step2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode 192.168.0.2
$x = 0
......@@ -41,24 +40,24 @@ show2:
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
if $data3_1 != master then
goto show2
endi
if $data3_192.168.0.2 != slave then
if $data3_2 != slave then
goto show2
endi
print ============== step3
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
sql create dnode 192.168.0.3
sleep 6000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -79,9 +78,9 @@ sql drop dnode 192.168.0.2
sleep 6000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -97,19 +96,19 @@ if $dnode3Role != slave then
endi
print ============== step5
system sh/exec.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.3
sleep 5000
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode 192.168.0.2
sleep 6000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -124,23 +123,3 @@ if $dnode3Role != slave then
return -1
endi
print ============== step6
system sh/exec.sh -n dnode1 -s stop
sleep 10000
sql drop dnode 192.168.0.1
sleep 12000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
if $dnode2Role != slave then
return -1
endi
if $dnode3Role != master then
return -1
endi
......@@ -17,33 +17,32 @@ system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.2
print ============== step1
system sh/exec.sh -n dnode1 -s start
sleep 3000
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
print 192.168.0.3 ==> $data3_192.168.0.3
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
print 192.168.0.3 ==> $data3_3
if $data3_1 != master then
return -1
endi
if $data3_192.168.0.2 != null then
if $data3_2 != null then
return -1
endi
if $data3_192.168.0.3 != null then
if $data3_3 != null then
return -1
endi
print ============== step2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode 192.168.0.2
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -59,14 +58,14 @@ if $dnode3Role != null then
endi
print ============== step3
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
sql create dnode 192.168.0.3
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -86,9 +85,9 @@ sql drop dnode 192.168.0.2
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -103,22 +102,22 @@ if $dnode3Role != slave then
return -1
endi
system sh/exec.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode2 -s stop
sleep 3000
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.3
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
print ============== step5
sql create dnode 192.168.0.2
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -134,13 +133,13 @@ if $dnode3Role != slave then
endi
print ============== step6
system sh/exec.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode1 -s stop
sleep 10000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -160,9 +159,9 @@ sql drop dnode 192.168.0.1
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -177,6 +176,6 @@ endi
# return -1
#endi
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
\ No newline at end of file
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
......@@ -16,34 +16,34 @@ system sh/cfg.sh -n dnode3 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 3
print ============== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
sql connect
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
print 192.168.0.3 ==> $data3_192.168.0.3
if $data3_192.168.0.1 != master then
print 192.168.0.1 ==> $data3_1
print 192.168.0.2 ==> $data3_2
print 192.168.0.3 ==> $data3_3
if $data3_1 != master then
return -1
endi
if $data3_192.168.0.2 != null then
if $data3_2 != null then
return -1
endi
if $data3_192.168.0.3 != null then
if $data3_3 != null then
return -1
endi
print ============== step2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode 192.168.0.2
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode4Role = $data3_192.168.0.4
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -63,15 +63,15 @@ if $dnode4Role != null then
endi
print ============== step3
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
sql create dnode 192.168.0.3
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode4Role = $data3_192.168.0.4
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -92,15 +92,15 @@ endi
print ============== step4
system sh/exec.sh -n dnode4 -s start
system sh/exec_up.sh -n dnode4 -s start
sql create dnode 192.168.0.4
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode4Role = $data3_192.168.0.4
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -124,10 +124,10 @@ sql drop dnode 192.168.0.2
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode4Role = $data3_192.168.0.4
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -146,23 +146,23 @@ if $dnode4Role != slave then
return -1
endi
system sh/exec.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode2 -s stop
sleep 3000
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.3
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
print ============== step6
sql create dnode 192.168.0.2
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode4Role = $data3_192.168.0.4
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -182,14 +182,14 @@ if $dnode4Role != slave then
endi
print ============== step7
system sh/exec.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode1 -s stop
sleep 10000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode4Role = $data3_192.168.0.4
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -204,10 +204,10 @@ sql drop dnode 192.168.0.1
sleep 8000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode4Role = $data3_192.168.0.4
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -226,7 +226,7 @@ endi
# return -1
#endi
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec.sh -n dnode4 -s stop
\ No newline at end of file
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
system sh/exec_up.sh -n dnode4 -s stop
\ No newline at end of file
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.3
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.3
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.3
print ============== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sleep 3000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
if $dnode1Role != master then
return -1
endi
if $dnode2Role != null then
return -1
endi
if $dnode3Role != null then
return -1
endi
print ============== step2
sql create dnode 192.168.0.2
system sh/exec.sh -n dnode2 -s start
sleep 1000
sql create dnode 192.168.0.3
system sh/exec.sh -n dnode3 -s start
print ============== step3
system sh/exec.sh -n dnode1 -s start
$x = 0
show3:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
goto show3
endi
if $data3_192.168.0.2 != slave then
goto show3
endi
sleep 1000
system sh/exec.sh -n dnode1 -s stop
print ============== step4
print ========= start wait dnode2 is master
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.2 != master then
goto show4
endi
print ============== step5
print ========= start wait dnode1 is offline
step5:
sql show dnodes
$dnode1Status = $data4_192.168.0.1
$dnode2Status = $data4_192.168.0.2
$dnode3Status = $data4_192.168.0.3
print 192.168.0.1 ==> $dnode1Status
print 192.168.0.2 ==> $dnode2Status
print 192.168.0.3 ==> $dnode3Status
if $dnode1Status != offline then
sleep 2000
goto step5
endi
......@@ -17,14 +17,14 @@ system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.3
system sh/cfg.sh -n dnode3 -c secondIp -v 192.168.0.3
print ============== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
sleep 3000
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......@@ -47,29 +47,29 @@ sql create dnode 192.168.0.3
print ============== step3
print ========= start dnode2 and dnode3
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sleep 1000
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
sleep 8000
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
sleep 4000
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
sleep 4000
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
sleep 4000
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
print ============== step4
sql show mnodes
$dnode1Role = $data3_192.168.0.1
$dnode2Role = $data3_192.168.0.2
$dnode3Role = $data3_192.168.0.3
$dnode1Role = $data3_1
$dnode2Role = $data3_2
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.2
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.2
print ========== step1 dnode1 start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ========== step2 connect to dnode1
sql create dnode 192.168.0.2
system sh/exec.sh -n dnode2 -s start
sleep 3000
print ========== step3
sql show dnodes
print 192.168.0.1 freeVnodes $data3_192.168.0.1
print 192.168.0.2 freeVnodes $data3_192.168.0.2
if $rows != 2 then
return -1
endi
if $data3_192.168.0.1 != 4 then
return -1
endi
if $data3_192.168.0.2 != 4 then
return -1
endi
print ========== step4
system sh/exec.sh -n dnode1 -s stop
sleep 3000
$x = 0
step4:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.2 != master then
goto step4
endi
sql drop dnode 192.168.0.1
print ========== step5
sleep 5000
$x = 0
step5:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != null then
goto step5
endi
print ========== step6
sql create dnode 192.168.0.1
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.2
system sh/exec.sh -n dnode1 -s start
$x = 0
step6:
$x = $x + 1
sleep 2000
if $x == 5 then
return -1
endi
sql show dnodes
print 192.168.0.1 ==> $data4_192.168.0.1
print 192.168.0.2 ==> $data4_192.168.0.2
if $data4_192.168.0.2 != ready then
goto step6
endi
......@@ -7,27 +7,34 @@ system sh/cfg.sh -n dnode1 -c secondIp -v 192.168.0.1
system sh/cfg.sh -n dnode2 -c secondIp -v 192.168.0.1
print ========== step1 dnode2 start
system sh/exec.sh -n dnode2 -s start
sleep 3000
system sh/exec_up.sh -n dnode2 -s start
sql connect
print ========== step2 connect to dnode2
sql create dnode 192.168.0.1
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
print ========== step3
sql show dnodes
print 192.168.0.1 freeVnodes $data3_192.168.0.1
print 192.168.0.2 freeVnodes $data3_192.168.0.2
print 192.168.0.1 openvnodes $data3_1
print 192.168.0.2 openvnodes $data3_2
print 192.168.0.1 totalvnodes $data4_1
print 192.168.0.2 totalvnodes $data4_2
if $rows != 2 then
return -1
endi
if $data3_192.168.0.1 != 4 then
if $data3_1 != 0 then
return -1
endi
if $data3_2 != 0 then
return -1
endi
if $data4_1 != 4 then
return -1
endi
if $data3_192.168.0.2 != 4 then
if $data4_2 != 4 then
return -1
endi
......
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c sockettype -v tcp
system sh/cfg.sh -n dnode2 -c sockettype -v tcp
system sh/cfg.sh -n dnode3 -c sockettype -v tcp
print ============== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sleep 3000
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
return -1
endi
print ============== step2
system sh/exec.sh -n dnode2 -s start
sql create dnode 192.168.0.2
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != master then
goto show2
endi
if $data3_192.168.0.2 != slave then
goto show2
endi
return
print ============== step3
sql drop dnode 192.168.0.1 -x error1
print should not drop master
return -1
error1:
print ============== step4
system sh/exec.sh -n dnode1 -s stop
sleep 8000
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != undecided then
goto show4
endi
if $data3_192.168.0.2 != master then
goto show4
endi
print ============== step5
sql drop dnode 192.168.0.1
sleep 8000
$x = 0
show5:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != null then
goto show5
endi
if $data3_192.168.0.2 != master then
goto show5
endi
print ============== step6
#system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
#system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/exec.sh -n dnode1 -s start
sql create dnode 192.168.0.1
sleep 5000
$x = 0
show6:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
if $data3_192.168.0.1 != slave then
goto show6
endi
if $data3_192.168.0.2 != master then
goto show6
endi
print ============== step7
system sh/exec.sh -n dnode3 -s start
sql create dnode 192.168.0.3
sleep 5000
$x = 0
show7:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show mnodes
print 192.168.0.1 ==> $data3_192.168.0.1
print 192.168.0.2 ==> $data3_192.168.0.2
print 192.168.0.3 ==> $data3_192.168.0.3
if $data3_192.168.0.1 != slave then
goto show7
endi
if $data3_192.168.0.2 != master then
goto show7
endi
if $data3_192.168.0.3 != null then
goto show7
endi
......@@ -5,9 +5,6 @@ run unique/mnode/mgmt25.sim
run unique/mnode/mgmt26.sim
run unique/mnode/mgmt33.sim
run unique/mnode/mgmt34.sim
run unique/mnode/mgmtr1.sim
run unique/mnode/mgmtr2.sim
run unique/mnode/drop.sim
run unique/mnode/reuse.sim
run unique/mnode/secondIp.sim
#################################
run unique/account/basic.sim
run unique/account/paras.sim
run unique/account/usage.sim
run unique/mnode/testSuite.sim
##################################
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册