|
MXL : Media eXchange Layer
MXL
|
Event API, fragmentation, lifetime and concurrency regression tests. More...
#include <csignal>#include <cstring>#include <algorithm>#include <array>#include <atomic>#include <barrier>#include <fstream>#include <future>#include <limits>#include <span>#include <thread>#include <vector>#include <poll.h>#include <spawn.h>#include <unistd.h>#include <sys/wait.h>#include <catch2/catch_test_macros.hpp>#include <catch2/generators/catch_generators.hpp>#include <fmt/format.h>#include <mxl/flow.h>#include <mxl/mxl.h>#include "mxl-internal/EventRingBuffer.hpp"#include "mxl-internal/Flow.hpp"#include "mxl-internal/FlowManager.hpp"#include "mxl-internal/FlowParser.hpp"#include "mxl-internal/PosixFlowIoFactory.hpp"#include "mxl-internal/Sync.hpp"#include "PcapReader.hpp"#include "Utils.hpp"
Go to the source code of this file.
Functions | |
| TEST_CASE ("Compact event slots preserve payload boundaries across wraparound", "[events]") | |
| TEST_CASE ("Event atomic copies survive contention within the same mapping", "[events][concurrency]") | |
| TEST_CASE ("Event capacity follows grain rate and history duration", "[events]") | |
| TEST_CASE ("Event capacity rejects overflow before narrowing", "[events]") | |
| TEST_CASE ("Event group hints validate names roles and scopes", "[events][parser]") | |
| TEST_CASE ("Event parser requires a positive grain rate", "[events]") | |
| TEST_CASE ("Event publication retries only unpublished sequence tags", "[events][recovery]") | |
| TEST_CASE ("Event sequence exhaustion cannot alias an empty slot", "[events]") | |
| TEST_CASE ("Event writer recovery preserves publication and timestamp order", "[events][recovery]") | |
| TEST_CASE ("Independent event readers each consume every publication", "[events][concurrency]") | |
| TEST_CASE ("One event writer wakes independent readers in other processes", "[events][concurrency][ipc]") | |
| TEST_CASE ("Reopened event writers restore the last committed timestamp", "[events][timestamps]") | |
| TEST_CASE ("ST 2110-41 pcap packets round trip through the event ring", "[events][pcap]") | |
| TEST_CASE_METHOD (EventFixture, "Event API rejects wrong handles and invalid arguments", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event cancellation and invalid commits do not publish", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event capacity rejects too little or excessive history", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event commits reject earlier timestamps without publishing", "[events][timestamps]") | |
| TEST_CASE_METHOD (EventFixture, "Event flow queue preserves timestamps and complete payloads", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event indices identify queue position and skipped entries", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event overrun recovers at oldest retained event and hides open slot", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event reader rejects truncated shared payload", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event reader validates headers throughout the shared buffer", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event readers have independent cursors and wake on commit", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event readers never expose torn payloads during concurrent wraparound", "[events][concurrency]") | |
| TEST_CASE_METHOD (EventFixture, "Event slots occupy one shared memory file", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Event snapshots survive overwrite and reads from independent readers", "[events][concurrency]") | |
| TEST_CASE_METHOD (EventFixture, "Fragment offset mismatches expose discontinuities to the consumer", "[events][fragmentation]") | |
| TEST_CASE_METHOD (EventFixture, "Late event reader starts at oldest retained event and detects deleted flow", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Opening an event initializes every metadata field", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Repeated event writer acquisition shares publication state", "[events]") | |
| TEST_CASE_METHOD (EventFixture, "Two event fragments preserve continuity and reassemble across ring wrap", "[events][fragmentation]") | |
| TEST_CASE_METHOD (EventFixture, "Unfragmented events have zero offset and are complete", "[events][fragmentation]") | |
Event API, fragmentation, lifetime and concurrency regression tests.
Definition in file test_events.cpp.
| TEST_CASE | ( | "Compact event slots preserve payload boundaries across wraparound" | , |
| "" | [events] ) |
Aligned backing storage with an extra block to detect writes beyond the ring.
< Raw storage for slots or the trailing sentinel.
Definition at line 1402 of file test_events.cpp.
| TEST_CASE | ( | "Event atomic copies survive contention within the same mapping" | , |
| "" | [events][concurrency] ) |
Page-aligned backing storage for an in-memory event ring test.
< One page of raw mapping storage.
Definition at line 1476 of file test_events.cpp.
| TEST_CASE | ( | "Event capacity follows grain rate and history duration" | , |
| "" | [events] ) |
Definition at line 880 of file test_events.cpp.
| TEST_CASE | ( | "Event capacity rejects overflow before narrowing" | , |
| "" | [events] ) |
Definition at line 924 of file test_events.cpp.
| TEST_CASE | ( | "Event group hints validate names roles and scopes" | , |
| "" | [events][parser] ) |
Definition at line 854 of file test_events.cpp.
| TEST_CASE | ( | "Event parser requires a positive grain rate" | , |
| "" | [events] ) |
Definition at line 829 of file test_events.cpp.
| TEST_CASE | ( | "Event publication retries only unpublished sequence tags" | , |
| "" | [events][recovery] ) |
Definition at line 1603 of file test_events.cpp.
| TEST_CASE | ( | "Event sequence exhaustion cannot alias an empty slot" | , |
| "" | [events] ) |
Page-aligned backing storage for an in-memory event ring test.
< One page of raw mapping storage.
Definition at line 1568 of file test_events.cpp.
| TEST_CASE | ( | "Event writer recovery preserves publication and timestamp order" | , |
| "" | [events][recovery] ) |
Definition at line 1688 of file test_events.cpp.
| TEST_CASE | ( | "Independent event readers each consume every publication" | , |
| "" | [events][concurrency] ) |
Definition at line 1099 of file test_events.cpp.
| TEST_CASE | ( | "One event writer wakes independent readers in other processes" | , |
| "" | [events][concurrency][ipc] ) |
Own the pipe descriptors used to coordinate child readers with the producer.
< Read and write descriptors, each -1 until initialized.
Close any initialized descriptors during normal or failed test teardown.
Ensure a child reader cannot outlive a failed IPC test.
< Child process ID, or -1 after it has been reaped.
Kill and reap an outstanding child during test teardown.
Definition at line 1292 of file test_events.cpp.
| TEST_CASE | ( | "Reopened event writers restore the last committed timestamp" | , |
| "" | [events][timestamps] ) |
Own the temporary domain used to test writer reattachment without deleting flow files.
< Directory removed after all local mappings are destroyed.
Remove the test domain without throwing from cleanup.
Definition at line 573 of file test_events.cpp.
| TEST_CASE | ( | "ST 2110-41 pcap packets round trip through the event ring" | , |
| "" | [events][pcap] ) |
Synthetic TAI epoch used to make RTP timestamp conversion deterministic.
Definition at line 325 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event API rejects wrong handles and invalid arguments" | , | ||
| "" | [events] ) |
Definition at line 812 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event cancellation and invalid commits do not publish" | , | ||
| "" | [events] ) |
Definition at line 478 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event capacity rejects too little or excessive history" | , | ||
| "" | [events] ) |
Definition at line 912 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event commits reject earlier timestamps without publishing" | , | ||
| "" | [events][timestamps] ) |
Definition at line 519 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event flow queue preserves timestamps and complete payloads" | , | ||
| "" | [events] ) |
Definition at line 300 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event indices identify queue position and skipped entries" | , | ||
| "" | [events] ) |
Definition at line 1645 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event overrun recovers at oldest retained event and hides open slot" | , | ||
| "" | [events] ) |
Definition at line 753 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event reader rejects truncated shared payload" | , | ||
| "" | [events] ) |
Definition at line 981 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event reader validates headers throughout the shared buffer" | , | ||
| "" | [events] ) |
Definition at line 1026 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event readers have independent cursors and wake on commit" | , | ||
| "" | [events] ) |
Definition at line 781 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event readers never expose torn payloads during concurrent wraparound" | , | ||
| "" | [events][concurrency] ) |
Definition at line 1217 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event slots occupy one shared memory file" | , | ||
| "" | [events] ) |
Definition at line 992 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Event snapshots survive overwrite and reads from independent readers" | , | ||
| "" | [events][concurrency] ) |
Definition at line 1178 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Fragment offset mismatches expose discontinuities to the consumer" | , | ||
| "" | [events][fragmentation] ) |
Definition at line 704 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Late event reader starts at oldest retained event and detects deleted flow" | , | ||
| "" | [events] ) |
Definition at line 943 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Opening an event initializes every metadata field" | , | ||
| "" | [events] ) |
Definition at line 425 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Repeated event writer acquisition shares publication state" | , | ||
| "" | [events] ) |
Definition at line 965 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Two event fragments preserve continuity and reassemble across ring wrap" | , | ||
| "" | [events][fragmentation] ) |
Definition at line 656 of file test_events.cpp.
| TEST_CASE_METHOD | ( | EventFixture | , |
| "Unfragmented events have zero offset and are complete" | , | ||
| "" | [events][fragmentation] ) |
Definition at line 639 of file test_events.cpp.