• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1AUTHOR = "kdlucas@google.com (Kelly Lucas)"
2TIME = "MEDIUM"
3NAME = "Netpipe Stress"
4TEST_CATEGORY = "Stress"
5TEST_CLASS = 'Network'
6TEST_TYPE = "Server"
7SYNC_COUNT = 2
8DOC = """
9netpipe_stress is a test which produces bandwidth and latency values for
10incrementing buffer sizes. This stress test will run for approximately 1 hour.
11If you need to adjust the run time, change the value of cycles in the run
12function.
13
14Arguments to run_test:
15bidirectional - indicates whether the test should run simultaneously in both
16                directions
17buffer_size   - Sets the send and receive TCP buffer sizes (from man NPtcp)
18upper_bound   - Specify the upper boundary to the size of message being tested.
19                By default, NetPIPE will stop when the time to transmit a block
20                exceeds one second. (from man NPtcp)
21variance      - NetPIPE chooses the message sizes at regular intervals,
22                increasing them exponentially from the lower boundary to the
23                upper boundary. At each point, it also tests perturbations of 3
24                bytes above and 3 bytes below (default) each test point to find
25                idiosyncrasies in the system. This perturbation  value  can be
26                changed using using this option or turned off by setting
27                perturbation_size to 0. (from man NPtcp)
28cycles        - Number of times to repeat each test. Each cycle takes about 6
29                minutes to complete.
30"""
31
32from autotest_lib.server import utils
33
34# Buffer sizes should not be less than 131072, as this will cause netpipe
35# to hang.
36buffer_sizes = {131072: 'small',
37                262144: 'medium',
38                524288: 'large',
39                1048576: 'huge',
40               }
41cycles = 10
42upper_bound = 1048576
43variance = 17
44
45def run(pair):
46    for x in xrange(cycles):
47        for b in buffer_sizes:
48            tag = 'netpipe' + buffer_sizes[b] + str(x)
49            job.run_test('netpipe', tag=tag, pair=pair, buffer=b,
50                         upper_bound=upper_bound, variance=variance)
51
52
53# grab the pairs (and failures)
54print "Machines = %s" % machines
55(pairs, failures) = utils.form_ntuples_from_machines(machines, 2)
56print "pairs = %s" % pairs
57
58# log the failures
59for failure in failures:
60    job.record("FAIL", failure[0], "netpipe", failure[1])
61
62# now run through each pair and run
63job.parallel_simple(run, pairs, log=False)
64