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 33from six.moves import range 34 35# Buffer sizes should not be less than 131072, as this will cause netpipe 36# to hang. 37buffer_sizes = {131072: 'small', 38 262144: 'medium', 39 524288: 'large', 40 1048576: 'huge', 41 } 42cycles = 10 43upper_bound = 1048576 44variance = 17 45 46def run(pair): 47 for x in range(cycles): 48 for b in buffer_sizes: 49 tag = 'netpipe' + buffer_sizes[b] + str(x) 50 job.run_test('netpipe', tag=tag, pair=pair, buffer=b, 51 upper_bound=upper_bound, variance=variance) 52 53 54# grab the pairs (and failures) 55print("Machines = %s" % machines) 56(pairs, failures) = utils.form_ntuples_from_machines(machines, 2) 57print("pairs = %s" % pairs) 58 59# log the failures 60for failure in failures: 61 job.record("FAIL", failure[0], "netpipe", failure[1]) 62 63# now run through each pair and run 64job.parallel_simple(run, pairs, log=False) 65