Exemplo n.º 1
0
def createNet():
    tools = testTools.Tools()
    tools.createTestNet(2, 1, "streight")
    time.sleep(1)
    tools.buildTestNet()
    tools.checkStatus()
    time.sleep(20)
    agents = Agent(tools.getAgents(), "shell")
    agents.addHostsToNodes()

    return tools, agents
Exemplo n.º 2
0
 def test_network(self):
     self.tools = testTools.Tools()
     self.tools.createTestNet(self.nets, self.nodes, self.mode)
     time.sleep(1)
     build = False
     build = self.tools.buildTestNet()
     self.assertTrue(build, "Network could not be instantiated.")
     status = self.tools.checkStatus()
     self.assertTrue(status[0], status[1])
     time.sleep(20)
     self.tools.getAgents()
     self.assertTrue(self.tools.checkNodesAlive(),
                     "created nodes not online...")
     self.assertTrue(self.tools.destroyNet(), "created Nodes still online.")
     self.tools.deleteDoc()
Exemplo n.º 3
0
def createNet(nets, nodes):
    tstart_rollout = time.time()
    tools = testTools.Tools()
    tools.createTestNet(nets, nodes, "streight")
    time.sleep(1)
    tools.buildTestNet()
    done, msg = tools.checkStatus()
    print msg
    if done:
        t_end_rollout = time.time()
    else:
        t_end_rollout = 0
    t_rollout = t_end_rollout - tstart_rollout
    time.sleep(10)
    tstart_destroy = time.time()

    tools.destroyNet()
    t_end_destroy = time.time()
    t_destroy = t_end_destroy - tstart_destroy
    return t_rollout, t_destroy
Exemplo n.º 4
0
 def setUp(self):
     self.tools = testTools.Tools()
Exemplo n.º 5
0
 def setUpClass(self):
    self.tools = testTools.Tools()
Exemplo n.º 6
0
 def setUpClass(self):
     self.endpoints = testTools.Tools()
     self.headers = self.endpoints.getHeaders()
     self.basePath = self.endpoints.getBasepath()
     self.testDocName = "testDoc"
     self.docID = -1