Example #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()
Example #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)
Example #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)
Example #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)
Example #5
0
def run():
  """Run Linux initialization."""
  init_runner.run()
Example #6
0
def run():
    """Run Chrome OS initialization."""
    init_runner.run()
Example #7
0
def run():
    """Initialize a device before running a task."""
    init_runner.run()
Example #8
0
def run():
    """Run the initialization for Mac."""
    init_runner.run()
    clear_launch_service_data()
Example #9
0
def run():
    """Run the initialization for Windows."""
    init_runner.run()
    clean_temp_directories()
    remount_if_needed()