def test_native_tp(nhosts, ifname, config): FlowPrinter.print_desc('Native Host to Host throughput') result_list = [] server_host = nhosts[0] server = PerfInstance('Host-' + server_host.host + '-Server', config, server=True) if not server.setup_ssh(server_host): server.display('SSH failed, check IP or make sure public key is configured') else: server.display('SSH connected') server.create() # if inter-node-only requested we avoid running the client on the # same node as the server - but only if there is at least another # IP provided if config.inter_node_only and len(nhosts) > 1: # remove the first element of the list nhosts.pop(0) # IP address clients should connect to, check if the user # has passed a server listen interface name if ifname: # use the IP address configured on given interface server_ip = server.get_interface_ip(ifname) if not server_ip: print('Error: cannot get IP address for interface ' + ifname) else: server.display('Clients will use server IP address %s (%s)' % (server_ip, ifname)) else: # use same as ssh IP server_ip = server_host.host if server_ip: # start client side, 1 per host provided for client_host in nhosts: client = PerfInstance('Host-' + client_host.host + '-Client', config) if not client.setup_ssh(client_host): client.display('SSH failed, check IP or make sure public key is configured') else: client.buginf('SSH connected') client.create() if client_host == server_host: desc = 'Native intra-host' else: desc = 'Native inter-host' res = client.run_client(desc, server_ip, server, bandwidth=config.vm_bandwidth) result_list.append(res) client.dispose() server.dispose() return result_list
def ext_host_tp_test(self): client = PerfInstance('Host-' + ext_host_list[1] + '-Client', config) if not client.setup_ssh(ext_host_list[1], ext_host_list[0]): client.display('SSH failed, check IP or make sure public key is configured') else: client.buginf('SSH connected') client.create() fpr.print_desc('External-VM (upload/download)') res = client.run_client('External-VM', self.server.ssh_ip, self.server, bandwidth=config.vm_bandwidth, bidirectional=True) if res: rescol.add_flow_result(res) client.dispose()
def ext_host_tp_test(self): client = PerfInstance('Host-' + self.config.ext_host.host + '-Client', self.config) if not client.setup_ssh(self.config.ext_host): client.display('SSH to ext host failed, check IP or make sure public key is configured') else: client.buginf('SSH connected') client.create() FlowPrinter.print_desc('External-VM (upload/download)') target_ip = self.server.ssh_access.host if self.config.same_network_only: target_ip = self.server.internal_ip res = client.run_client('External-VM', target_ip, self.server, bandwidth=self.config.vm_bandwidth, bidirectional=True) if res: self.rescol.add_flow_result(res) client.dispose()