Esempio n. 1
0
def run_prepare(platform):

    serial = DEVICE[platform]

    print "Pushing compass.conf"
    adb_steps.root_connect_device(serial = serial)()
    adb_steps.push_file(local = "/home/sensors/CTS/x86/android-cts/resource/compass.conf" , remote = "/data/compass.conf", serial = serial)()

    print "Unlocking device"
    adb_steps.wake_up_device(serial = serial)()
    adb_steps.menu_to_unlock(serial = serial)()

    print "Set location to False"
    cts_verifier_steps.set_location(serial = serial)()

    print "Set Adaptive brightness to False"
    cts_verifier_steps.set_display(serial = serial)()

    print "Set Stay Awake to False"
    adb_steps.enable_developer_options(serial = serial)()
    ui_steps.disable_options_from_developer_options(serial = serial,
                                                    enabled = True,
                                                    developer_options =
                                                    ["Stay awake"])()

    print "Set airplane mode to True"
    wifi_steps.set_airplane_mode(state = "ON", serial = serial)()
    ui_steps.press_home(serial = serial)()

    print "Set Auto rotate to False"
    cts_verifier_steps.set_screen_rotation(serial = serial)()
    ui_steps.press_home(serial = serial)()
Esempio n. 2
0
from testlib.scripts.android.adb import adb_steps
from testlib.scripts.telephony import telephony_steps
from testlib.scripts.android.ui import ui_steps
from testlib.base.base_utils import get_args
from testlib.utils.defaults import telephony_defaults
import sys

### initialization ###
globals().update(vars(get_args(sys.argv)))

# This script will test if when changing the PIN when entering a wrong old PIN will pass or fail
try:
    #   Setup part
    adb_steps.wake_up_device(serial=serial)()
    adb_steps.menu_to_unlock(serial=serial)()
    ui_steps.close_all_app_from_recent(serial=serial)()
    ui_steps.press_home(serial=serial)()

    #   Test: PIN - Changing PIN1 - Old PIN1 code is not correct
    telephony_steps.enter_wrong_old_pin(
        serial=serial,
        wrong_old_pin="0000",
        new_pin=telephony_defaults.sim['default_pin'])()

finally:
    #   TearDown part
    ui_steps.close_all_app_from_recent(serial=serial)()
    ui_steps.press_home(serial=serial)()
    sys.exit(0)
if "number" in args:
    number = args["number"]
else:
    print "[BLOCKED] A number to send SMS was not provided!!!"
    sys.exit(0)
if "iterations" in args:
    iterations = args["iterations"]
else:
    iterations = 1
if "sms_test_content" in args:
    sms_test_content = args["sms_test_content"]
else:
    sms_test_content = "bogus"

adb_steps.wake_up_device(serial=serial, blocking=True)()
adb_steps.menu_to_unlock(serial=serial, blocking=True)()
ui_steps.close_all_app_from_recent(serial=serial, blocking=True)()
telephony_steps.set_sim_pin(serial=serial,
                            state="ON",
                            pin=sim_pin,
                            blocking=True)()
telephony_steps.check_pin_is_requested(serial=serial,
                                       pin=sim_pin,
                                       blocking=True)()
telephony_steps.enter_pin(serial=serial, pin=sim_pin, blocking=True)()

for i in range(iterations):
    adb_steps.root_connect_device(serial=serial)()
    adb_steps.command(serial=serial, command="mount -t debugfs none /d")()
    adb_steps.command(serial=serial, command="echo c > /proc/sysrq-trigger")()
Esempio n. 4
0
 def do(self):
     adb_steps.put_device_into_sleep_mode(serial=self.serial)()
     time.sleep(self.timeout)
     adb_steps.wake_up_device(serial=self.serial)()
     ui_steps.unlock_device_swipe(serial=self.serial)()