提交 d51edbaf 编写于 作者: haoranc's avatar haoranc

test:add testcase r for TS-3524

上级 98fbf1ab
...@@ -136,7 +136,7 @@ class TDTestCase: ...@@ -136,7 +136,7 @@ class TDTestCase:
tdLog.info("Confirm the status of the dnode again") tdLog.info("Confirm the status of the dnode again")
tdSql.error("create mnode on dnode 2") tdSql.error("create mnode on dnode 2")
tdSql.query("select * from information_schema.ins_dnodes;") tdSql.query("select * from information_schema.ins_dnodes;")
print(tdSql.queryResult) # print(tdSql.queryResult)
clusterComCheck.checkDnodes(dnodeNumbers) clusterComCheck.checkDnodes(dnodeNumbers)
# recreate mnode # recreate mnode
...@@ -160,80 +160,38 @@ class TDTestCase: ...@@ -160,80 +160,38 @@ class TDTestCase:
if tdSql.queryResult[i][0] == "%s"%username : if tdSql.queryResult[i][0] == "%s"%username :
tdLog.info("create user:%s successfully"%username) tdLog.info("create user:%s successfully"%username)
# # create database and stable """ case for TS-3524 and test 'taos -h' """
# clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']) bPath = self.getBuildPath()
# tdLog.info("Take turns stopping Mnodes ") for i in range(6):
nodePort = 6030 + i*100
# tdDnodes=cluster.dnodes newTdSql=tdCom.newTdSql(port=nodePort)
# stopcount =0
# threads=[] dataPath = tdDnodes[1].dataDir
os.system(f"rm -rf {dataPath}/*")
# # create stable:stb_0 os.system(f"rm -rf {dataPath}/.runing")
# stableName= paraDict['stbName']
# newTdSql=tdCom.newTdSql() tdDnodes[1].stoptaosd()
# clusterComCreate.create_stables(newTdSql, paraDict["dbName"],stableName,paraDict['stbNumbers']) tdDnodes[1].starttaosd()
# #create child table:ctb_0 sleep(5)
# for i in range(paraDict['stbNumbers']): for i in range(6):
# stableName= '%s_%d'%(paraDict['stbName'],i) nodePort = 6030 + i*100
# newTdSql=tdCom.newTdSql() newTdSql=tdCom.newTdSql(port=nodePort)
# clusterComCreate.create_ctable(newTdSql, paraDict["dbName"],stableName,stableName, paraDict['ctbNum'])
# #insert date dataPath = tdDnodes[0].dataDir
# for i in range(paraDict['stbNumbers']): os.system(f"rm -rf {dataPath}/*")
# stableName= '%s_%d'%(paraDict['stbName'],i) os.system(f"rm -rf {dataPath}/.runing")
# newTdSql=tdCom.newTdSql()
# threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"]))) tdDnodes[0].stoptaosd()
# for tr in threads: tdDnodes[0].starttaosd()
# tr.start() sleep(5)
# for tr in threads: for i in range(6):
# tr.join() nodePort = 6030 + i*100
newTdSql=tdCom.newTdSql(port=nodePort)
# while stopcount < restartNumbers:
# tdLog.info(" restart loop: %d"%stopcount )
# if stopRole == "mnode":
# for i in range(mnodeNums):
# tdDnodes[i].stoptaosd()
# # sleep(10)
# tdDnodes[i].starttaosd()
# # sleep(10)
# elif stopRole == "vnode":
# for i in range(vnodeNumbers):
# tdDnodes[i+mnodeNums].stoptaosd()
# # sleep(10)
# tdDnodes[i+mnodeNums].starttaosd()
# # sleep(10)
# elif stopRole == "dnode":
# for i in range(dnodeNumbers):
# tdDnodes[i].stoptaosd()
# # sleep(10)
# tdDnodes[i].starttaosd()
# # sleep(10)
# # dnodeNumbers don't include database of schema
# if clusterComCheck.checkDnodes(dnodeNumbers):
# tdLog.info("dnode is ready")
# else:
# print("dnodes is not ready")
# self.stopThread(threads)
# tdLog.exit("one or more of dnodes failed to start ")
# # self.check3mnode()
# stopcount+=1
# clusterComCheck.checkDnodes(dnodeNumbers)
# clusterComCheck.checkDbRows(dbNumbers)
# # clusterComCheck.checkDb(dbNumbers,1,paraDict["dbName"])
# tdSql.execute("use %s" %(paraDict["dbName"]))
# tdSql.query("show stables")
# tdSql.checkRows(paraDict["stbNumbers"])
# # for i in range(paraDict['stbNumbers']):
# # stableName= '%s_%d'%(paraDict['stbName'],i)
# # tdSql.query("select * from %s"%stableName)
# # tdSql.checkRows(rowsPerStb)
def run(self): def run(self):
# print(self.master_dnode.cfgDict) # print(self.master_dnode.cfgDict)
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=1,stopRole='dnode') self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=1,stopRole='dnode')
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册