Home | History | Annotate | Download | only in netpipe
      1 AUTHOR = "kdlucas (a] google.com (Kelly Lucas)"
      2 TIME = "MEDIUM"
      3 NAME = "Netpipe Stress"
      4 TEST_CATEGORY = "Stress"
      5 TEST_CLASS = 'Network'
      6 TEST_TYPE = "Server"
      7 SYNC_COUNT = 2
      8 DOC = """
      9 netpipe_stress is a test which produces bandwidth and latency values for
     10 incrementing buffer sizes. This stress test will run for approximately 1 hour.
     11 If you need to adjust the run time, change the value of cycles in the run
     12 function.
     13 
     14 Arguments to run_test:
     15 bidirectional - indicates whether the test should run simultaneously in both
     16                 directions
     17 buffer_size   - Sets the send and receive TCP buffer sizes (from man NPtcp)
     18 upper_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)
     21 variance      - 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)
     28 cycles        - Number of times to repeat each test. Each cycle takes about 6
     29                 minutes to complete.
     30 """
     31 
     32 from autotest_lib.server import utils
     33 
     34 # Buffer sizes should not be less than 131072, as this will cause netpipe
     35 # to hang. 
     36 buffer_sizes = {131072: 'small',
     37                 262144: 'medium',
     38                 524288: 'large',
     39                 1048576: 'huge',
     40                }
     41 cycles = 10
     42 upper_bound = 1048576
     43 variance = 17
     44 
     45 def 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)
     54 print "Machines = %s" % machines
     55 (pairs, failures) = utils.form_ntuples_from_machines(machines, 2)
     56 print "pairs = %s" % pairs
     57 
     58 # log the failures
     59 for failure in failures:
     60     job.record("FAIL", failure[0], "netpipe", failure[1])
     61 
     62 # now run through each pair and run
     63 job.parallel_simple(run, pairs, log=False)
     64