Home | History | Annotate | Download | only in testbed_DummyTest
      1 # Copyright 2015 The Chromium OS Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 import common
      6 from autotest_lib.server import adb_utils
      7 from autotest_lib.server import constants
      8 from autotest_lib.server import test
      9 
     10 
     11 class testbed_DummyTest(test.test):
     12     """A dummy test to verify testbed can access connected Android devices."""
     13     version = 1
     14 
     15     def run_once(self, testbed=None, test_apk_install=False):
     16         """A dummy test to verify testbed can access connected Android devices.
     17 
     18         Prerequisite: All connected DUTs are in ADB mode.
     19 
     20         @param testbed: host object representing the testbed.
     21         @param test_apk_install: True to test installing sl4a.apk. Default is
     22                 False.
     23         """
     24         self.testbed = testbed
     25         for device in self.testbed.get_all_hosts():
     26             device.run('true')
     27 
     28         if test_apk_install:
     29             for adb_host in testbed.get_adb_devices().values():
     30               adb_utils.install_apk_from_build(
     31                         adb_host, constants.SL4A_APK, constants.SL4A_ARTIFACT,
     32                         package_name=constants.SL4A_PACKAGE)
     33