[autotest]: wifi: Remove TDLS tests
We've decided to not look for TDLS in wifi AVL, and the cast
team confirmed it would be OK to remove support for TDLS.
BUG=chromium:812856, chromium:938698
TEST=None
Change-Id: Ibf17dc7674db3a3b32eef57721927491da21b7cd
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1793360
Commit-Queue: Kirtika Ruchandani <kirtika@chromium.org>
Tested-by: Kirtika Ruchandani <kirtika@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Auto-Submit: Kirtika Ruchandani <kirtika@chromium.org>
diff --git a/client/cros/networking/shill_xmlrpc_server.py b/client/cros/networking/shill_xmlrpc_server.py
index cefe4e3..175dfa3 100755
--- a/client/cros/networking/shill_xmlrpc_server.py
+++ b/client/cros/networking/shill_xmlrpc_server.py
@@ -511,59 +511,6 @@
dbus_object.Disable()
return True
-
- def discover_tdls_link(self, wifi_interface, peer_mac_address):
- """Send a TDLS Discover to |peer_mac_address| on |wifi_interface|.
-
- @param wifi_interface: string name of interface to send the discover on.
- @param peer_mac_address: string mac address of the TDLS peer device.
-
- @return True if it the operation was initiated; False otherwise
-
- """
- device_object = self._wifi_proxy.find_object(
- self.DBUS_DEVICE, {'Name': wifi_interface})
- if device_object is None:
- return False
- device_object.PerformTDLSOperation('Discover', peer_mac_address)
- return True
-
-
- def establish_tdls_link(self, wifi_interface, peer_mac_address):
- """Establish a TDLS link with |peer_mac_address| on |wifi_interface|.
-
- @param wifi_interface: string name of interface to establish a link on.
- @param peer_mac_address: string mac address of the TDLS peer device.
-
- @return True if it the operation was initiated; False otherwise
-
- """
- device_object = self._wifi_proxy.find_object(
- self.DBUS_DEVICE, {'Name': wifi_interface})
- if device_object is None:
- return False
- device_object.PerformTDLSOperation('Setup', peer_mac_address)
- return True
-
-
- @xmlrpc_server.dbus_safe(False)
- def query_tdls_link(self, wifi_interface, peer_mac_address):
- """Query the TDLS link with |peer_mac_address| on |wifi_interface|.
-
- @param wifi_interface: string name of interface to establish a link on.
- @param peer_mac_address: string mac address of the TDLS peer device.
-
- @return string indicating the current TDLS link status.
-
- """
- device_object = self._wifi_proxy.find_object(
- self.DBUS_DEVICE, {'Name': wifi_interface})
- if device_object is None:
- return None
- return self._wifi_proxy.dbus2primitive(
- device_object.PerformTDLSOperation('Status', peer_mac_address))
-
-
@xmlrpc_server.dbus_safe(False)
def add_wake_packet_source(self, wifi_interface, source_ip):
"""Set up the NIC to wake on packets from the given source IP.
diff --git a/server/cros/network/wifi_client.py b/server/cros/network/wifi_client.py
index 3b97d84..d39ffa4 100644
--- a/server/cros/network/wifi_client.py
+++ b/server/cros/network/wifi_client.py
@@ -757,43 +757,6 @@
self.host.run('ip neigh add %s lladdr %s dev %s nud perm' %
(ip_address, mac_address, self.wifi_if))
-
- def discover_tdls_link(self, mac_address):
- """Send a TDLS Discover to |peer_mac_address|.
-
- @param mac_address: string MAC address associated with the TDLS peer.
-
- @return bool True if operation initiated successfully, False otherwise.
-
- """
- logging.info('TDLS discovery with peer %s', mac_address)
- return self._shill_proxy.discover_tdls_link(self.wifi_if, mac_address)
-
-
- def establish_tdls_link(self, mac_address):
- """Establish a TDLS link with |mac_address|.
-
- @param mac_address: string MAC address associated with the TDLS peer.
-
- @return bool True if operation initiated successfully, False otherwise.
-
- """
- logging.info('Establishing TDLS link with peer %s', mac_address)
- return self._shill_proxy.establish_tdls_link(self.wifi_if, mac_address)
-
-
- def query_tdls_link(self, mac_address):
- """Query a TDLS link with |mac_address|.
-
- @param mac_address: string MAC address associated with the TDLS peer.
-
- @return string indicating current TDLS connectivity.
-
- """
- logging.info('Querying TDLS link with peer %s', mac_address)
- return self._shill_proxy.query_tdls_link(self.wifi_if, mac_address)
-
-
def add_wake_packet_source(self, source_ip):
"""Add |source_ip| as a source that can wake us up with packets.
diff --git a/server/site_tests/network_WiFi_TDLSPing/control b/server/site_tests/network_WiFi_TDLSPing/control
deleted file mode 100644
index 7460121..0000000
--- a/server/site_tests/network_WiFi_TDLSPing/control
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-AUTHOR = 'pstew, wiley, quiche'
-NAME = 'network_WiFi_TDLSPing'
-TIME = 'SHORT'
-TEST_TYPE = 'Server'
-ATTRIBUTES = ('suite:wifi_matfunc')
-DEPENDENCIES = 'wificell'
-
-DOC = """
-This test attempts to verify that we can enable TDLS on a client that
-supports it. We do so by analyzing a packet capture to make sure that
-pings between TDLS connected hosts are sent directly without relaying
-through AP.
-
-"""
-
-def run(machine):
- host = hosts.create_host(machine)
- job.run_test('network_WiFi_TDLSPing', host=host, raw_cmdline_args=args)
-
-
-parallel_simple(run, machines)
diff --git a/server/site_tests/network_WiFi_TDLSPing/network_WiFi_TDLSPing.py b/server/site_tests/network_WiFi_TDLSPing/network_WiFi_TDLSPing.py
deleted file mode 100644
index e7d6cbe..0000000
--- a/server/site_tests/network_WiFi_TDLSPing/network_WiFi_TDLSPing.py
+++ /dev/null
@@ -1,172 +0,0 @@
-# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-import time
-
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.common_lib.cros.network import ping_runner
-from autotest_lib.client.common_lib.cros.network import tcpdump_analyzer
-from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
-from autotest_lib.server import site_linux_system
-from autotest_lib.server.cros.network import hostap_config
-from autotest_lib.server.cros.network import wifi_cell_test_base
-
-
-class network_WiFi_TDLSPing(wifi_cell_test_base.WiFiCellTestBase):
- """Tests that the DUT can establish a TDLS link to a connected peer.
-
- This test associates the DUT with an AP, then attaches a peer
- client to the same AP. After enabling a TDLS link from the DUT
- to the attached peer, we should see in the over-the-air packets
- that a ping between these devices does not use the AP as a relay
- any more.
-
- """
-
- version = 1
-
- def ping_and_check_for_tdls(self, frequency, expected):
- """
- Use an over-the-air packet capture to check whether we see
- ICMP packets from the DUT that indicate it is using a TDLS
- link to transmit its requests. Raise an exception if this
- was not what was |expected|.
-
- @param frequency: int frequency on which to perform the packet capture.
- @param expected: bool set to true if we expect the sender to use TDLS.
-
- """
- self.context.capture_host.start_capture(frequency)
-
- # Since we don't wait for the TDLS link to come up, it's possible
- # that we'll have some fairly drastic packet loss as the link is
- # being established. We don't care about that in this test, except
- # that we should see at least a few packets by the end of the ping
- # we can use to test for TDLS. Therefore we ignore the statistical
- # result of the ping.
- ping_config = ping_runner.PingConfig(
- self.context.router.local_peer_ip_address(0),
- ignore_result=True)
- self.context.assert_ping_from_dut(ping_config=ping_config)
-
- results = self.context.capture_host.stop_capture()
- if len(results) != 1:
- raise error.TestError('Expected to generate one packet '
- 'capture but got %d captures instead.' %
- len(results))
- pcap_result = results[0]
-
- logging.info('Analyzing packet capture...')
-
- # Filter for packets from the DUT.
- client_mac_filter = 'wlan.sa==%s' % self.context.client.wifi_mac
-
- # In this test we only care that the outgoing ICMP requests are
- # sent over IBSS, so we filter for ICMP echo requests explicitly.
- icmp_filter = 'icmp.type==0x08'
-
- # This filter requires a little explaining. DS status is the second byte
- # of the frame control field. This field contains the "tods" and
- # "fromds" bits in bit 0 and 1 respsectively. These bits have the
- # following interpretation:
- #
- # ToDS FromDS
- # 0 0 Ad-Hoc (IBSS)
- # 0 1 Traffic from client to the AP
- # 1 0 Traffic from AP to the client
- # 1 1 4-address mode for wireless distribution system
- #
- # TDLS co-opts the ToDS=0, FromDS=0 (IBSS) mode when transferring
- # data directly between peers. Therefore, to detect TDLS, we compare it
- # with 0.
- tdls_filter = 'wlan.fc.ds==0x00'
-
- dut_icmp_display_filter = ' and '.join(
- [client_mac_filter, icmp_filter, tdls_filter])
- frames = tcpdump_analyzer.get_frames(pcap_result.local_pcap_path,
- dut_icmp_display_filter, reject_bad_fcs=False)
- if expected and not frames:
- raise error.TestFail('Packet capture did not contain any IBSS '
- 'frames from the DUT!')
- elif not expected and frames:
- raise error.TestFail('Packet capture contains an IBSS frame '
- 'from the DUT, but we did not expect them!')
-
-
- def run_once(self):
- """Test body."""
- client_caps = self.context.client.capabilities
- if site_linux_system.LinuxSystem.CAPABILITY_TDLS not in client_caps:
- raise error.TestNAError('DUT is incapable of TDLS')
- router_caps = self.context.router.capabilities
- if site_linux_system.LinuxSystem.CAPABILITY_TDLS not in router_caps:
- raise error.TestNAError('Router is incapable of TDLS')
-
- # Configure the AP.
- frequency = 2412
- self.context.configure(hostap_config.HostapConfig(
- frequency=frequency, force_wmm=True))
- router_ssid = self.context.router.get_ssid()
-
- # Connect the DUT to the AP.
- self.context.assert_connect_wifi(
- xmlrpc_datatypes.AssociationParameters(ssid=router_ssid))
-
- # Connect a client instance to the AP so the DUT has a peer to which
- # it can send TDLS traffic.
- self.context.router.add_connected_peer()
-
- # Test for TDLS connectivity to the peer, using the IP address.
- # We expect the first attempt to fail since the client does not
- # have the IP address of the peer in its ARP cache.
- peer_ip = self.context.router.local_peer_ip_address(0)
- link_state = self.context.client.query_tdls_link(peer_ip)
- if link_state is not False:
- raise error.TestError(
- 'First query of TDLS link succeeded: %r' % link_state)
-
- # Wait a reasonable time for the ARP triggered by the first TDLS
- # command to succeed.
- time.sleep(1)
-
- try:
- # One of the next few attempts should succeed, since by now the ARP
- # cache should be populated. However at this time there should be
- # no link.
- utils.poll_for_condition(
- lambda: ( self.context.client.query_tdls_link(peer_ip) ==
- 'Nonexistent'), sleep_interval=1)
- except utils.TimeoutError:
- link_state = self.context.client.query_tdls_link(peer_ip)
- raise error.TestError('DUT does not report a missing TDLS link: %r'
- % link_state)
-
- # Perform TDLS discover and check the status after waiting for response.
- self.context.client.discover_tdls_link(peer_ip)
- try:
- utils.poll_for_condition(
- lambda: (self.context.client.query_tdls_link(peer_ip) ==
- 'Disconnected'), timeout=1)
- except utils.TimeoutError:
- link_state = self.context.client.query_tdls_link(peer_ip)
- logging.error('DUT does not report TDLS link is disconnected: %r',
- link_state)
-
- # Ping from DUT to the associated peer without TDLS.
- self.ping_and_check_for_tdls(frequency, expected=False)
-
- # Ping from DUT to the associated peer with TDLS.
- self.context.client.establish_tdls_link(peer_ip)
- self.ping_and_check_for_tdls(frequency, expected=True)
-
- # Ensure that the DUT reports the TDLS link as being active.
- # Use the MAC address to ensure we can perform TDLS requests
- # against either IP or MAC addresses.
- peer_mac = self.context.router.local_peer_mac_address()
- link_state = self.context.client.query_tdls_link(peer_mac)
- if link_state != 'Connected':
- raise error.TestError(
- 'DUT does not report TDLS link is active: %r' % link_state)