tests/kernel/threads_apis: Add case for CPU_MASK_PIN_ONLY

Add testing for the PIN_ONLY API variant (which has a separate run
queue per CPU).  Predicate on SMP systems only, to keep needless
duplicate testing to a minimum.

Note that one of the cases in this test exercises an "all cpus" option
for the cpu mask, which is illegal when CONFIG_SCHED_CPU_MASK_PIN_ONLY
is set.  Skip.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2021-09-24 15:33:25 -07:00 committed by Christopher Friedt
commit 0f20abda8d
2 changed files with 13 additions and 0 deletions

View file

@ -42,6 +42,13 @@ void test_threads_cpu_mask(void)
zassert_true(ret == -EINVAL, ""); zassert_true(ret == -EINVAL, "");
for (pass = 0; pass < 4; pass++) { for (pass = 0; pass < 4; pass++) {
if (IS_ENABLED(CONFIG_SCHED_CPU_MASK_PIN_ONLY) && pass == 1) {
/* Pass 1 enables more than one CPU in the
* mask, which is illegal when PIN_ONLY
*/
continue;
}
child_has_run = false; child_has_run = false;
/* Create a thread at a higher priority, don't start /* Create a thread at a higher priority, don't start

View file

@ -2,3 +2,9 @@ tests:
kernel.threads.apis: kernel.threads.apis:
tags: kernel threads userspace ignore_faults tags: kernel threads userspace ignore_faults
min_flash: 34 min_flash: 34
kernel.threads.apis.pinonly:
tags: kernel threads userspace ignore_faults
min_flash: 34
filter: CONFIG_SMP
extra_configs:
- CONFIG_SCHED_CPU_MASK_PIN_ONLY=y