Example #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)()
# mandatory params
ap_name =  args["net_ap_ssid"]
ap_password = args["net_ap_password"]
widevine_apk = args["widevine_apk"]

# Run Prerequisites
prerequisites.run_prereq(serial = serial,
                         pin = "1234",
                         set_wifi = True,
                         ap_name = "sp_gpt",
                         ap_password = "******")()

ui_steps.press_home(serial = serial)()
ui_steps.disable_options_from_developer_options(serial = serial,
                                                developer_options =
                                                ["Verify apps over USB"],
                                                blocking = True)()

# Install any application
adb_steps.install_apk(serial = serial, apk_path = widevine_apk)()

# Create a new user
ui_steps.create_new_user(serial = serial,
                         set_up_user = True,
                         user_name = "New user")()

# Check if user has access to Owner's application
ui_steps.find_app_from_allapps(serial = serial,
                               presence = False,
                               view_to_find = {"textContains": "ExoPlayer"})()
Example #3
0
You may obtain a copy of the License at
?
http://www.apache.org/licenses/LICENSE-2.0
?
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
?

SPDX-License-Identifier: Apache-2.0
"""
# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############
args = parse_args()

# Setup
ui_steps.press_home(serial=args["serial"])()

# Run
ui_steps.enable_options_from_developer_options(
    serial=args["serial"], developer_options=["Show surface updates"])()
ui_steps.disable_options_from_developer_options(
    serial=args["serial"],
    developer_options=["Show surface updates"],
    enabled=True)()
Example #4
0
SPDX-License-Identifier: Apache-2.0
"""

import os

# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps
from testlib.utils import logger

log = None
if "LOG_PATH" in os.environ:
    testlib_log_path = os.environ["LOG_PATH"]
else:
    import testlib
    testlib_log_path = os.path.dirname(testlib.__file__) + "/logs/"

log = logger.testlib_log(log_path=testlib_log_path, log_name="testlib_default")

# ############# Get parameters ############

args = parse_args()

ui_steps.enable_options_from_developer_options(
    serial=args["serial"], developer_options=["Force 4x MSAA"])()

# TearDown
ui_steps.disable_options_from_developer_options(
    serial=args["serial"], developer_options=["Force 4x MSAA"])()
if "iteratios" in args.keys():
    iterations = args["iterations"]
else:
    iterations = 1
iterations = int(iterations)

# Setup
ui_steps.press_home(serial=serial)()

# Run
if scenario == "Show_surface_updates":
    ui_steps.enable_options_from_developer_options(
        serial=serial, developer_options=["Show_surface_updates"])()
    ui_steps.disable_options_from_developer_options(
        serial=serial,
        developer_options=["Show surface updates"],
        enabled=True)()
elif scenario == "Force_GPU_rendering":
    ui_steps.enable_options_from_developer_options(
        serial=serial,
        developer_options=["Force GPU rendering"],
    )()
    ui_steps.disable_options_from_developer_options(serial=serial,
                                                    developer_options=[
                                                        "Force GPU rendering"
                                                    ],
                                                    enabled=True)()
elif scenario == "Strict_mode_enabled":
    ui_steps.enable_options_from_developer_options(
        serial=serial,
        developer_options=["Strict mode enabled"],
try:
    relay_steps.reboot_main_os(serial=serial,
                               relay_type=relay_type,
                               relay_port=relay_port,
                               power_port=power_port,
                               v_down_port=v_down_port,
                               v_up_port=v_up_port,
                               wait_ui=True)()

    ui_steps.wake_up_device(serial=serial)()
    ui_steps.unlock_device(serial=serial)()

    dessert = adb_utils.get_android_version(serial=serial)

    # Disable OEM unlock in developer options #
    ui_steps.disable_options_from_developer_options(
        serial=serial, developer_options=[dev_oem_option])()

    # Reboot into bootloader
    #adb_steps.reboot(command="fastboot", serial=serial)()
    local_steps.command(
        command="adb -s {0} reboot bootloader".format(serial))()
    local_steps.wait_for_fastboot(serial=serial, timeout=60)()

    # Check unlock ability (should be disabled)
    fastboot_steps.command(serial=serial,
                           command=get_unlock_ability_command,
                           stderr_grep=unlock_disabled_output,
                           timeout=20)()

    # Attempt to unlock bootloader
    relay_steps.change_state(serial=serial,
Example #7
0
You may obtain a copy of the License at
?
http://www.apache.org/licenses/LICENSE-2.0
?
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
?

SPDX-License-Identifier: Apache-2.0
"""
# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############
args = parse_args()

# Setup
ui_steps.press_home(serial=args["serial"])()

# Run
ui_steps.enable_options_from_developer_options(
    serial=args["serial"], developer_options=["Strict mode enabled"])()
ui_steps.disable_options_from_developer_options(
    serial=args["serial"],
    developer_options=["Strict mode enabled"],
    enabled=True)()
http://www.apache.org/licenses/LICENSE-2.0
?
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
?

SPDX-License-Identifier: Apache-2.0
"""
# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############
args = parse_args()

# Setup
ui_steps.press_home(serial=args["serial"])()

# Run
ui_steps.enable_options_from_developer_options(
    serial=args["serial"],
    developer_options=["Automatic system updates"],
)()
ui_steps.disable_options_from_developer_options(
    serial=args["serial"],
    developer_options=["Automatic system updates"],
    enabled=True)()