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

    # Set cuttlefish device serial if needed.
    if environment.is_android_cuttlefish():
        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():
        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()
Exemple #2
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)
Exemple #3
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)
Exemple #4
0
def run():
  """Run Android initialization."""
  init_runner.run()

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

  # 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()
Exemple #5
0
def run():
  """Run Android initialization."""
  init_runner.run()

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

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

  # See if we need to need to wait for battery charge to complete before
  # starting fuzzing.
  android.device.wait_for_battery_charge_if_needed()
Exemple #6
0
def run():
    """Run the initialization for Windows."""
    init_runner.run()
    clean_temp_directories()
    remount_if_needed()
Exemple #7
0
def run():
    """Initialize a device before running a task."""
    init_runner.run()
Exemple #8
0
def run():
    """Run the initialization for Mac."""
    init_runner.run()
    clear_launch_service_data()
Exemple #9
0
def run():
    """Run Linux initialization."""
    init_runner.run()
Exemple #10
0
def run():
    """Run Chrome OS initialization."""
    init_runner.run()
Exemple #11
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)