Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Workqueue

Workqueue Tests. More...

Functions

 ZTEST (kernel_offload_wq, test_offload_workqueue)
 Verify thread context.
 
static void test_k_work_user_submit_to_queue_fail (void)
 Test k_work_user_submit_to_queue API.
 
static void test_work_user_queue_start_before_submit (void)
 Test user mode work queue start before submit.
 
static void test_user_workq_granted_access_setup (void)
 Setup object permissions before test_user_workq_granted_access()
 
static void test_user_workq_granted_access (void)
 Test user mode grant workqueue permissions.
 
static void test_user_work_submit_to_queue_thread (void)
 Test work submission to work queue (user mode)
 
static void delayed_test_items_init (void)
 
static void delayed_test_items_submit (void)
 
static void test_sequence (void)
 Test work queue items submission sequence.
 
 ZTEST (workqueue_triggered, test_resubmit)
 Test work queue item resubmission.
 
static void test_delayed_init (void)
 Test delayed work queue init.
 
static void test_delayed_submit (void)
 Test delayed workqueue submit.
 
 ZTEST (workqueue_delayed, test_delayed_cancel)
 Test work queue delayed cancel.
 
 ZTEST (workqueue_delayed, test_delayed)
 Test delayed work items.
 
static void test_triggered_init (void)
 Test triggered work queue init.
 
static void test_triggered_submit (k_timeout_t timeout)
 Test triggered workqueue submit.
 
static void test_triggered_trigger (void)
 Trigger triggered workqueue execution.
 
 ZTEST (workqueue_triggered, test_triggered)
 Test triggered work items.
 
 ZTEST (workqueue_triggered, test_already_triggered)
 Test already triggered work items.
 
 ZTEST (workqueue_triggered, test_triggered_resubmit)
 Test resubmission of triggered work queue item.
 
 ZTEST (workqueue_triggered, test_triggered_no_wait)
 Test triggered work items with K_NO_WAIT timeout.
 
 ZTEST (workqueue_triggered, test_triggered_no_wait_expired)
 Test expired triggered work items with K_NO_WAIT timeout.
 
 ZTEST (workqueue_triggered, test_triggered_wait)
 Test triggered work items with arbitrary timeout.
 
 ZTEST (workqueue_triggered, test_triggered_wait_expired)
 Test expired triggered work items with arbitrary timeout.
 
 ZTEST (workqueue_triggered, test_triggered_from_msgq)
 Test triggered work item, triggered by a msgq message.
 
 ZTEST (workqueue_triggered, test_delayed_work_define)
 Test delayed work queue define macro.
 
 ZTEST (workqueue_triggered, test_triggered_cancel)
 Verify k_work_poll_cancel()
 

Detailed Description

Workqueue Tests.

Function Documentation

◆ delayed_test_items_init()

static void delayed_test_items_init ( void  )
static

◆ delayed_test_items_submit()

static void delayed_test_items_submit ( void  )
static

◆ test_delayed_init()

static void test_delayed_init ( void  )
static

#include <tests/kernel/workq/work_queue/src/main.c>

Test delayed work queue init.

See also
k_work_init_delayable()

◆ test_delayed_submit()

static void test_delayed_submit ( void  )
static

#include <tests/kernel/workq/work_queue/src/main.c>

Test delayed workqueue submit.

See also
k_work_init_delayable(), k_work_schedule()

◆ test_k_work_user_submit_to_queue_fail()

static void test_k_work_user_submit_to_queue_fail ( void  )
static

#include <tests/kernel/workq/user_work/src/main.c>

Test k_work_user_submit_to_queue API.

Function k_work_user_submit_to_queue() will return -EBUSY: if the work item was already in some workqueue and -ENOMEM: if no memory for thread resource pool allocation. Create two situation to meet the error return value.

See also
k_work_user_submit_to_queue()

◆ test_sequence()

static void test_sequence ( void  )
static

#include <tests/kernel/workq/work_queue/src/main.c>

Test work queue items submission sequence.

See also
k_work_init(), k_work_submit()

◆ test_triggered_init()

static void test_triggered_init ( void  )
static

#include <tests/kernel/workq/work_queue/src/main.c>

Test triggered work queue init.

See also
k_work_poll_init()

◆ test_triggered_submit()

static void test_triggered_submit ( k_timeout_t  timeout)
static

#include <tests/kernel/workq/work_queue/src/main.c>

Test triggered workqueue submit.

See also
k_work_poll_init(), k_work_poll_submit()

◆ test_triggered_trigger()

static void test_triggered_trigger ( void  )
static

#include <tests/kernel/workq/work_queue/src/main.c>

Trigger triggered workqueue execution.

◆ test_user_work_submit_to_queue_thread()

static void test_user_work_submit_to_queue_thread ( void  )
static

#include <tests/kernel/workq/user_work/src/main.c>

Test work submission to work queue (user mode)

See also
k_work_init(), k_work_is_pending(), k_work_submit_to_queue(), k_work_submit()

◆ test_user_workq_granted_access()

static void test_user_workq_granted_access ( void  )
static

#include <tests/kernel/workq/user_work/src/main.c>

Test user mode grant workqueue permissions.

See also
k_work_q_object_access_grant()

◆ test_user_workq_granted_access_setup()

static void test_user_workq_granted_access_setup ( void  )
static

◆ test_work_user_queue_start_before_submit()

static void test_work_user_queue_start_before_submit ( void  )
static

#include <tests/kernel/workq/user_work/src/main.c>

Test user mode work queue start before submit.

See also
k_work_user_queue_start()

◆ ZTEST() [1/14]

ZTEST ( kernel_offload_wq  ,
test_offload_workqueue   
)

#include <tests/kernel/workq/critical/src/main.c>

Verify thread context.

Check whether variable value per-thread is saved during context switch

◆ ZTEST() [2/14]

ZTEST ( workqueue_delayed  ,
test_delayed   
)

◆ ZTEST() [3/14]

ZTEST ( workqueue_delayed  ,
test_delayed_cancel   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test work queue delayed cancel.

See also
k_work_delayable_init(), k_work_schedule(), k_work_cancel_delayable()

◆ ZTEST() [4/14]

ZTEST ( workqueue_triggered  ,
test_already_triggered   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test already triggered work items.

See also
k_work_poll_init(), k_work_poll_submit()

◆ ZTEST() [5/14]

ZTEST ( workqueue_triggered  ,
test_delayed_work_define   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test delayed work queue define macro.

See also
K_WORK_DELAYABLE_DEFINE()

◆ ZTEST() [6/14]

ZTEST ( workqueue_triggered  ,
test_resubmit   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test work queue item resubmission.

See also
k_work_submit()

◆ ZTEST() [7/14]

ZTEST ( workqueue_triggered  ,
test_triggered   
)

◆ ZTEST() [8/14]

ZTEST ( workqueue_triggered  ,
test_triggered_cancel   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Verify k_work_poll_cancel()

Cancel a triggered work item repeatedly, see if it returns expected value.

See also
k_work_poll_cancel()

◆ ZTEST() [9/14]

ZTEST ( workqueue_triggered  ,
test_triggered_from_msgq   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test triggered work item, triggered by a msgq message.

Regression test for issue #45267:

When an object availability event triggers a k_work_poll item, the object lock should not be held anymore during the execution of the work callback.

Tested with msgq with K_POLL_TYPE_MSGQ_DATA_AVAILABLE.

See also
k_work_poll_init(), k_work_poll_submit()

◆ ZTEST() [10/14]

ZTEST ( workqueue_triggered  ,
test_triggered_no_wait   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test triggered work items with K_NO_WAIT timeout.

See also
k_work_poll_init(), k_work_poll_submit()

◆ ZTEST() [11/14]

ZTEST ( workqueue_triggered  ,
test_triggered_no_wait_expired   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test expired triggered work items with K_NO_WAIT timeout.

See also
k_work_poll_init(), k_work_poll_submit()

◆ ZTEST() [12/14]

ZTEST ( workqueue_triggered  ,
test_triggered_resubmit   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test resubmission of triggered work queue item.

See also
k_work_poll_init(), k_work_poll_submit()

◆ ZTEST() [13/14]

ZTEST ( workqueue_triggered  ,
test_triggered_wait   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test triggered work items with arbitrary timeout.

See also
k_work_poll_init(), k_work_poll_submit()

◆ ZTEST() [14/14]

ZTEST ( workqueue_triggered  ,
test_triggered_wait_expired   
)

#include <tests/kernel/workq/work_queue/src/main.c>

Test expired triggered work items with arbitrary timeout.

See also
k_work_poll_init(), k_work_poll_submit()