Added netpipe test.

Signed-off-by: Bryce Boe <bboe@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2136 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/tests/netpipe/control.srv b/server/tests/netpipe/control.srv
new file mode 100644
index 0000000..762dac8
--- /dev/null
+++ b/server/tests/netpipe/control.srv
@@ -0,0 +1,66 @@
+AUTHOR = "bboe@google.com (Bryce Boe)"
+TIME = "SHORT"
+NAME = "Netpipe Multi-machine"
+TEST_CATEGORY = "Stress"
+TEST_CLASS = 'Hardware'
+TEST_TYPE = "Server"
+SYNC_COUNT = 2
+DOC = """
+netpipe_test is a test which produces bandwidth and latency values for
+incrementing buffer sizes.
+
+Arguments to run_test:
+server_ip     - the ip of the server (automatically filled in)
+client_ip     - the ip of the client (automatically filled in)
+role          - specifies either client or server (automatically filled in)
+bidirectional - indicates whether the test should run simultaneously in both
+                directions
+buffer_size   - Sets the send and receive TCP buffer sizes (from man NPtcp)
+upper_bound   - Specify the upper boundary to the size of message being tested.
+                By default, NetPIPE will stop when the time to transmit a block
+                exceeds one second. (from man NPtcp)
+perturbation_size -  NetPIPE chooses the message sizes at regular intervals,
+                increasing them exponentially from the lower boundary to the
+                upper boundary. At each point, it also tests perturbations of 3
+                bytes above and 3 bytes below (default) each test point to find
+                idiosyncrasies in the system. This perturbation  value  can be
+                changed using using this option or turned off by setting
+                perturbation_size to 0. (from man NPtcp)
+"""
+
+from autotest_lib.server import utils
+
+
+def run(pair):
+    print "running on %s and %s\n" % (pair[0], pair[1])
+    server = hosts.create_host(pair[0])
+    client = hosts.create_host(pair[1])
+
+    server_at = autotest.Autotest(server)
+    client_at = autotest.Autotest(client)
+
+    template = ''.join(["job.run_test('netpipe', server_ip='%s', client_ip=",
+                        "'%s', role='%s', bidirectional=True,",
+                        "buffer_size=1048576, upper_bound=1048576,"
+                        "perturbation_size=17)"])
+
+    server_control_file = template % (server.ip, client.ip, 'server')
+    client_control_file = template % (server.ip, client.ip, 'client')
+
+    server_command = subcommand(server_at.run,
+                                [server_control_file, server.hostname])
+    client_command = subcommand(client_at.run,
+                                [client_control_file, client.hostname])
+
+    parallel([server_command, client_command])
+
+
+# grab the pairs (and failures)
+(pairs, failures) = utils.form_ntuples_from_machines(machines, 2)
+
+# log the failures
+for failure in failures:
+    job.record("FAIL", failure[0], "netpipe", failure[1])
+
+# now run through each pair and run
+parallel_simple(run, pairs, log=False)