def getTestCluster(name): f = os.path.join(bigtest.confdir(), "tc-%s" % name, "class") c = None if os.path.exists(f): c = file(f).read().strip() if not c: return if "." in c: __import__(c[:c.rindex(".")]) cls = eval(c) return cls(name)
def getNode(name): f = os.path.join(bigtest.confdir(), "node-%s" % name, "class") c = None if os.path.exists(f): c = open(f).read().strip() if not c: return if "." in c: k = c[:c.index(".")] m = __import__(c[:c.rindex(".")]) e = {k : m,} else: c = {} cls = eval(c, e) return cls(name)
def __init__(self, name): # name is a generic name that indicates its role, but not its type (local kvm or others) # or location (domain name or IP address) self.name_ = name self.statedir_ = os.path.join(bigtest.confdir(), "node-%s" % name)
def getAllNodes(): nodes = [] for name in sorted([n[5:] for n in os.listdir(bigtest.confdir()) if n.startswith("node-")]): nodes.append(getNode(name)) return nodes
def __init__(self, name): self.name_ = name self.statedir_ = os.path.join(bigtest.confdir(), "tc-%s" % name) self.configFile_ = os.path.join(os.path.dirname(__file__), "%s.conf" % name)
def getAllTestClusters(): tcs = [] for name in sorted([n[3:] for n in os.listdir(bigtest.confdir()) if n.startswith("tc-")]): tcs.append(TestCluster(name)) return tcs
def getAllTestClusters(): tcs = [] for name in sorted( [n[3:] for n in os.listdir(bigtest.confdir()) if n.startswith("tc-")]): tcs.append(TestCluster(name)) return tcs