1AUTHOR = "kdlucas@google.com (Kelly Lucas)"
2TIME = "SHORT"
3NAME = "Netpipe Basic"
4TEST_CATEGORY = "Stress"
5TEST_CLASS = 'Hardware'
6TEST_TYPE = "Server"
7SYNC_COUNT = 2
8DOC = """
9netpipe_test is a test which produces bandwidth and latency values for
10incrementing buffer sizes.
11
12Arguments to run_test:
13bidirectional - indicates whether the test should run simultaneously in both
14                directions
15buffer_size   - Sets the send and receive TCP buffer sizes (from man NPtcp)
16upper_bound   - Specify the upper boundary to the size of message being tested.
17                By default, NetPIPE will stop when the time to transmit a block
18                exceeds one second. (from man NPtcp)
19variance      -  NetPIPE chooses the message sizes at regular intervals,
20                increasing them exponentially from the lower boundary to the
21                upper boundary. At each point, it also tests perturbations of 3
22                bytes above and 3 bytes below (default) each test point to find
23                idiosyncrasies in the system. This perturbation  value  can be
24                changed using using this option or turned off by setting
25                perturbation_size to 0. (from man NPtcp)
26"""
27
28from autotest_lib.server import utils
29
30buffer_size = 1048576
31upper_bound = 1048576
32variance = 17
33
34def run(pair):
35    job.run_test('netpipe', pair=pair, buffer=buffer_size,
36                 upper_bound=upper_bound, variance=variance)
37
38# grab the pairs (and failures)
39(pairs, failures) = utils.form_ntuples_from_machines(machines, 2)
40
41# log the failures
42for failure in failures:
43    job.record("FAIL", failure[0], "netpipe", failure[1])
44
45# now run through each pair and run
46job.parallel_simple(run, pairs, log=False)
47