| OLD | NEW |
| 1 from autotest_lib.server import autotest, hosts, subcommand, test | 1 from autotest_lib.server import autotest, hosts, subcommand, test |
| 2 from autotest_lib.server import utils | 2 from autotest_lib.server import utils |
| 3 | 3 |
| 4 class netperf2(test.test): | 4 class netperf2(test.test): |
| 5 version = 2 | 5 version = 2 |
| 6 | 6 |
| 7 def run_once(self, pair, test, time, stream_list, cycles): | 7 def run_once(self, pair, test, time, stream_list, cycles): |
| 8 print "running on %s and %s\n" % (pair[0], pair[1]) | 8 print "running on %s and %s\n" % (pair[0], pair[1]) |
| 9 | 9 |
| 10 # Designate a label for the server side tests. | 10 # Designate a label for the server side tests. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 m.disable_ipfilters() | 26 m.disable_ipfilters() |
| 27 | 27 |
| 28 server_at = autotest.Autotest(server) | 28 server_at = autotest.Autotest(server) |
| 29 client_at = autotest.Autotest(client) | 29 client_at = autotest.Autotest(client) |
| 30 | 30 |
| 31 template = ''.join(["job.run_test('netperf2', server_ip='%s', ", | 31 template = ''.join(["job.run_test('netperf2', server_ip='%s', ", |
| 32 "client_ip='%s', role='%s', test='%s', ", | 32 "client_ip='%s', role='%s', test='%s', ", |
| 33 "test_time=%d, stream_list=%s, tag='%s', ", | 33 "test_time=%d, stream_list=%s, tag='%s', ", |
| 34 "iterations=%d)"]) | 34 "iterations=%d)"]) |
| 35 | 35 |
| 36 server_control_file = template % (server.ip, client.ip, 'server', test, | 36 server_control_file = template % (server.ip, client.ip, 'server', test, |
| 37 time, stream_list, test, cycles) | 37 time, stream_list, test, cycles) |
| 38 client_control_file = template % (server.ip, client.ip, 'client', test, | 38 client_control_file = template % (server.ip, client.ip, 'client', test, |
| 39 time, stream_list, test, cycles) | 39 time, stream_list, test, cycles) |
| 40 | 40 |
| 41 server_command = subcommand.subcommand(server_at.run, | 41 server_command = subcommand.subcommand(server_at.run, |
| 42 [server_control_file, server.hostname]) | 42 [server_control_file, server.hostname]) |
| 43 client_command = subcommand.subcommand(client_at.run, | 43 client_command = subcommand.subcommand(client_at.run, |
| 44 [client_control_file, client.hostname]) | 44 [client_control_file, client.hostname]) |
| 45 | 45 |
| 46 subcommand.parallel([server_command, client_command]) | 46 subcommand.parallel([server_command, client_command]) |
| 47 | 47 |
| 48 for m in [client, server]: | 48 for m in [client, server]: |
| 49 status = m.run('/sbin/iptables -L') | 49 status = m.run('/sbin/iptables -L') |
| 50 if not status.exit_status: | 50 if not status.exit_status: |
| 51 m.enable_ipfilters() | 51 m.enable_ipfilters() |
| OLD | NEW |