test: add cluster global tdDnodes

This commit is contained in:
Alex Duan 2023-05-16 10:03:18 +08:00
parent 9e8cc7d18c
commit 1ccf9ed4ff
2 changed files with 15 additions and 1 deletions

View File

@ -859,5 +859,15 @@ class TDDnodes:
def getAsan(self): def getAsan(self):
return self.asan return self.asan
global tdDnodes
tdDnodes = TDDnodes() tdDnodes = TDDnodes()
# global get
def tdDnodes_Get():
global tdDnodes
return tdDnodes
# global set
def tdDnodes_Set(newInst):
global tdDnodes
tdDnodes = newInst

View File

@ -385,6 +385,8 @@ if __name__ == "__main__":
tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums)) tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums))
dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums, mnodeNums=mnodeNums, independentMnode=independentMnode) dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums, mnodeNums=mnodeNums, independentMnode=independentMnode)
tdDnodes = ClusterDnodes(dnodeslist) tdDnodes = ClusterDnodes(dnodeslist)
# set to global
tdDnodes_Set(tdDnodes)
tdDnodes.init(deployPath, masterIp) tdDnodes.init(deployPath, masterIp)
tdDnodes.setTestCluster(testCluster) tdDnodes.setTestCluster(testCluster)
tdDnodes.setValgrind(valgrind) tdDnodes.setValgrind(valgrind)
@ -555,6 +557,8 @@ if __name__ == "__main__":
tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums)) tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums))
dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums, mnodeNums=mnodeNums, independentMnode=independentMnode) dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums, mnodeNums=mnodeNums, independentMnode=independentMnode)
tdDnodes = ClusterDnodes(dnodeslist) tdDnodes = ClusterDnodes(dnodeslist)
# set to global
tdDnodes_Set(tdDnodes)
tdDnodes.init(deployPath, masterIp) tdDnodes.init(deployPath, masterIp)
tdDnodes.setTestCluster(testCluster) tdDnodes.setTestCluster(testCluster)
tdDnodes.setValgrind(valgrind) tdDnodes.setValgrind(valgrind)