dev_name=PAIRING_DEV_NAME, scan_max_attempts=5, version_dut=DUT_VERSION, version_dev=DEV_VERSION, blocking=True) # check dut internet connection bluetooth_steps.CheckInternetConnection(serial=serial, blocking=True)() # ############### Test #################### # ######################################### bluetooth_steps.LogInfo("##### ACTUAL TEST #####")() # activate bt tethering on DUT bluetooth_steps.BtSetTethering(serial=serial, state="ON", tethering_settings_opened=False, version=DUT_VERSION)() # activate internet service on DEV bluetooth_steps.BtSetService(serial=serial_dev, paired_device_name=DUT_NAME, state=True, service="Internet access", version=DEV_VERSION)() bluetooth_steps.WaitForState(serial=serial_dev, device_name=DUT_NAME, connected=True, version=DEV_VERSION)() bluetooth_steps.CheckInternetAccessServiceState(serial=serial_dev, state="ON", max_checks=15, version=DEV_VERSION)()
pin="1234", set_screen_lock=True, require_pin_to_start_device=True, set_wifi=True, ap_name=ddwrt_ap_name, ap_password=ddwrt_ap_pass)() prerequisites.run_prereq(serial=serial2, pin="1234", set_screen_lock=True, require_pin_to_start_device=True, set_wifi=True, ap_name=ddwrt_ap_name, ap_password=ddwrt_ap_pass)() #Enable Bluetooth tethering bluetooth_steps.BtSetTethering(serial=serial, state="ON", timeout=30000)() bluetooth_steps.BtSetTethering(serial=serial2, state="ON", timeout=30000)() bluetooth_steps.OpenBluetoothSettings(serial=serial, use_intent=True)() bluetooth_steps.BtChangeDeviceName(serial=serial, name=serial)() bluetooth_steps.OpenBluetoothSettings(serial=serial2, use_intent=True)() bluetooth_steps.BtChangeDeviceName(serial=serial2, name=serial2)() bluetooth_steps.WaitBtScanning(serial=serial)() bluetooth_steps.InitiatePairRequest(serial=serial, dev_to_pair_name=serial2, scan_max_attempts=5)()
nap_name = DUT_NAME pan_name = PAIRING_DEV_NAME else: nap_name = PAIRING_DEV_NAME pan_name = DUT_NAME # stop settings on both devices bluetooth_steps.StopPackage(serial=serial, blocking=True)() bluetooth_steps.PressHome(serial=serial, blocking=True)() bluetooth_steps.StopPackage(serial=serial_dev, blocking=True)() bluetooth_steps.PressHome(serial=serial_dev, blocking=True)() # NAP: activate BT tethering bluetooth_steps.BtSetTethering(serial=nap_serial, state="ON", tethering_settings_opened=False, version=nap_version, blocking=True)() # DUT: turn on BT bluetooth_steps.OpenBluetoothSettings(serial=serial, use_intent=True, version=DUT_VERSION, blocking=True)() bluetooth_steps.ClickBluetoothSwitch(serial=serial, state="ON", version=DUT_VERSION, blocking=True)() # DEV: turn on BT bluetooth_steps.OpenBluetoothSettings(serial=serial_dev,
globals().update(vars(get_args(sys.argv))) # Initialize version DUT_VERSION = bluetooth_steps.GetAndroidVersion(serial=serial, blocking=True)() try: # ########### Preconditions ############### # ######################################### bluetooth_steps.LogInfo("######## SETUP ########")() bluetooth_steps.StopPackage(serial=serial, blocking=True)() bluetooth_steps.PressHome(serial=serial, blocking=True)() bluetooth_steps.BtSetTethering(serial=serial, state="OFF", version=DUT_VERSION, blocking=True)() bluetooth_steps.PressHome(serial=serial, blocking=True)() bluetooth_steps.OpenBluetoothSettings(serial=serial, use_intent=True, version=DUT_VERSION, blocking=True)() bluetooth_steps.ClickBluetoothSwitch(serial=serial, state="ON", version=DUT_VERSION, blocking=True)() bluetooth_steps.PressHome(serial=serial, blocking=True)() # ############ Actual Test ################ # ######################################### bluetooth_steps.LogInfo("##### ACTUAL TEST #####")() # ##### Tethering should not turn off when leaving Tethering menu ##### bluetooth_steps.BtSetTethering(serial=serial, state="ON", check_if_already=True, version=DUT_VERSION)() bluetooth_steps.PressHome(serial=serial)() bluetooth_steps.BtCheckTetheringState(serial=serial, state="ON", tethering_settings_opened=False, version=DUT_VERSION)()