Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
MP Tests

Tests for multi processing. More...

Functions

 ZTEST (multiprocessing, test_mp_start)
 Test to verify CPU start.
 

Detailed Description

Tests for multi processing.

Function Documentation

◆ ZTEST()

ZTEST ( multiprocessing  ,
test_mp_start   
)

#include <tests/kernel/mp/src/main.c>

Test to verify CPU start.

Test Objective:

  • To verify kernel architecture layer shall provide a means to start non-boot CPUs on SMP systems. The way we verify it is to call it by give it parameters especially the target executing function, etc. Then check if the function is running or not.

Testing techniques:

  • Interface testing, function and block box testing, dynamic analysis and testing

Prerequisite Conditions:

  • CONFIG_MP_MAX_NUM_CPUS > 1

Input Specifications:

  • CPU ID: the cpu want to start
  • Stack structure
  • Stack size
  • Target executing function
  • An argument that pass to the function

Test Procedure:

  1. In main thread, given and set a global variable cpu_arg to 12345.
  2. Call arch_cpu_start() with parameters
  3. Enter a while loop and wait for cpu_running equals to 1.
  4. In target function, check if the address is &cpu_arg and its content equal to 12345.
  5. Set the global flag variable cpu_running to 1.
  6. In main thread, check if the cpu_running equals to 1.

Expected Test Result:

  • The given function execute cpu is running and .

Pass/Fail Criteria:

  • Successful if the check of step 4, 6 are all pass.
  • Failure if one of the check of step 4, 6 is failed.

Assumptions and Constraints:

  • This test using for the platform that support MP or SMP, in our current scenario which own over two CPUs.
See also
arch_cpu_start()