| AUTHOR = "mbligh@google.com (Martin Bligh) and bboe@google.com (Bryce Boe)" |
| TIME = "SHORT" |
| NAME = "Netperf Multi-machine" |
| TEST_CATEGORY = "Stress" |
| TEST_TYPE = "Server" |
| SYNC_COUNT = 2 |
| DOC = """ |
| netperf_test is a 2 machine test (server/client) that measures the performance |
| of various network attributes. |
| |
| Arguments to run_test: |
| |
| server_ip - the ip of the server (automatically filled in) |
| client_ip - the ip of the client (automatically filled in) |
| role - specifies either client or server (automatically filled in) |
| test - the list of valid netperf tests that can be run |
| This currently is: |
| TCP_STREAM, TCP_SENDFILE, TCP_RR, TCP_CRR, UDP_STREAM, UDP_RR |
| test_time - Specifies how long each iteration of the test should run for. |
| stream_list - A list containing the number of streams to run the test for. If |
| the list is [1,10,100] then the test will run 3 times. If |
| bidirectional is set then there will be the specified number of |
| bidirectional streams. |
| """ |
| |
| from autotest_lib.server import utils |
| |
| |
| def run(pair): |
| print "running on %s and %s\n" % (pair[0], pair[1]) |
| server = hosts.create_host(pair[0]) |
| client = hosts.create_host(pair[1]) |
| |
| server_at = autotest.Autotest(server) |
| client_at = autotest.Autotest(client) |
| |
| template = ''.join(["job.run_test('netperf2', server_ip='%s', client_ip=", |
| "'%s', role='%s', test='TCP_STREAM', test_time=10,", |
| "stream_list=[1,10])"]) |
| |
| server_control_file = template % (server.ip, client.ip, 'server') |
| client_control_file = template % (server.ip, client.ip, 'client') |
| |
| server_command = subcommand(server_at.run, |
| [server_control_file, server.hostname]) |
| client_command = subcommand(client_at.run, |
| [client_control_file, client.hostname]) |
| |
| parallel([server_command, client_command]) |
| |
| |
| # grab the pairs (and failures) |
| (pairs, failures) = utils.form_ntuples_from_machines(machines, 2) |
| |
| # log the failures |
| for failure in failures: |
| job.record("FAIL", failure[0], "netperf2", failure[1]) |
| |
| # now run through each pair and run |
| parallel_simple(run, pairs) |