Home | History | Annotate | Download | only in android_EasySetup
      1 # Copyright 2016 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 test
      7 from autotest_lib.site_utils import acts_lib
      8 
      9 
     10 class android_EasySetup(test.test):
     11     """A test that does nothing except setup a phone.
     12 
     13     This test will only setup a phone how a user wants and will perform no
     14     tests.
     15     """
     16     version = 1
     17 
     18     def run_once(self,
     19                 testbed=None,
     20                 install_sl4a=True,
     21                 additional_apks=[]):
     22         """When run the testbed will be setup.
     23 
     24         @param testbed: The testbed to setup.
     25         @param install_sl4a: When true sl4a will be installed.
     26         @param additional_apks: An array of apk info dictionaries.
     27                                 apk = Name of the apk (eg. sl4a.apk)
     28                                 package = Name of the package (eg. test.tools)
     29                                 artifact = Name of the artifact, if not given
     30                                            package is used.
     31         """
     32         testbed_env = acts_lib.AndroidTestingEnviroment(testbed)
     33 
     34         if install_sl4a:
     35             testbed_env.install_sl4a_apk()
     36 
     37         for apk in additional_apks:
     38             testbed_env.install_apk(apk)
     39