Skip to main content

Module test

Module test 

Source
Expand description

IPC ping-pong test (Port-based) + MPMC SyncChannel test (IPC-02).

§Port test (Task A / Task B)

Creates two kernel tasks that communicate via an IPC port:

  • Task A (sender): creates a port, stores its ID in a shared static, then sends a message with msg_type=42.
  • Task B (receiver): spins until the port ID is published, then calls recv() (which blocks if the message hasn’t arrived yet), logs the result, and verifies correctness.

§Channel test (IPC-02)

Three kernel tasks share a channel::<u64>(4):

  • Producer-1: sends 1, 2, 3 then drops its Sender endpoint.
  • Producer-2: yields once (so the consumer may block), then sends 4, 5.
  • Consumer: blocks on recv() until both producers disconnect, verifies it received exactly 5 messages.

Functions§

create_channel_test_tasks
Schedule the three channel test tasks.
create_ipc_04_05_test_task
Creates ipc 04 05 test task.
create_ipc_test_tasks
Create and schedule the IPC test tasks.