def CtsGtsQualTests(self, **kwargs): """Return a list of HWTestConfigs for CTS, GTS tests.""" cts_config = dict( pool=constants.HWTEST_CTS_POOL, timeout=config_lib.HWTestConfig.CTS_QUAL_HW_TEST_TIMEOUT, priority=constants.HWTEST_CTS_PRIORITY, enable_skylab=False) # Python 3.7+ made async a reserved keyword. cts_config['async'] = True cts_config.update(kwargs) gts_config = dict( pool=constants.HWTEST_GTS_POOL, timeout=config_lib.HWTestConfig.GTS_QUAL_HW_TEST_TIMEOUT, priority=constants.HWTEST_GTS_PRIORITY, enable_skylab=False) # Python 3.7+ made async a reserved keyword. gts_config['async'] = True gts_config.update(kwargs) return [ config_lib.HWTestConfig(constants.HWTEST_CTS_QUAL_SUITE, **cts_config), config_lib.HWTestConfig(constants.HWTEST_GTS_QUAL_SUITE, **gts_config) ]
def setUp(self): self.base_vmtests = [config_lib.VMTestConfig('base')] self.override_vmtests = [config_lib.VMTestConfig('override')] self.base_hwtests = [config_lib.HWTestConfig('base')] self.override_hwtests = [config_lib.HWTestConfig('override')] self.all_configs = MockSiteConfig() self.all_configs.Add( 'no_tests_without_override', vm_tests=[], ) self.all_configs.Add( 'no_tests_with_override', vm_tests=[], vm_tests_override=self.override_vmtests, hw_tests_override=self.override_hwtests, ) self.all_configs.Add( 'tests_without_override', vm_tests=self.base_vmtests, hw_tests=self.base_hwtests, ) self.all_configs.Add( 'tests_with_override', vm_tests=self.base_vmtests, vm_tests_override=self.override_vmtests, hw_tests=self.base_hwtests, hw_tests_override=self.override_hwtests, )
def DefaultList(self, **kwargs): """Returns a default list of HWTestConfigs for a build. Args: *kwargs: overrides for the configs """ return [ config_lib.HWTestConfig(constants.HWTEST_BVT_SUITE, **self._bvtInlineHWTestArgs(kwargs)), config_lib.HWTestConfig(constants.HWTEST_ARC_COMMIT_SUITE, **self._bvtInlineHWTestArgs(kwargs)), self.TastConfig(constants.HWTEST_TAST_CQ_SUITE, **self._bvtInlineHWTestArgs(kwargs)), # Start informational Tast tests before the installer suite to let the # former run even if the latter fails: https://crbug.com/911921 self.TastConfig(constants.HWTEST_TAST_INFORMATIONAL_SUITE, **self._asyncHWTestArgs(kwargs)), # Context: crbug.com/976834 # Because this blocking suite fails a fair bit, it effectively acts as a # rate limiter to the Autotest scheduling system since all of the # subsequent test suites aren't run if this fails. # Making this non-blocking and async will cause Autotest scheduling to # fail. config_lib.HWTestConfig(constants.HWTEST_INSTALLER_SUITE, **self._blockingHWTestArgs(kwargs)), config_lib.HWTestConfig(constants.HWTEST_COMMIT_SUITE, **self._asyncHWTestArgs(kwargs)), config_lib.HWTestConfig(constants.HWTEST_CANARY_SUITE, **self._asyncHWTestArgs(kwargs)), ]
def DefaultList(self, **kwargs): """Returns a default list of HWTestConfigs for a build. Args: *kwargs: overrides for the configs """ installer_kwargs = kwargs.copy() # Force au suite to run first. installer_kwargs['priority'] = constants.HWTEST_CQ_PRIORITY # Context: crbug.com/976834 # Because this blocking suite fails a fair bit, it effectively acts as a # rate limiter to the Autotest scheduling system since all of the subsequent # test suites aren't run if this fails. # Making this non-blocking and async will cause Autotest scheduling to fail. installer_kwargs['blocking'] = True installer_kwargs['async'] = False async_kwargs = kwargs.copy() async_kwargs['priority'] = constants.HWTEST_POST_BUILD_PRIORITY async_kwargs['async'] = True async_kwargs['suite_min_duts'] = 1 async_kwargs['timeout'] = config_lib.HWTestConfig.ASYNC_HW_TEST_TIMEOUT if self.is_release_branch: bvt_inline_kwargs = async_kwargs else: bvt_inline_kwargs = kwargs.copy() bvt_inline_kwargs['timeout'] = ( config_lib.HWTestConfig.SHARED_HW_TEST_TIMEOUT) # BVT + INSTALLER suite. return [ config_lib.HWTestConfig(constants.HWTEST_BVT_SUITE, **bvt_inline_kwargs), config_lib.HWTestConfig(constants.HWTEST_ARC_COMMIT_SUITE, **bvt_inline_kwargs), self.TastConfig(constants.HWTEST_TAST_CQ_SUITE, **bvt_inline_kwargs), # Start informational Tast tests before the installer suite to let the # former run even if the latter fails: https://crbug.com/911921 self.TastConfig(constants.HWTEST_TAST_INFORMATIONAL_SUITE, **async_kwargs), config_lib.HWTestConfig(constants.HWTEST_INSTALLER_SUITE, **installer_kwargs), config_lib.HWTestConfig(constants.HWTEST_COMMIT_SUITE, **async_kwargs), config_lib.HWTestConfig(constants.HWTEST_CANARY_SUITE, **async_kwargs), ]
def DefaultListNonCanary(self, **kwargs): """Return a default list of HWTestConfigs for a non-canary build. Optional arguments may be overridden in `kwargs`, except that the `blocking` setting cannot be provided. """ # N.B. The ordering here is coupled with the column order of # entries in _paladin_hwtest_assignments, below. If you change the # ordering here you must also change the ordering there. return [ config_lib.HWTestConfig(constants.HWTEST_BVT_SUITE, **kwargs), config_lib.HWTestConfig(constants.HWTEST_COMMIT_SUITE, **kwargs), config_lib.HWTestConfig(constants.HWTEST_ARC_COMMIT_SUITE, **kwargs) ]
def DefaultListChromePFQInformational(self, **kwargs): """Return a default list of HWTestConfigs for an inform. Chrome PFQ build. Optional arguments may be overridden in `kwargs`, except that the `blocking` setting cannot be provided. """ # The informational PFQ does not honor to retry jobs. This reduces # hwtest times and shows flakes clearer. default_dict = dict(pool=constants.HWTEST_PFQ_POOL, file_bugs=True, priority=constants.HWTEST_PFQ_PRIORITY, retry=False, max_retries=None, minimum_duts=1) # Allows kwargs overrides to default_dict for pfq. default_dict.update(kwargs) suite_list = self.DefaultListNonCanary(**default_dict) suite_list.append( config_lib.HWTestConfig(constants.HWTEST_CHROME_INFORMATIONAL, warn_only=True, **default_dict)) suite_list.append( self.TastConfig(constants.HWTEST_TAST_CHROME_PFQ_SUITE, **default_dict)) return suite_list
def ToolchainTestFull(self, machine_pool, **kwargs): """Return full set of HWTESTConfigs to run toolchain correctness tests.""" default_dict = dict(pool=machine_pool, file_bugs=False, priority=constants.HWTEST_DEFAULT_PRIORITY) # Python 3.7+ made async a reserved keyword. default_dict['async'] = False default_dict.update(kwargs) return [ config_lib.HWTestConfig(constants.HWTEST_BVT_SUITE, **default_dict), config_lib.HWTestConfig(constants.HWTEST_COMMIT_SUITE, **default_dict), self.TastConfig(constants.HWTEST_TAST_CQ_SUITE, **default_dict), config_lib.HWTestConfig('security', **default_dict), config_lib.HWTestConfig('kernel_daily_regression', **default_dict), config_lib.HWTestConfig('kernel_daily_benchmarks', **default_dict) ]
def AFDORecordTest(self, **kwargs): default_dict = dict(pool=constants.HWTEST_QUOTA_POOL, quota_account='toolchain', file_bugs=True, timeout=constants.AFDO_GENERATE_TIMEOUT, priority=constants.HWTEST_PFQ_PRIORITY) # Allows kwargs overrides to default_dict for cq. default_dict.update(kwargs) return config_lib.HWTestConfig(constants.HWTEST_AFDO_SUITE, **default_dict)
def ToolchainTestMedium(self, machine_pool, **kwargs): """Return list of HWTESTConfigs to run toolchain LLVM correctness tests. Since the kernel is not built with LLVM, it makes no sense for the toolchain to run kernel tests on LLVM builds. """ default_dict = dict(pool=machine_pool, file_bugs=False, priority=constants.HWTEST_DEFAULT_PRIORITY) # Python 3.7+ made async a reserved keyword. default_dict['async'] = False default_dict.update(kwargs) return [ config_lib.HWTestConfig(constants.HWTEST_BVT_SUITE, **default_dict), config_lib.HWTestConfig(constants.HWTEST_COMMIT_SUITE, **default_dict), self.TastConfig(constants.HWTEST_TAST_CQ_SUITE, **default_dict), config_lib.HWTestConfig('security', **default_dict) ]
def AFDOList(self, **kwargs): """Returns a default list of HWTestConfigs for a AFDO build. For more details on AFDO: - https://gcc.gnu.org/wiki/AutoFDO - https://sites.google.com/a/google.com/chromeos-toolchain-team-home2 -> 11. AFDO PROFILE-GUIDED OPTIMIZATIONS Args: *kwargs: overrides for the configs """ afdo_dict = dict(pool=constants.HWTEST_SUITES_POOL, timeout=120 * 60, retry=False, max_retries=None) # Python 3.7+ made async a reserved keyword. afdo_dict['async'] = True afdo_dict.update(kwargs) return [config_lib.HWTestConfig('perf_v2', **afdo_dict)]
def SharedPoolPFQ(self, **kwargs): """Return a list of HWTestConfigs for PFQ which uses a shared pool. The returned suites will run in quotascheduler by default, which is shared with other types of builders (canaries, cq). The first suite in the list is a blocking sanity suite that verifies the build will not break dut. """ sanity_dict = dict(pool=constants.HWTEST_QUOTA_POOL, file_bugs=True, quota_account=constants.HWTEST_QUOTA_ACCOUNT_PFQ) sanity_dict.update(kwargs) sanity_dict.update( dict(minimum_duts=1, suite_min_duts=1, blocking=True)) default_dict = dict(suite_min_duts=3) default_dict.update(kwargs) suite_list = [ config_lib.HWTestConfig(constants.HWTEST_SANITY_SUITE, **sanity_dict) ] suite_list.extend(self.DefaultListPFQ(**default_dict)) return suite_list
def TastConfig(self, suite_name, **kwargs): """Return an HWTestConfig that runs the provided Tast test suite. Args: suite_name: String suite name, e.g. constants.HWTEST_TAST_CQ_SUITE. kwargs: Dict containing additional keyword args to use when constructing the HWTestConfig. Returns: HWTestConfig object for running the suite. """ kwargs = kwargs.copy() # Tast test suites run at most three jobs (for system, Chrome, and Android # tests) and have short timeouts, so request at most 1 DUT (while retaining # passed-in requests for 0 DUTs). if kwargs.get('minimum_duts', 0): kwargs['minimum_duts'] = 1 if kwargs.get('suite_min_duts', 0): kwargs['suite_min_duts'] = 1 return config_lib.HWTestConfig(suite_name, **kwargs)
def SharedPoolCanary(self, **kwargs): """Return a list of HWTestConfigs for Canary which uses a shared pool. The returned suites will run in pool:critical by default, which is shared with CQs. The first suite in the list is a blocking sanity suite that verifies the build will not break dut. """ sanity_dict = dict(pool=constants.HWTEST_MACH_POOL, file_bugs=True) sanity_dict.update(kwargs) sanity_dict.update( dict(minimum_duts=1, suite_min_duts=1, blocking=True, quota_account='bvt-sync')) default_dict = dict(pool=constants.HWTEST_MACH_POOL, suite_min_duts=6) default_dict.update(kwargs) suite_list = [ config_lib.HWTestConfig(constants.HWTEST_SANITY_SUITE, **sanity_dict) ] suite_list.extend(self.DefaultListCanary(**default_dict)) return suite_list
def DefaultListPFQ(self, **kwargs): """Return a default list of HWTestConfig's for a PFQ build. Optional arguments may be overridden in `kwargs`, except that the `blocking` setting cannot be provided. """ default_dict = dict( file_bugs=True, pool=constants.HWTEST_QUOTA_POOL, quota_account=constants.HWTEST_QUOTA_ACCOUNT_PFQ, timeout=config_lib.HWTestConfig.ASYNC_HW_TEST_TIMEOUT, priority=constants.HWTEST_PFQ_PRIORITY, minimum_duts=3) # Allows kwargs overrides to default_dict for pfq. default_dict.update(kwargs) return [ config_lib.HWTestConfig(constants.HWTEST_ARC_COMMIT_SUITE, **default_dict), self.TastConfig(constants.HWTEST_TAST_ANDROID_PFQ_SUITE, **default_dict), ]
def testAddedContents(self): """Verify that our complex config looks like we expect, before saving.""" expected = { 'default': { '_template': None, 'name': 'default', 'value': 'default', }, 'default_with_override': { '_template': None, 'name': 'default_with_override', 'value': 'override', }, 'default_with_mixin': { '_template': None, 'name': 'default_with_mixin', 'value': 'mixin', }, 'mixin_with_override': { '_template': None, 'name': 'mixin_with_override', 'value': 'override', }, 'default_with_template': { '_template': 'template', 'name': 'default_with_template', 'value': 'template', }, 'template_with_override': { '_template': 'template', 'name': 'template_with_override', 'value': 'override' }, 'template_with_mixin': { '_template': 'template', 'name': 'template_with_mixin', 'value': 'mixin', }, 'template_with_mixin_override': { '_template': 'template', 'name': 'template_with_mixin_override', 'value': 'override' }, 'calling': { '_template': 'callable', 'name': 'calling', 'value': 'default extended', }, 'match': { '_template': None, 'name': 'match', 'value': 'default', }, 'template_back_to_default': { '_template': 'template', 'name': 'template_back_to_default', 'value': 'default', }, 'vm_tests': { '_template': None, 'name': 'vm_tests', 'vm_tests': [config_lib.VMTestConfig('vm_suite')], 'vm_tests_override': [config_lib.VMTestConfig('vm_override')], }, 'hw_tests': { '_template': None, 'name': 'hw_tests', 'hw_tests': [config_lib.HWTestConfig('hw_suite')], 'hw_tests_override': [config_lib.HWTestConfig('hw_override')], }, 'parent': { '_template': None, 'name': 'parent', 'value': 'default', }, } # Make sure our expected build configs exist. self.assertItemsEqual(self.site_config.keys(), expected.keys()) # Make sure each one contains self.longMessage = True for name in expected.keys(): self.assertDictContainsSubset(expected[name], self.site_config[name], name) # Special handling for child configs. children = self.site_config['parent'].child_configs self.assertEqual(len(children), 2) self.assertDictContainsSubset( { '_template': None, 'name': 'default', 'value': 'default', 'grouped': True, }, children[0]) self.assertDictContainsSubset( { '_template': None, 'name': 'default_with_override', 'value': 'override', 'grouped': True, }, children[1])
def GeneralTemplates(site_config, ge_build_config): """Apply test config to general templates Args: site_config: config_lib.SiteConfig to be modified by adding templates and configs. ge_build_config: Dictionary containing the decoded GE configuration file. """ hw_test_list = HWTestList(ge_build_config) # TryjobMirrors uses hw_tests_override to ensure that tryjobs run all suites # rather than just the ones that are assigned to the board being used. Add # bvt-tast-cq here since it includes system, Chrome, and Android tests. site_config.AddTemplate( 'default_hw_tests_override', hw_tests_override=hw_test_list.DefaultList( # Explicitly set quota account to preserve pre-QuotaScheduler # behaviour: Skylab tasks created for tryjobs compete with the general # suite_scheduler triggered tasks. pool=constants.HWTEST_QUOTA_POOL, quota_account=constants.HWTEST_QUOTA_ACCOUNT_SUITES, file_bugs=False, ), ) # Notice all builders except for vmtest_boards should not run vmtest. site_config.AddTemplate( 'no_vmtest_builder', vm_tests=[], vm_tests_override=None, gce_tests=[], tast_vm_tests=[], moblab_vm_tests=[], ) site_config.AddTemplate( 'no_hwtest_builder', hw_tests=[], hw_tests_override=[], ) site_config.AddTemplate( 'moblab', site_config.templates.no_vmtest_builder, image_test=False, ) site_config.templates.full.apply( site_config.templates.default_hw_tests_override, image_test=True, ) site_config.templates.fuzzer.apply( site_config.templates.default_hw_tests_override, site_config.templates.no_hwtest_builder, image_test=True, ) # BEGIN asan site_config.templates.asan.apply( site_config.templates.default_hw_tests_override, ) # END asan # BEGIN Incremental site_config.templates.incremental.apply( site_config.templates.default_hw_tests_override, ) site_config.templates.internal_incremental.apply( site_config.templates.default_hw_tests_override, ) # END Incremental # BEGIN Factory site_config.templates.factory.apply( # site_config.templates.default_hw_tests_override, site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Factory # BEGIN Firmware site_config.templates.firmwarebranch.apply( site_config.templates.no_vmtest_builder, ) # END Firmware # BEGIN Lakitu site_config.templates.lakitu.apply( site_config.templates.no_hwtest_builder, ) # END Lakitu # BEGIN Loonix site_config.templates.loonix.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Loonix # BEGIN WSHWOS site_config.templates.wshwos.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END WSHWOS # BEGIN Dustbuster site_config.templates.dustbuster.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Dustbuster # BEGIN Release release_hw_tests = hw_test_list.SharedPoolCanary() site_config.templates.release.apply( site_config.templates.default_hw_tests_override, hw_tests=release_hw_tests, ) site_config.templates.moblab_release.apply( site_config.templates.default_hw_tests_override, hw_tests=[ config_lib.HWTestConfig(constants.HWTEST_MOBLAB_SUITE, timeout=120 * 60), config_lib.HWTestConfig(constants.HWTEST_BVT_SUITE, warn_only=True), hw_test_list.TastConfig(constants.HWTEST_TAST_CQ_SUITE, warn_only=True), config_lib.HWTestConfig(constants.HWTEST_INSTALLER_SUITE, warn_only=True) ], ) site_config.templates.payloads.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Release site_config.templates.test_ap.apply( site_config.templates.no_vmtest_builder, site_config.templates.default_hw_tests_override, ) # BEGIN Termina site_config.templates.termina.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Termina # BEGIN Unittest Stress site_config.templates.unittest_stress.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Unittest Stress # BEGIN Ubsan site_config.templates.ubsan.apply( site_config.templates.default_hw_tests_override, ) # END Ubsan # BEGIN x30evb site_config.templates.x30evb.apply( site_config.templates.no_hwtest_builder, )
def GeneralTemplates(site_config, ge_build_config): """Apply test config to general templates Args: site_config: config_lib.SiteConfig to be modified by adding templates and configs. ge_build_config: Dictionary containing the decoded GE configuration file. """ hw_test_list = HWTestList(ge_build_config) # TryjobMirrors uses hw_tests_override to ensure that tryjobs run all suites # rather than just the ones that are assigned to the board being used. Add # bvt-tast-cq here since it includes system, Chrome, and Android tests. site_config.AddTemplate( 'default_hw_tests_override', hw_tests_override=hw_test_list.DefaultList( pool=constants.HWTEST_TRYBOT_POOL, file_bugs=False, ), ) # Notice all builders except for vmtest_boards should not run vmtest. site_config.AddTemplate( 'no_vmtest_builder', vm_tests=[], vm_tests_override=None, gce_tests=[], tast_vm_tests=[], moblab_vm_tests=[], ) site_config.AddTemplate( 'no_hwtest_builder', hw_tests=[], hw_tests_override=[], ) site_config.AddTemplate( 'moblab', site_config.templates.no_vmtest_builder, image_test=False, ) site_config.templates.full.apply( site_config.templates.default_hw_tests_override, image_test=True, ) site_config.templates.fuzzer.apply( site_config.templates.default_hw_tests_override, site_config.templates.no_hwtest_builder, image_test=True, ) # BEGIN asan site_config.templates.asan.apply( site_config.templates.default_hw_tests_override, ) # END asan # BEGIN Incremental site_config.templates.incremental.apply( site_config.templates.default_hw_tests_override, ) site_config.templates.internal_incremental.apply( site_config.templates.default_hw_tests_override, ) # END Incremental # BEGIN Factory site_config.templates.factory.apply( # site_config.templates.default_hw_tests_override, site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Factory # BEGIN Firmware site_config.templates.firmwarebranch.apply( site_config.templates.no_vmtest_builder, ) # END Firmware # BEGIN Lakitu site_config.templates.lakitu.apply( site_config.templates.no_hwtest_builder, ) # END Lakitu # BEGIN Loonix site_config.templates.loonix.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Loonix # BEGIN WSHWOS site_config.templates.wshwos.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END WSHWOS # BEGIN Dustbuster site_config.templates.dustbuster.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Dustbuster # BEGIN Release release_hw_tests = (hw_test_list.CtsGtsQualTests() + hw_test_list.SharedPoolCanary()) site_config.templates.release.apply( site_config.templates.default_hw_tests_override, hw_tests=release_hw_tests, ) site_config.templates.moblab_release.apply( site_config.templates.default_hw_tests_override, hw_tests=[ config_lib.HWTestConfig(constants.HWTEST_MOBLAB_SUITE, timeout=120 * 60), config_lib.HWTestConfig(constants.HWTEST_BVT_SUITE, warn_only=True), hw_test_list.TastConfig(constants.HWTEST_TAST_CQ_SUITE, warn_only=True), config_lib.HWTestConfig(constants.HWTEST_INSTALLER_SUITE, warn_only=True) ], ) release_afdo_hw_tests = ( hw_test_list.DefaultList(pool=constants.HWTEST_SUITES_POOL) + hw_test_list.AFDOList()) site_config.templates.release_afdo.apply( site_config.templates.default_hw_tests_override, hw_tests=release_afdo_hw_tests, ) site_config.templates.release_afdo_generate.apply( site_config.templates.default_hw_tests_override, hw_tests=[hw_test_list.AFDORecordTest(warn_only=True)], hw_tests_override=[ hw_test_list.AFDORecordTest( pool=constants.HWTEST_TRYBOT_POOL, file_bugs=False, warn_only=True, priority=constants.HWTEST_DEFAULT_PRIORITY, ) ], ) site_config.templates.release_afdo_use.apply( site_config.templates.default_hw_tests_override, hw_tests=release_afdo_hw_tests, ) site_config.templates.payloads.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Release site_config.templates.test_ap.apply( site_config.templates.no_vmtest_builder, site_config.templates.default_hw_tests_override, ) # BEGIN Termina site_config.templates.termina.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Termina # BEGIN Unittest Stress site_config.templates.unittest_stress.apply( site_config.templates.no_vmtest_builder, site_config.templates.no_hwtest_builder, ) # END Unittest Stress # BEGIN Ubsan site_config.templates.ubsan.apply( site_config.templates.default_hw_tests_override, ) # END Ubsan # BEGIN x30evb site_config.templates.x30evb.apply( site_config.templates.no_hwtest_builder, )
def setUp(self): self.complex_defaults = { 'value': 'default', } # Construct our test config. site_config = config_lib.SiteConfig(defaults=self.complex_defaults) site_config.AddTemplate('match', value='default') site_config.AddTemplate('template', value='template') site_config.AddTemplate('mixin', value='mixin') site_config.AddTemplate('unused', value='unused') site_config.AddTemplate('callable', value=self._callable) default = site_config.Add('default') default_with_override = site_config.Add('default_with_override', value='override') site_config.AddWithoutTemplate('default_with_mixin', site_config.templates.mixin) site_config.AddWithoutTemplate('mixin_with_override', site_config.templates.mixin, value='override') site_config.Add('default_with_template', site_config.templates.template) site_config.Add('template_with_override', site_config.templates.template, value='override') site_config.Add('template_with_mixin', site_config.templates.template, site_config.templates.mixin) site_config.Add('template_with_mixin_override', site_config.templates.template, site_config.templates.mixin, value='override') site_config.Add('match', value='default') site_config.Add('template_back_to_default', site_config.templates.template, value='default') site_config.Add('calling', site_config.templates.callable) site_config.Add( 'vm_tests', vm_tests=[config_lib.VMTestConfig('vm_suite')], vm_tests_override=[config_lib.VMTestConfig('vm_override')]) site_config.Add( 'hw_tests', hw_tests=[config_lib.HWTestConfig('hw_suite')], hw_tests_override=[config_lib.HWTestConfig('hw_override')]) site_config.Add('tast_vm_tests', tast_vm_tests=[ config_lib.TastVMTestConfig( 'tast_vm_suite', ['(!disabled)']) ]) site_config.AddGroup('parent', default, default_with_override) self.site_config = site_config
def setUp(self): self.complex_defaults = { 'value': 'default', } self.complex_site_params = { 'site_foo': True, 'site_bar': False, 'nested': { 'sub1': 1, 'sub2': 2 }, } # Construct our test config. site_config = config_lib.SiteConfig( defaults=self.complex_defaults, site_params=self.complex_site_params) site_config.AddTemplate('match', value='default') site_config.AddTemplate('template', value='template') site_config.AddTemplate('mixin', value='mixin') site_config.AddTemplate('unused', value='unused') site_config.AddTemplate('callable', value=self._callable) default = site_config.Add('default') default_with_override = site_config.Add('default_with_override', value='override') site_config.AddWithoutTemplate('default_with_mixin', site_config.templates.mixin) site_config.AddWithoutTemplate('mixin_with_override', site_config.templates.mixin, value='override') site_config.Add('default_with_template', site_config.templates.template) site_config.Add('template_with_override', site_config.templates.template, value='override') site_config.Add('template_with_mixin', site_config.templates.template, site_config.templates.mixin) site_config.Add('template_with_mixin_override', site_config.templates.template, site_config.templates.mixin, value='override') site_config.Add('match', value='default') site_config.Add('template_back_to_default', site_config.templates.template, value='default') site_config.Add('calling', site_config.templates.callable) site_config.Add( 'vm_tests', vm_tests=[config_lib.VMTestConfig('vm_suite')], vm_tests_override=[config_lib.VMTestConfig('vm_override')]) site_config.Add( 'hw_tests', hw_tests=[config_lib.HWTestConfig('hw_suite')], hw_tests_override=[config_lib.HWTestConfig('hw_override')]) site_config.AddGroup('parent', default, default_with_override) self.site_config = site_config