def run_nox(self, mininet_vm, num, port_start): """ Connect to the mininet_vm and run 'num' instances of nox as a pyswitch with packet dumping. """ kill_client = SSHClientPlus.exec_command_plus( mininet_vm[0], "mininet", "mininet", "sudo kill `ps -ae | grep lt-nox_core | awk '{ print $1 }'`", port=mininet_vm[1], ) kill_client.wait() self.nox_clients = [] for i in xrange(num): port = port_start + i cmd = "cd noxcore/build/src; ./nox_core -i ptcp:%s %s" % ( port, self.NOX_APPS, ) client = SSHClientPlus.exec_command_plus( mininet_vm[0], "mininet", "mininet", cmd, port=mininet_vm[1], ) self.nox_clients.append(client)
def connect_networks(self, flowvisors, mininet_vms, switch="ovsk"): """ Create a 2-switch, 2-host linear topology on each mininet vm Connect the switches to the FV. """ num = min([len(flowvisors), len(mininet_vms)]) self.mininet_vm_clients = [] for i in xrange(num): logger.debug("Connecting to the mininet VM at %s:%s" % mininet_vms[i]) cmd = "sudo mn --topo=%s " % self.MININET_TOPO +\ "--controller=remote --ip=%s --port=%s --mac --switch=%s" % ( flowvisors[i]["host"], flowvisors[i]["of_port"], switch, ) client = SSHClientPlus.exec_command_plus( mininet_vms[i][0], "mininet", "mininet", cmd, port=mininet_vms[i][1], ) self.mininet_vm_clients.append(client) logger.debug( client.wait_for_prompt(prompt="Starting CLI:\n", timeout=test_settings.TIMEOUT))
def connect_networks(self, flowvisors, mininet_vms, switch="ovsk"): """ Create a 2-switch, 2-host linear topology on each mininet vm Connect the switches to the FV. """ num = min([len(flowvisors), len(mininet_vms)]) self.mininet_vm_clients = [] for i in xrange(num): logger.debug("Connecting to the mininet VM at %s:%s" % mininet_vms[i]) cmd = "sudo mn --topo=%s " % self.MININET_TOPO +\ "--controller=remote --ip=%s --port=%s --mac --switch=%s" % ( flowvisors[i]["host"], flowvisors[i]["of_port"], switch, ) client = SSHClientPlus.exec_command_plus( mininet_vms[i][0], "mininet", "mininet", cmd, port=mininet_vms[i][1], ) self.mininet_vm_clients.append(client) logger.debug( client.wait_for_prompt( prompt="Starting CLI:\n", timeout=test_settings.TIMEOUT))