예제 #1
0
def run():
    """Run Android initialization."""
    init_runner.run()

    # Set cuttlefish device serial if needed.
    if environment.is_android_cuttlefish():
        android.adb.set_cuttlefish_device_serial()

    # Check if we need to reflash device to latest build.
    android.flash.flash_to_latest_build_if_needed()

    # Reconnect to cuttlefish device if connection is ever lost.
    if environment.is_android_cuttlefish():
        android.adb.connect_to_cuttlefish_device()

    # Reboot to bring device in a good state if not done recently.
    if android.adb.time_since_last_reboot() > TIME_SINCE_REBOOT_MIN_THRESHOLD:
        android.device.reboot()

    # Make sure that device is in a good condition before we move forward.
    android.adb.wait_until_fully_booted()

    # Wait until battery charges to a minimum level and temperature threshold.
    android.battery.wait_until_good_state()

    # Initialize environment settings.
    android.device.initialize_environment()
예제 #2
0
 def test_windows(self):
     """Test windows."""
     self.mock.platform.return_value = 'WINDOWS'
     init_runner.run()
     self.mock.run_process.assert_called_with(
         'powershell.exe ./configs/test/bot/init/windows.ps1',
         ignore_children=True,
         need_shell=True,
         testcase_run=False,
         timeout=1800)
예제 #3
0
 def test_posix(self):
     """Test posix."""
     self.mock.platform.return_value = 'LINUX'
     init_runner.run()
     self.mock.run_process.assert_called_with(
         './configs/test/bot/init/linux.bash',
         ignore_children=True,
         need_shell=True,
         testcase_run=False,
         timeout=1800)
예제 #4
0
 def test_nonexistent_platform(self):
     """Test posix."""
     self.mock.platform.return_value = 'FAKE'
     init_runner.run()
     self.assertEqual(0, self.mock.run_process.call_count)
예제 #5
0
def run():
  """Run Linux initialization."""
  init_runner.run()
예제 #6
0
def run():
    """Run Chrome OS initialization."""
    init_runner.run()
예제 #7
0
def run():
    """Initialize a device before running a task."""
    init_runner.run()
예제 #8
0
def run():
    """Run the initialization for Mac."""
    init_runner.run()
    clear_launch_service_data()
예제 #9
0
def run():
    """Run the initialization for Windows."""
    init_runner.run()
    clean_temp_directories()
    remount_if_needed()