diff --git a/doc/develop/test/twister.rst b/doc/develop/test/twister.rst index a02f02391fa..a3893e5da6a 100644 --- a/doc/develop/test/twister.rst +++ b/doc/develop/test/twister.rst @@ -455,6 +455,17 @@ arch_allow: arch_exclude: Set of architectures that this test scenario should not run on. +vendor_allow: + Set of platform vendors that this test scenario should only be run for. The + vendor is defined as part of the board definition. Boards associated with + this vendors will be included. Other boards, including those without a + vendor will be excluded. + +vendor_exclude: + Set of platform vendors that this test scenario should not run on. + The vendor is defined as part of the board. Boards associated with this + vendors will be excluded. + platform_allow: Set of platforms that this test scenario should only be run for. Do not use this option to limit testing or building in CI due to time or resource diff --git a/scripts/pylib/twister/twisterlib/config_parser.py b/scripts/pylib/twister/twisterlib/config_parser.py index c777059ad86..f19ee3df544 100644 --- a/scripts/pylib/twister/twisterlib/config_parser.py +++ b/scripts/pylib/twister/twisterlib/config_parser.py @@ -61,6 +61,8 @@ class TwisterConfigParser: "min_flash": {"type": "int", "default": 32}, "arch_allow": {"type": "set"}, "arch_exclude": {"type": "set"}, + "vendor_allow": {"type": "set"}, + "vendor_exclude": {"type": "set"}, "extra_sections": {"type": "list", "default": []}, "integration_platforms": {"type": "list", "default": []}, "ignore_faults": {"type": "bool", "default": False }, diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index d4031a96364..18f35a1eeb4 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -904,6 +904,12 @@ class TestPlan: if ts.arch_exclude and plat.arch in ts.arch_exclude: instance.add_filter("In test case arch exclude", Filters.TESTSUITE) + if ts.vendor_allow and plat.vendor not in ts.vendor_allow: + instance.add_filter("Not in test suite vendor allow list", Filters.TESTSUITE) + + if ts.vendor_exclude and plat.vendor in ts.vendor_exclude: + instance.add_filter("In test suite vendor exclude", Filters.TESTSUITE) + if ts.platform_exclude and plat.name in ts.platform_exclude: # works only when we have all platforms parsed, -p limits parsing... if not platform_filter: diff --git a/scripts/schemas/twister/testsuite-schema.yaml b/scripts/schemas/twister/testsuite-schema.yaml index 4cb81431d86..7f167899fc3 100644 --- a/scripts/schemas/twister/testsuite-schema.yaml +++ b/scripts/schemas/twister/testsuite-schema.yaml @@ -20,6 +20,16 @@ schema;scenario-schema: "arch_allow": type: any required: false + "vendor_exclude": + type: seq + required: false + sequence: + - type: str + "vendor_allow": + type: seq + required: false + sequence: + - type: str "testcases": type: seq required: false