1 # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 from autotest_lib.server import site_linux_system 6 from autotest_lib.server.cros.network import hostap_config 7 from autotest_lib.server.cros.network import wifi_cell_test_base 8 9 10 class network_WiFi_MaskedBSSID(wifi_cell_test_base.WiFiCellTestBase): 11 """Test behavior around masked BSSIDs.""" 12 version = 1 13 14 15 def run_once(self): 16 """Test body. 17 18 Set up two APs on the same channel/bssid but with different SSIDs. 19 Check that we can see both APs in scan results. 20 21 """ 22 self.context.router.require_capabilities( 23 [site_linux_system.LinuxSystem.CAPABILITY_MULTI_AP_SAME_BAND]) 24 frequency = 2412 25 configurations = [hostap_config.HostapConfig( 26 frequency=frequency, 27 mode=hostap_config.HostapConfig.MODE_11B, 28 bssid='00:11:22:33:44:55', 29 ssid=('CrOS_Masked%d' % i), 30 min_streams=1) for i in range(2)] 31 # Create an AP, manually specifying both the SSID and BSSID. 32 self.context.configure(configurations[0]) 33 # Create a second AP that responds to probe requests with the same BSSID 34 # but an different SSID. These APs together are meant to emulate 35 # situations that occur with some types of APs which broadcast or 36 # respond with more than one (non-empty) SSID. 37 self.context.configure(configurations[1], multi_interface=True) 38 # We cannot connect to this AP, since there are two separate APs that 39 # respond to the same BSSID, but we can test to make sure both SSIDs 40 # appears in the scan. 41 self.context.client.scan([frequency], 42 [config.ssid for config in configurations]) 43 self.context.router.deconfig() 44