1AUTHOR = "kdlucas@google.com (Kelly Lucas)"
2TIME = "MEDIUM"
3NAME = "Netperf Stress"
4TEST_CATEGORY = "Stress"
5TEST_CLASS = 'Network'
6TEST_TYPE = "Server"
7SYNC_COUNT = 2
8DOC = """
9netperf_stress is a 2 machine test (server/client) that measures the performance
10of various network attributes. This test will cycle through the various types
11of supported tests and streams, and will take about 1 hour to run.
12You can adjust the streams by changing the values of the streams list in the
13run function.
14
15Arguments to run_test:
16
17test          - the list of valid netperf tests that can be run
18                This currently is:
19                  TCP_STREAM, TCP_SENDFILE, TCP_RR, TCP_CRR, UDP_STREAM, UDP_RR
20test_time     - Specifies how long each iteration of the test should run for.
21stream_list   - A list containing the number of streams to run the test for. If
22                the list is [1,10,100] then the test will run 3 times. If
23                bidirectional is set then there will be the specified number of
24                bidirectional streams.
25"""
26
27from autotest_lib.server import utils
28
29
30def run(pair):
31    """
32    Run netperf with various parameter settings.
33    """
34    streams = [1, 10, 20, 40, 60, 80, 100, 200]
35    for t in ['TCP_STREAM', 'TCP_MAERTS', 'TCP_RR', 'TCP_CRR', 'UDP_RR']:
36        tag = 'netprerf2' + t
37        job.run_test('netperf2', tag=tag, pair=pair, test=t, time=60,
38                     stream_list=streams, cycles=1)
39
40
41# grab the pairs (and failures)
42(pairs, failures) = utils.form_ntuples_from_machines(machines, 2)
43
44# log the failures
45for failure in failures:
46    job.record("FAIL", failure[0], "netperf2", failure[1])
47
48# now run through each pair and run
49job.parallel_simple(run, pairs, log=False)
50