コード例 #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)()
コード例 #2
0
ファイル: repair_steps.py プロジェクト: zenghui0-0/tempfile
 def do(self):
     adb_steps.delete_folder_content(serial=self.serial,
                                     folder="/cache/repair")()
     adb_steps.push_file(serial=self.serial,
                         blocking=True,
                         local=self.image_path,
                         remote="/cache/repair/",
                         timeout=600)()
コード例 #3
0
    fastboot_utils.unpack_the_zip(file_name=flash_files,
                                  temp_path=r"./temp/new_image")

    fastboot_utils.unpack_the_zip(file_name="./temp/tipc/" + tipc_zip_name,
                                  temp_path=r"./temp/tipc")
    os.system(
        "sudo python ./temp/files/flash_image.py --bin ./temp/tipc/ifwi_gr_mrb_b1.bin --zip ./temp/tipc/"
        + tipc_zip_name)
    time.sleep(60)
    local_steps.wait_for_adb(timeout=300, serial=serial)()

    os.system("sudo chmod 777 ./temp/tipc/" + tipc_file_name)
    adb_steps.root_connect_device(serial=serial)()
    time.sleep(5)
    adb_steps.push_file(local="./temp/tipc/" + tipc_file_name,
                        remote="/data/",
                        serial=serial)()

    for key, value in test_case_list.items():
        if key == "tipc_test_blocked_read": continue
        test_result_list[
            key] = fastboot_utils.tipc_negativetipc_execution_result(
                case_type="tipc_test",
                command="adb shell ./data/tipc-test32 " + value)

    print "The results of the tipc test case execution are as follows:"
    for key, value in test_result_list.items():
        if value == False: fail_case_list[key] = value
        print "Test case name: " + key + "and test case result: " + str(value)

    if fail_case_list:
コード例 #4
0
bluetooth_steps_old.bt_make_discoverable(serial=serial,
                                         port=adb_server_port,
                                         name=DUT_NAME)()

bluetooth_steps_old.bt_change_device_name(serial=PAIRING_DEV,
                                          port=adb_server_port,
                                          name=PAIRING_DEV_NAME)()
bluetooth_steps_old.bt_make_discoverable(serial=PAIRING_DEV,
                                         port=adb_server_port,
                                         name=PAIRING_DEV_NAME)()

#push photo
download_command = 'wget ' + PHOTO_URL
local_steps.command(command=download_command)()
adb_steps.push_file(serial=serial,
                    local=PHOTO_NAME,
                    remote=PHOTO_PATH + PHOTO_NAME)()
adb_steps.command(serial=serial,
                  command=REFRESH_MEDIA_COMMAND + PHOTO_PATH + PHOTO_NAME)()

############### Test ####################
#########################################

ui_steps.open_picture_from_gallery(serial=serial, port=adb_server_port)()

while not ui_device(serial=serial)(descriptionContains='Share with').exists:
    ui_steps.click_button(
        serial=serial,
        port=adb_server_port,
        view_to_find={'className': 'android.widget.FrameLayout'})()
コード例 #5
0
    serial=PAIRING_DEVICE,
    local_port=adb_server_port,
)()

bluetooth_steps_old.bt_change_device_name(serial=serial,
                                          port=adb_server_port,
                                          name=DUT_NAME)()
bluetooth_steps_old.bt_change_device_name(serial=PAIRING_DEVICE,
                                          port=adb_server_port,
                                          name=PAIRING_DEV_NAME)()

#push photo
download_command = 'wget ' + PHOTO_URL
local_steps.command(command=download_command)()
adb_steps.push_file(serial=PAIRING_DEVICE,
                    port=adb_server_port,
                    local=PHOTO_NAME,
                    remote=PHOTO_PATH + PHOTO_NAME)()
adb_steps.command(serial=PAIRING_DEVICE,
                  port=adb_server_port,
                  command=REFRESH_MEDIA_COMMAND + PHOTO_PATH + PHOTO_NAME)()

############### Test ####################
#########################################

ui_steps.open_picture_from_gallery(serial=PAIRING_DEVICE,
                                   port=adb_server_port)()

while not ui_device(serial=PAIRING_DEVICE, port=adb_server_port)(
        descriptionContains='Share with').exists:
    ui_steps.click_button(
        serial=PAIRING_DEVICE,
コード例 #6
0
    # get the server IP address
    wifi_generic_steps.get_dut_ip_address(serial=device, timeout=10)()

    # Generate URL along with IP address to download the file
    (URL, IP) = wifi_generic_steps.create_download_url_multiserver_ftp(
        file_name + device + '.bin',
        file_size,
        local_path=pwd,
        protocol='ftp',
        port=ftp_port,
        serial=device)()

    # Push the generated payload file to ftp server for the DUT to download
    adb_steps.push_file(serial=serial,
                        local=pwd + "/" + file_name + device + '.bin',
                        remote="/storage/emulated/0/",
                        timeout=6000)()

    # Initialize the DUT for upload
    #Install FTP client APK from the defined path
    #adb_steps.install_apk(serial = serial, apk_path = ftp_client_apk, install_time= 60)()

    # 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)()
コード例 #7
0
                                  temp_path=r"./temp/new_image")

    fastboot_utils.unpack_the_zip(file_name="./temp/negative/" +
                                  negative_zip_name,
                                  temp_path=r"./temp/negative")
    os.system(
        "sudo python ./temp/files/flash_image.py --bin ./temp/negative/ifwi_gr_mrb_b1.bin --zip ./temp/negative/"
        + negative_zip_name)
    time.sleep(60)
    local_steps.wait_for_adb(timeout=300, serial=serial)()

    os.system("sudo chmod 777 ./temp/negative/" + negative_file_name)
    adb_steps.root_connect_device(serial=serial)()
    time.sleep(5)
    adb_steps.push_file(local="./temp/negative/" + negative_file_name,
                        remote="/data/",
                        serial=serial)()

    return_result = os.popen(
        "adb shell ./data/negative_ca.trusty32").readlines()
    for line in return_result:
        if "-" not in line: continue
        case_name = line.split("-")[0].strip()
        if case_name == "neg_api_send_msg" or case_name == "neg_scene_ta_calls_after_ta_close_chan":
            continue
        test_result_list[case_name] = fastboot_utils.tipc_negativetipc_execution_result(case_type = "negative_tipc_test", command = "adb shell ./data/negative_ca.trusty32 " \
                  + case_name, case_name = case_name)

    print "The results of the negative tipc test case execution are as follows:"
    for key, value in test_result_list.items():
        if value == False: fail_case_list[key] = value
コード例 #8
0
# Run Prerequisites
prerequisites.run_prereq(serial=serial,
                         pin="1234",
                         set_screen_lock=True,
                         blocking=True)()

# CREATE 1GB file
file_steps.create_random_file(file_name="testfile",
                              size=1024**3,
                              blocking=True)()

# SEND 1GB file to DUT
adb_steps.push_file(serial=serial,
                    local="testfile",
                    remote="/data/local/tmp",
                    timeout=5000,
                    blocking=True)()

# Reboot DUT
adb_steps.reboot(serial=serial, pin="1234", ip_enabled=False)()

# Check for sent file
adb_steps.command(serial=serial,
                  command="ls -l /data/local/tmp/testfile",
                  stdout_grep=str(1024**3))()

# Remake initial state
adb_steps.command(serial=serial,
                  command="rm /data/local/tmp/testfile",
                  timeout=50000)()