Adding iperf fixes to netperf2 and netpipe.

Change-Id: Iee39c67ed1955993a617f8bb15dafc8de8b881bf

BUG=None.
TEST=running locally.
diff --git a/server/tests/netperf2/netperf2.py b/server/tests/netperf2/netperf2.py
index 6317c6c..4d0b5fb 100644
--- a/server/tests/netperf2/netperf2.py
+++ b/server/tests/netperf2/netperf2.py
@@ -25,6 +25,13 @@
             if not status.exit_status:
                 m.disable_ipfilters()
 
+        # Starting a test indents the status.log entries. This test starts 2
+        # additional tests causing their log entries to be indented twice. This
+        # double indent confuses the parser, so reset the indent level on the
+        # job, let the forked tests record their entries, then restore the
+        # previous indent level.
+        self.job._indenter.decrement()
+
         server_at = autotest.Autotest(server)
         client_at = autotest.Autotest(client)
 
@@ -34,19 +41,28 @@
                             "iterations=%d)"])
 
         server_control_file = template % (server.ip, client.ip, 'server', test,
-                                          time, stream_list, test, cycles)
+                                          time, stream_list, 'server', cycles)
         client_control_file = template % (server.ip, client.ip, 'client', test,
-                                          time, stream_list, test, cycles)
+                                          time, stream_list, 'client', cycles)
 
         server_command = subcommand.subcommand(server_at.run,
                                     [server_control_file, server.hostname],
-                                    subdir='server')
+                                    subdir='../')
         client_command = subcommand.subcommand(client_at.run,
                                     [client_control_file, client.hostname],
-                                    subdir='client')
+                                    subdir='../')
 
         subcommand.parallel([server_command, client_command])
 
+        # The parser needs a keyval file to know what host ran the test.
+        utils.write_keyval('../' + server.hostname,
+                           {"hostname": server.hostname})
+        utils.write_keyval('../' + client.hostname,
+                           {"hostname": client.hostname})
+
+        # Restore indent level of main job.
+        self.job._indenter.increment()
+
         for m in [client, server]:
             status = m.run('/sbin/iptables -L')
             if not status.exit_status: