def server_opts_reverse(self, node=lan): try: lan_priv_ip = node.get_interface_ipaddr(lan.iface_dut) except: lan_priv_ip = node.get_interface_ipaddr("wlan0") board.uci_forward_traffic_redirect("tcp", "5001", lan_priv_ip) self.rip = board.get_interface_ipaddr(board.wan_iface) return ""
def runTest(self): super(NetperfUdpTest, self).runTest() self.run_netperf( lan, "192.168.0.1 -c -C -l 30 -t UDP_STREAM -- -m 1460 -M 1460") # setup port forwarding to lan netperf server lan_priv_ip = lan.get_interface_ipaddr(lan.iface_dut) board.uci_forward_traffic_redirect("tcp", "12865", lan_priv_ip) # setup port for data socket separate from control port board.uci_forward_traffic_redirect("udp", "12866", lan_priv_ip) wan_ip = board.get_interface_ipaddr(board.wan_iface) # send at router ip, which will forward to lan client wan.sendline('') wan.expect(prompt) self.run_netperf( wan, wan_ip, "-c -C -l 30 -t UDP_STREAM -- -P ,12866 -m 1460 -M 1460")
def runTest(self): # setup port forwarding to lan netperf server lan_priv_ip = lan.get_interface_ipaddr(lan.iface_dut) board.uci_forward_traffic_redirect("tcp", "12865", lan_priv_ip) # setup port for data socket separate from control port board.uci_forward_traffic_redirect("tcp", "12866", lan_priv_ip) wan_ip = board.get_interface_ipaddr(board.wan_iface) # send at router ip, which will forward to lan client wan.sendline('') wan.expect(prompt) board.sendline('mpstat -P ALL 30 1') speed = self.run_netperf(wan, wan_ip, "-c -C -l 30 -t TCP_STREAM -- -P ,12866") board.expect( 'Average.*idle\r\nAverage:\s+all(\s+[0-9]+.[0-9]+){10}\r\n') idle_cpu = float(board.match.group(1)) avg_cpu = 100 - float(idle_cpu) lib.common.test_msg("Average cpu usage was %s" % avg_cpu) self.result_message = "Setup NetperfReverse and Ran Throughput (Speed = %s 10^6bits/sec, CPU = %s)" % ( speed, avg_cpu)