Home | History | Annotate | Download | only in camera_HAL3
      1 # Copyright 2017 The Chromium 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 """A test which verifies the camera function with HAL3 interface."""
      6 
      7 import os, logging
      8 from autotest_lib.client.bin import test, utils
      9 
     10 class camera_HAL3(test.test):
     11     """
     12     This test is a wrapper of the test binary arc_camera3_test.
     13     """
     14 
     15     version = 1
     16     binary = 'arc_camera3_test'
     17     dep = 'camera_hal3'
     18     timeout = 60
     19 
     20     def setup(self):
     21         self.dep_dir = os.path.join(self.autodir, 'deps', self.dep)
     22         self.job.setup_dep([self.dep])
     23         logging.debug('mydep is at %s' % self.dep_dir)
     24 
     25     def run_once(self):
     26         self.job.install_pkg(self.dep, 'dep', self.dep_dir)
     27 
     28         if utils.system_output('ldconfig -p').find('camera_hal.so') == -1:
     29             logging.debug('Skip test because camera_hal.so is not installed.')
     30             return
     31 
     32         binary_path = os.path.join(self.dep_dir, 'bin', self.binary)
     33         utils.system(binary_path, timeout=self.timeout)
     34