Revert "autotest: Three way Perf setup"

This reverts commit 320f70e6f8be50c312100404022b0876f4e7a2ee.

Reason for revert: This change caused some devices to end up in a bad state with ip routes that interfered with other tests.  After this revert, the test should be updated to call the ip teardown code even when the test fails.

Original change's description:
> autotest: Three way Perf setup
>
> Change the WiFi_Perf tests to ustilize the pcap device as a Netperf
> endpoint in throughput testing. This setup utilizes some hard-coded
> values for ethernet interface names and IP addresses for the LAN ports
> on the pcap and router Gale devices. This is necessary because the
> router device is not configured with the daemons to handle the
> assignment automatically. This also means that some IP routes need to be
> set up manually on the devices to allow traffic to move as needed.
>
> Specific arguments for the LAN interface device names and IP addresses
> may be provided at the command line. If not provided, default values
> will be used instead.
>
> The throughput results after making this change are improved as
> expected, but not completely as high as expected. There is still a
> bottleneck on the router CPU in some cases. In other cases, we are
> measuring the total transmitted data from the source device, rather than
> measuring the received data on the target device. This results in some
> test cases that have artificially inflated throughput values. These
> problems could all be resolved by transition from Netperf to Iperf.
>
> BUG=b:172211699
> TEST=test_that $DUT suite:wifi_perf
> test_that --fast $DUT network_WiFi_Perf.vht80 --args='router_lan_ip_addr="192.168.1.49"'
>
> Change-Id: I73bd1e955611547611187a4d0a3fbcf14e0063e0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3064788
> Tested-by: Kevin Lund <kglund@google.com>
> Commit-Queue: Kevin Lund <kglund@google.com>
> Reviewed-by: Arowa Suliman <arowa@chromium.org>

BUG=b:172211699, b:197104627
TEST=Perf test fails as expected, but does not leave DUT in bad state.

Change-Id: I798eacb41f0371c697aa55f9756fdccdaa19253b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3104725
Commit-Queue: Kevin Lund <kglund@google.com>
Tested-by: Kevin Lund <kglund@google.com>
Reviewed-by: Arowa Suliman <arowa@chromium.org>
diff --git a/server/site_tests/network_WiFi_Perf/network_WiFi_Perf.py b/server/site_tests/network_WiFi_Perf/network_WiFi_Perf.py
index c16e801..c75e053 100644
--- a/server/site_tests/network_WiFi_Perf/network_WiFi_Perf.py
+++ b/server/site_tests/network_WiFi_Perf/network_WiFi_Perf.py
@@ -7,7 +7,6 @@
 
 from autotest_lib.client.common_lib import error
 from autotest_lib.client.common_lib import utils
-from autotest_lib.client.common_lib.cros.network import interface
 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
 from autotest_lib.server.cros.network import expected_performance_results
 from autotest_lib.server.cros.network import netperf_runner
@@ -40,11 +39,6 @@
                     netperf_runner.NetperfConfig.TEST_TYPE_UDP_BIDIRECTIONAL),
     ]
 
-    DEFAULT_ROUTER_LAN_IP_ADDRESS = "192.168.1.50"
-    DEFAULT_PCAP_LAN_IP_ADDRESS = "192.168.1.51"
-    DEFAULT_ROUTER_LAN_IFACE_NAME = "eth1"
-    DEFAULT_PCAP_LAN_IFACE_NAME = "eth1"
-
     def parse_additional_arguments(self, commandline_args, additional_params):
         """Hook into super class to take control files parameters.
 
@@ -53,18 +47,6 @@
         """
         self._should_required = 'should' in commandline_args
         self._power_save_off = 'power_save_off' in commandline_args
-
-        get_arg_value_or_default = lambda attr, default: commandline_args[
-                attr] if attr in commandline_args else default
-        self._router_lan_ip_addr = get_arg_value_or_default(
-                'router_lan_ip_addr', self.DEFAULT_ROUTER_LAN_IP_ADDRESS)
-        self._router_lan_iface_name = get_arg_value_or_default(
-                'router_lan_iface_name', self.DEFAULT_ROUTER_LAN_IFACE_NAME)
-        self._pcap_lan_ip_addr = get_arg_value_or_default(
-                'pcap_lan_ip_addr', self.DEFAULT_PCAP_LAN_IP_ADDRESS)
-        self._pcap_lan_iface_name = get_arg_value_or_default(
-                'pcap_lan_iface_name', self.DEFAULT_PCAP_LAN_IFACE_NAME)
-
         if 'governor' in commandline_args:
             self._governor = commandline_args['governor']
             # validate governor string. Not all machines will support all of
@@ -243,35 +225,8 @@
                     ssid=self.context.router.get_ssid(),
                     security_config=ap_config.security_config)
             self.context.assert_connect_wifi(assoc_params)
-
-            # The router device is not configured to automatically assign ethernet
-            # IP addresses or set up ethernet traffic routes, so we have to set
-            # these up manually.
-            self.context.router.host.run('sudo ip link set %s up' %
-                                         self._router_lan_iface_name)
-            self.context.pcap_host.host.run('sudo ip link set %s up' %
-                                            self._pcap_lan_iface_name)
-            self.context.router.host.run(
-                    'sudo ip addr replace %s/24 dev %s' %
-                    (self._router_lan_ip_addr, self._router_lan_iface_name))
-            self.context.pcap_host.host.run(
-                    'sudo ip addr replace %s/24 dev %s' %
-                    (self._pcap_lan_ip_addr, self._pcap_lan_iface_name))
-            self.context.client.host.run(
-                    'sudo ip route replace table 255 %s via %s dev %s' %
-                    (self._pcap_lan_ip_addr, self.context.router.wifi_ip,
-                     self.context.client.wifi_if))
-            self.context.pcap_host.host.run(
-                    'sudo ip route replace table 255 %s via %s dev %s' %
-                    (self.context.client.wifi_ip, self._router_lan_ip_addr,
-                     self._router_lan_iface_name))
-
-            pcap_lan_iface = interface.Interface(self._pcap_lan_iface_name,
-                                                 self.context.pcap_host.host)
-            session = netperf_session.NetperfSession(
-                    self.context.client,
-                    self.context.pcap_host,
-                    server_interface=pcap_lan_iface)
+            session = netperf_session.NetperfSession(self.context.client,
+                                                     self.context.router)
 
             # Flag a test error if we disconnect for any reason.
             with self.context.client.assert_no_disconnects():
@@ -282,26 +237,6 @@
                             self.do_run(ap_config, session,
                                         not (self._power_save_off), governor))
 
-            # After each test, clear out all the changes that were made to the
-            # device IP settings, routes, interfaces, etc.
-            self.context.client.host.run(
-                    'sudo ip route del table 255 %s via %s dev %s' %
-                    (self._pcap_lan_ip_addr, self.context.router.wifi_ip,
-                     self.context.client.wifi_if))
-            self.context.pcap_host.host.run(
-                    'sudo ip route del table 255 %s via %s dev %s' %
-                    (self.context.client.wifi_ip, self._router_lan_ip_addr,
-                     self._router_lan_iface_name))
-            self.context.router.host.run(
-                    'sudo ip addr del %s/24 dev %s' %
-                    (self._router_lan_ip_addr, self._router_lan_iface_name))
-            self.context.pcap_host.host.run(
-                    'sudo ip addr del %s/24 dev %s' %
-                    (self._pcap_lan_ip_addr, self._pcap_lan_iface_name))
-            self.context.router.host.run('sudo ip link set %s down' %
-                                         self._router_lan_iface_name)
-            self.context.pcap_host.host.run('sudo ip link set %s down' %
-                                            self._pcap_lan_iface_name)
             # Clean up router and client state for the next run.
             self.context.client.shill.disconnect(self.context.router.get_ssid())
             self.context.router.deconfig()