def scan_wifi(self, serial): wifi_generic_steps.scan_and_check_ap(attrs["ap_name"], option = "refresh", serial = serial)()
# check we are connected to the correct network. wifi_generic_steps.check_connection_info(serial=serial, SSID=ddwrt_ap_name, state='CONNECTED/CONNECTED')() # hide APs SSID ap_steps.setup(mode, security, encryption=encryption, wifi_password=ddwrt_ap_pass, serial=serial, hidden_ssid="1")() # wait for the SSID to hide then seek : DUT auto-disconnects and AP disappears from AP list wifi_generic_steps.scan_and_check_ap(ddwrt_ap_name, should_exist=False, serial=serial)() # add the hidden Wi-Fi network wifi_generic_steps.add_network(ssid=ddwrt_ap_name, security=dut_security, password=ddwrt_ap_pass, serial=serial)() # wait until the device connects to the wifi network wifi_generic_steps.wait_until_connected(serial=serial)() # check we are connected to the correct network wifi_generic_steps.check_connection_info(serial=serial, SSID=ddwrt_ap_name, state='CONNECTED/CONNECTED')()
args[key] = val # mandatory params ap_name = args["ap_name"] ##### test start ##### adb_steps.connect_device(serial=serial, port=adb_server_port)() # turn display on, if turned off ui_steps.wake_up_device(serial=serial)() # ensure the device is unlocked ui_steps.unlock_device(serial=serial, pin=wifi_defaults.wifi['pin'])() # go to home screen ui_steps.press_home(serial=serial)() # make sure there are no saved networks wifi_generic_steps.clear_saved_networks(serial=serial)() # airplane mode on wifi_generic_steps.set_airplane_mode(state="ON", serial=serial)() # wifi ON wifi_generic_steps.set_wifi(state="ON", serial=serial)() # scan and look for ap_name wifi_generic_steps.scan_and_check_ap(serial=serial, ap=ap_name)() ##### test end #####
adb_steps.reboot(serial=serial, ip_enabled=False)() wifi_steps.open_wifi_settings(serial=serial)() # Click "More" ui_steps.click_button(serial=serial, view_to_find={"descriptionContains": "More"}, view_to_check={"textContains": "Add network"})() # Click "Advanced" ui_steps.click_button(serial=serial, view_to_find={"textContains": "Advanced"}, view_to_check={"textContains": "5 GHz only"})() wifi_steps.check_scanned_ssid_frequencies(serial=serial, frequency_band='5') if test_type == 'reconnect_2.4GHz': wifi_generic_steps.scan_and_check_ap(new_ssid + '5', trycount=10, should_exist=True, serial=serial)() # add the 2.4GHz Wi-Fi network wifi_generic_steps.connect_with_password(ap_name=new_ssid, password='******', serial=serial)() wifi_generic_steps.wait_until_connected(serial=serial)() # add the 5GHz Wi-Fi network wifi_generic_steps.connect_with_password(ap_name=new_ssid + '5', password='******', serial=serial)() # wait until the device connects to a wifi network
# go to home screen ui_steps.press_home(serial=serial)() # make sure the test SSID is not saved in the known list wifi_generic_steps.clear_saved_networks(serial=serial)() # try to connect to the AP with wrong password wifi_generic_steps.add_network(ssid=ddwrt_ap_name, security=dut_security, password=ddwrt_ap_pass + "_wrong", identity=radius_identity, EAP_method=EAP_method, phase_2_auth=phase_2_auth, serial=serial)() # verify in the GUI that DUT is not connected wifi_generic_steps.check_wifi_state_disconnected(ap_name=ddwrt_ap_name, security=dut_security, encryption=encryption, wrong_password=True, serial=serial)() # check that the SSID is "remembered" on DUT wifi_generic_steps.scan_and_check_ap(ap=ddwrt_ap_name, serial=serial)() #wifi_generic_steps.wifi_check_SSID_known(ap_name = ddwrt_ap_name, # serial = serial)() # remove the SSID from the known list wifi_generic_steps.clear_saved_networks(serial=serial)() ##### test end #####
ui_steps.wake_up_device(serial = serial)() # ensure the device is unlocked ui_steps.unlock_device(serial = serial, pin=wifi_defaults.wifi['pin'])() # go to home screen ui_steps.press_home(serial = serial)() # make sure there are no saved networks wifi_generic_steps.clear_saved_networks(serial = serial)() # check we are disconnected from AP wifi_generic_steps.check_wifi_state_disconnected(ap_name=ap_name, serial=serial)() # Check we can scan and find the AP wifi_generic_steps.scan_and_check_ap(serial=serial, ap=ap_name, should_exist=True)() # Put the device to sleep ui_steps.put_device_into_sleep_mode(serial=serial)() # Set the wireless interface on the AP down ap_steps.set_ap_wireless(state="down")() # Wait for 10 seconds time.sleep(10) # Wake up the device ui_steps.wake_up_device(serial=serial)() # Unlock the device using swipe ui_steps.unlock_device(serial = serial, pin=wifi_defaults.wifi['pin'])()
# config AP2 virt ON ap_steps.setup_virtual_interface(True, security, encryption=encryption, wifi_password=ap_pass, radius_ip=radius_ip, radius_secret=radius_secret, new_ssid=ap_name_virt_2, interface5ghz=interface5ghz_ap2, virt_if_idx=virt_if_idx, reload_ap=False, serial=serial)() # wait AP2/ap_name_virt_2 is scanned wifi_generic_steps.scan_and_check_ap(ap_name_virt_2, serial=serial, option="refresh")() # check we are connected to the correct network. wifi_generic_steps.check_connection_info(serial=serial, SSID=ap_name_virt_1, state='CONNECTED/CONNECTED')() wifi_generic_steps.ping_gateway(serial=serial, trycount=10, timeout=30)() # config AP1 virt disabled ap_steps.setup_virtual_interface(enable=False, interface5ghz=interface5ghz_ap1, virt_if_idx="1", reload_ap=False, serial=serial)()