diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index ddedbf7c046f7a9656451dc245f2a04048efc830..145a56130ffef7cfd1581f564bba0998b40c2b9a 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -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); } diff --git a/tests/script/unique/mnode/basic1.sim b/tests/script/unique/mnode/basic1.sim deleted file mode 100644 index 98d4bf02bf463a7a306c3a55063578ebd42273f4..0000000000000000000000000000000000000000 --- a/tests/script/unique/mnode/basic1.sim +++ /dev/null @@ -1,15 +0,0 @@ -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 diff --git a/tests/script/unique/mnode/drop.sim b/tests/script/unique/mnode/drop.sim deleted file mode 100644 index f96a9100f1fe36da66238e285c1656349ccfc071..0000000000000000000000000000000000000000 --- a/tests/script/unique/mnode/drop.sim +++ /dev/null @@ -1,96 +0,0 @@ -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 diff --git a/tests/script/unique/mnode/mgmt22.sim b/tests/script/unique/mnode/mgmt22.sim index f51be5a3bb38a7882b3dc39e15aff561615e4d7b..3bfa86b55ab17fd31be3f4770f88a62b02298d7d 100644 --- a/tests/script/unique/mnode/mgmt22.sim +++ b/tests/script/unique/mnode/mgmt22.sim @@ -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 diff --git a/tests/script/unique/mnode/mgmt23.sim b/tests/script/unique/mnode/mgmt23.sim index d1a29b2cacefd5479f5127d6c75eeb45f5cf5406..c5ab9e27eae538b2211a1d7ad11f900d9116a628 100644 --- a/tests/script/unique/mnode/mgmt23.sim +++ b/tests/script/unique/mnode/mgmt23.sim @@ -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 diff --git a/tests/script/unique/mnode/mgmt24.sim b/tests/script/unique/mnode/mgmt24.sim index 6f9476865cd3392c3d8e7af876d0142d876f1cb1..6635c4e706ac2ec0cfd5002aa0d787cc443bcb02 100644 --- a/tests/script/unique/mnode/mgmt24.sim +++ b/tests/script/unique/mnode/mgmt24.sim @@ -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 diff --git a/tests/script/unique/mnode/mgmt25.sim b/tests/script/unique/mnode/mgmt25.sim index 6a5e55e933b1c4d3cbcc68986a467afabdeaf406..ca935d744fa7678b55c5d6b430523ccd55af88cb 100644 --- a/tests/script/unique/mnode/mgmt25.sim +++ b/tests/script/unique/mnode/mgmt25.sim @@ -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 diff --git a/tests/script/unique/mnode/mgmt26.sim b/tests/script/unique/mnode/mgmt26.sim index 527fea5792b43e65177cce24f65a8a8277f24dc5..4a5958b88aa3151ebadbf52695348fe25a345947 100644 --- a/tests/script/unique/mnode/mgmt26.sim +++ b/tests/script/unique/mnode/mgmt26.sim @@ -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 diff --git a/tests/script/unique/mnode/mgmt33.sim b/tests/script/unique/mnode/mgmt33.sim index f3c4d09dd34863beb9ec133beaf2dfda518df78e..629adad029a11efb0e35ca3e5178d3877538962e 100644 --- a/tests/script/unique/mnode/mgmt33.sim +++ b/tests/script/unique/mnode/mgmt33.sim @@ -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 diff --git a/tests/script/unique/mnode/mgmt34.sim b/tests/script/unique/mnode/mgmt34.sim index f526f2ee72c2d7a4e519fcf47a05360b0fdf287b..c811728debe1067c0cc4e88d479866797c44421a 100644 --- a/tests/script/unique/mnode/mgmt34.sim +++ b/tests/script/unique/mnode/mgmt34.sim @@ -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 diff --git a/tests/script/unique/mnode/mgmtr1.sim b/tests/script/unique/mnode/mgmtr1.sim deleted file mode 100644 index dc1d882eeee8002875d85a5ddf1e38d55cab493f..0000000000000000000000000000000000000000 --- a/tests/script/unique/mnode/mgmtr1.sim +++ /dev/null @@ -1,107 +0,0 @@ -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 - diff --git a/tests/script/unique/mnode/mgmtr2.sim b/tests/script/unique/mnode/mgmtr2.sim index e54c9f0f5b4ef3ec70323efee0b98b911d342672..06e8f6b9d9b730e68227f8d582fb909bb31128a1 100644 --- a/tests/script/unique/mnode/mgmtr2.sim +++ b/tests/script/unique/mnode/mgmtr2.sim @@ -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 diff --git a/tests/script/unique/mnode/reuse.sim b/tests/script/unique/mnode/reuse.sim deleted file mode 100644 index 0854795f8c65502fb93a25ab54796970049b98cf..0000000000000000000000000000000000000000 --- a/tests/script/unique/mnode/reuse.sim +++ /dev/null @@ -1,97 +0,0 @@ -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 - - diff --git a/tests/script/unique/mnode/secondIp.sim b/tests/script/unique/mnode/secondIp.sim index 475eba9c4d767c39a455db1b71bab51a8f122bb2..29d27cd88c0a4763abfd2203f4af3df01271361c 100644 --- a/tests/script/unique/mnode/secondIp.sim +++ b/tests/script/unique/mnode/secondIp.sim @@ -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 diff --git a/tests/script/unique/mnode/tcp_mgmt22.sim b/tests/script/unique/mnode/tcp_mgmt22.sim deleted file mode 100644 index 02d8d15d9b0e80a408bb623d426a1c755e775d4d..0000000000000000000000000000000000000000 --- a/tests/script/unique/mnode/tcp_mgmt22.sim +++ /dev/null @@ -1,155 +0,0 @@ -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 diff --git a/tests/script/unique/mnode/testSuite.sim b/tests/script/unique/mnode/testSuite.sim index 8b60f77c611b5b7ccaa3eeb0046409ba8075dee7..e1712fa4f6ebb509286f8397bd7f643578decfbd 100644 --- a/tests/script/unique/mnode/testSuite.sim +++ b/tests/script/unique/mnode/testSuite.sim @@ -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 diff --git a/tests/script/unique/testSuite.sim b/tests/script/unique/testSuite.sim index f3bb3ebb9203bf37e65f176bfea862efdf316ec2..374f9b7965ae134bd1acf08449d53a3e918a9e7e 100644 --- a/tests/script/unique/testSuite.sim +++ b/tests/script/unique/testSuite.sim @@ -1,5 +1,3 @@ ################################# -run unique/account/basic.sim -run unique/account/paras.sim -run unique/account/usage.sim +run unique/mnode/testSuite.sim ##################################