def __init__(self, test_configs, run_list): self.test_run_info = {} self.test_run_info[keys.ConfigKeys.IKEY_DATA_FILE_PATH] = getattr( test_configs, keys.ConfigKeys.IKEY_DATA_FILE_PATH, "./") self.test_configs = test_configs self.testbed_configs = self.test_configs[keys.ConfigKeys.KEY_TESTBED] self.testbed_name = self.testbed_configs[ keys.ConfigKeys.KEY_TESTBED_NAME] start_time = logger.getLogFileTimestamp() self.id = "{}@{}".format(self.testbed_name, start_time) # log_path should be set before parsing configs. l_path = os.path.join(self.test_configs[keys.ConfigKeys.KEY_LOG_PATH], self.testbed_name, start_time) self.log_path = os.path.abspath(l_path) self.log_severity = self.test_configs.get( keys.ConfigKeys.KEY_LOG_SEVERITY, "INFO").upper() logger.setupTestLogger(self.log_path, self.testbed_name, filename="test_run_details.txt", log_severity=self.log_severity) self.controller_registry = {} self.controller_destructors = {} self.run_list = run_list self.results = records.TestResult() self.running = False self.test_cls_instances = []
def __init__(self, configs): self.tests = [] if not self.TAG: self.TAG = self.__class__.__name__ # Set all the controller objects and params. for name, value in configs.items(): setattr(self, name, value) self.results = records.TestResult() self.currentTestName = None # Setup test filters self.include_filter = self.getUserParam([ keys.ConfigKeys.KEY_TEST_SUITE, keys.ConfigKeys.KEY_INCLUDE_FILTER ], default_value=[]) self.exclude_filter = self.getUserParam([ keys.ConfigKeys.KEY_TEST_SUITE, keys.ConfigKeys.KEY_EXCLUDE_FILTER ], default_value=[]) self.include_filter = self.ExpandFilterBitness( list_utils.ExpandItemDelimiters( list_utils.ItemsToStr(self.include_filter), ',')) self.exclude_filter = self.ExpandFilterBitness( list_utils.ExpandItemDelimiters( list_utils.ItemsToStr(self.exclude_filter), ',')) # TODO: get abi information differently for multi-device support. # Set other optional parameters self.abi_name = self.getUserParam(keys.ConfigKeys.IKEY_ABI_NAME, default_value=None) self.abi_bitness = self.getUserParam(keys.ConfigKeys.IKEY_ABI_BITNESS, default_value=None) self.skip_on_32bit_abi = self.getUserParam( keys.ConfigKeys.IKEY_SKIP_ON_32BIT_ABI, default_value=False) self.skip_on_64bit_abi = self.getUserParam( keys.ConfigKeys.IKEY_SKIP_ON_64BIT_ABI, default_value=False) self.run_32bit_on_64bit_abi = self.getUserParam( keys.ConfigKeys.IKEY_RUN_32BIT_ON_64BIT_ABI, default_value=False) self.web = web_utils.WebFeature(self.user_params) self.coverage = coverage_utils.CoverageFeature(self.user_params, web=self.web) self.profiling = profiling_utils.ProfilingFeature(self.user_params, web=self.web) self.systrace = systrace_utils.SystraceFeature(self.user_params, web=self.web) self.log_uploading = log_uploading_utils.LogUploadingFeature( self.user_params, web=self.web) self._skip_all_testcases = False
def __init__(self, configs): self.tests = [] if not self.TAG: self.TAG = self.__class__.__name__ # Set all the controller objects and params. for name, value in configs.items(): setattr(self, name, value) self.results = records.TestResult() self.currentTestName = None # Setup test filters (optional) if keys.ConfigKeys.KEY_TEST_SUITE in self.user_params: test_suite = self.user_params[keys.ConfigKeys.KEY_TEST_SUITE] filters = [keys.ConfigKeys.KEY_INCLUDE_FILTER, keys.ConfigKeys.KEY_EXCLUDE_FILTER] for filter in filters: if filter in test_suite: setattr(self, filter, test_suite[filter]) # TODO: get abi information differently for multi-device support. # Set other optional parameters opt_param_names = [keys.ConfigKeys.IKEY_ABI_NAME, keys.ConfigKeys.IKEY_ABI_BITNESS, keys.ConfigKeys.IKEY_SKIP_ON_32BIT_ABI, keys.ConfigKeys.IKEY_SKIP_ON_64BIT_ABI, keys.ConfigKeys.IKEY_RUN_32BIT_ON_64BIT_ABI] self.getUserParams(opt_param_names=opt_param_names) self.web = web_utils.WebFeature(self.user_params) self.coverage = coverage_utils.CoverageFeature( self.user_params, web=self.web) self.profiling = profiling_utils.ProfilingFeature( self.user_params, web=self.web) self.systrace = systrace_utils.SystraceFeature( self.user_params, web=self.web) self.log_uploading = log_uploading_utils.LogUploadingFeature( self.user_params, web=self.web) self._skip_all_testcases = False
def __init__(self, configs): self.tests = [] # Set all the controller objects and params. for name, value in configs.items(): setattr(self, name, value) self.results = records.TestResult() self.log = logger.LoggerProxy() self._current_record = None # Setup test filters self.include_filter = self.getUserParam([ keys.ConfigKeys.KEY_TEST_SUITE, keys.ConfigKeys.KEY_INCLUDE_FILTER ], default_value=[]) self.exclude_filter = self.getUserParam([ keys.ConfigKeys.KEY_TEST_SUITE, keys.ConfigKeys.KEY_EXCLUDE_FILTER ], default_value=[]) # TODO(yuexima): remove include_filter and exclude_filter from class attributes # after confirming all modules no longer have reference to them self.include_filter = list_utils.ExpandItemDelimiters( list_utils.ItemsToStr(self.include_filter), ',') self.exclude_filter = list_utils.ExpandItemDelimiters( list_utils.ItemsToStr(self.exclude_filter), ',') exclude_over_include = self.getUserParam( keys.ConfigKeys.KEY_EXCLUDE_OVER_INCLUDE, default_value=None) self.test_module_name = self.getUserParam( keys.ConfigKeys.KEY_TESTBED_NAME, log_warning_and_continue_if_not_found=True, default_value=self.__class__.__name__) self.test_filter = filter_utils.Filter( self.include_filter, self.exclude_filter, enable_regex=True, exclude_over_include=exclude_over_include, enable_negative_pattern=True, enable_module_name_prefix_matching=True, module_name=self.test_module_name, expand_bitness=True) logging.info('Test filter: %s' % self.test_filter) # TODO: get abi information differently for multi-device support. # Set other optional parameters self.abi_name = self.getUserParam(keys.ConfigKeys.IKEY_ABI_NAME, default_value=None) self.abi_bitness = self.getUserParam(keys.ConfigKeys.IKEY_ABI_BITNESS, default_value=None) self.skip_on_32bit_abi = self.getUserParam( keys.ConfigKeys.IKEY_SKIP_ON_32BIT_ABI, default_value=False) self.skip_on_64bit_abi = self.getUserParam( keys.ConfigKeys.IKEY_SKIP_ON_64BIT_ABI, default_value=False) self.run_32bit_on_64bit_abi = self.getUserParam( keys.ConfigKeys.IKEY_RUN_32BIT_ON_64BIT_ABI, default_value=False) self.web = web_utils.WebFeature(self.user_params) self.coverage = coverage_utils.CoverageFeature(self.user_params, web=self.web) self.sancov = sancov_utils.SancovFeature(self.user_params, web=self.web) self.profiling = profiling_utils.ProfilingFeature(self.user_params, web=self.web) self.systrace = systrace_utils.SystraceFeature(self.user_params, web=self.web) self.log_uploading = log_uploading_utils.LogUploadingFeature( self.user_params, web=self.web) self.collect_tests_only = self.getUserParam( keys.ConfigKeys.IKEY_COLLECT_TESTS_ONLY, default_value=False) self.run_as_vts_self_test = self.getUserParam( keys.ConfigKeys.RUN_AS_VTS_SELFTEST, default_value=False) self.run_as_compliance_test = self.getUserParam( keys.ConfigKeys.RUN_AS_COMPLIANCE_TEST, default_value=False) self._bug_report_on_failure = self.getUserParam( keys.ConfigKeys.IKEY_BUG_REPORT_ON_FAILURE, default_value=False) self._logcat_on_failure = self.getUserParam( keys.ConfigKeys.IKEY_LOGCAT_ON_FAILURE, default_value=True)