test(suites): run acceptance and fault flows on dummy backend

This commit is contained in:
2026-03-06 08:50:32 +08:00
parent 3e1ee23e42
commit eed6695758
5 changed files with 58 additions and 73 deletions
+10 -7
View File
@@ -40,7 +40,7 @@ cmake --build build
**Verify binaries exist:** **Verify binaries exist:**
```bash ```bash
ls -la build/{cvmmap_sim,cvmmap_streamer,rtp_receiver_tester,rtmp_stub_tester} ls -la build/{cvmmap_streamer,rtp_receiver_tester,rtmp_stub_tester}
``` ```
### Mandatory Acceptance (Standalone) ### Mandatory Acceptance (Standalone)
@@ -79,14 +79,17 @@ Run the fault injection and latency validation suite.
**1. Start the simulator:** **1. Start the simulator:**
```bash ```bash
./build/cvmmap_sim \ ./build/cvmmap_streamer \
--run-mode pipeline \
--codec h264 \
--shm-name test_stream \ --shm-name test_stream \
--zmq-endpoint "ipc:///tmp/test_sync.ipc" \ --zmq-endpoint "ipc:///tmp/test_sync.ipc" \
--label teststream \ --input-mode dummy \
--frames 300 \ --dummy-label teststream \
--fps 30 \ --dummy-frames 300 \
--width 640 \ --dummy-fps 30 \
--height 360 --dummy-width 640 \
--dummy-height 360
``` ```
**2. Test RTP output:** **2. Test RTP output:**
+12 -9
View File
@@ -21,10 +21,10 @@ The cv-mmap simulator uses POSIX shared memory naming that imposes a 24-byte max
Use compact deterministic labels: Use compact deterministic labels:
```bash ```bash
# Good (19 bytes) # Good (19 bytes)
./build/cvmmap_sim --label acc_1_rtp_h264 ... ./build/cvmmap_streamer --run-mode pipeline --input-mode dummy --dummy-label acc_1_rtp_h264 ...
# Bad (28 bytes, will fail) # Bad (28 bytes, will fail)
./build/cvmmap_sim --label acceptance_rtp_h264_test ... ./build/cvmmap_streamer --run-mode pipeline --input-mode dummy --dummy-label acceptance_rtp_h264_test ...
``` ```
### Deterministic Simulator Sizing ### Deterministic Simulator Sizing
@@ -37,11 +37,14 @@ Small frame sizes can trigger GStreamer caps negotiation failures before the fir
**Recommended simulator parameters for validation:** **Recommended simulator parameters for validation:**
```bash ```bash
./build/cvmmap_sim \ ./build/cvmmap_streamer \
--width 640 \ --run-mode pipeline \
--height 360 \ --input-mode dummy \
--fps 200 \ --dummy-label acc_1_rtp_h264 \
--frames 320 --dummy-width 640 \
--dummy-height 360 \
--dummy-fps 200 \
--dummy-frames 320
``` ```
### Build Path Isolation ### Build Path Isolation
@@ -266,7 +269,7 @@ cat .sisyphus/evidence/task-14-acceptance/RUN_ID/1-rtp_h264/streamer.log
Before running scripts, verify all binaries are built: Before running scripts, verify all binaries are built:
```bash ```bash
for bin in cvmmap_sim cvmmap_streamer rtp_receiver_tester rtmp_stub_tester; do for bin in cvmmap_streamer rtp_receiver_tester rtmp_stub_tester; do
test -x "build/$bin" || echo "Missing: $bin" test -x "build/$bin" || echo "Missing: $bin"
done done
``` ```
@@ -275,7 +278,7 @@ done
```bash ```bash
# Test simulator only # Test simulator only
./build/cvmmap_sim --help ./build/cvmmap_streamer --run-mode pipeline --help
# Test streamer config validation only # Test streamer config validation only
./build/cvmmap_streamer --codec h264 --shm-name test --zmq-endpoint ipc:///tmp/test.ipc ./build/cvmmap_streamer --codec h264 --shm-name test --zmq-endpoint ipc:///tmp/test.ipc
+9 -7
View File
@@ -134,15 +134,17 @@ echo "Exit code: $?"
--packet-threshold 1 \ --packet-threshold 1 \
--timeout-ms 10000 --timeout-ms 10000
# Terminal 2: Simulator + Streamer # Terminal 2: Streamer in dummy input mode
./build/cvmmap_sim \ ./build/cvmmap_streamer \
--run-mode pipeline \
--input-mode dummy \
--shm-name test_rtp_h264 \ --shm-name test_rtp_h264 \
--zmq-endpoint "ipc:///tmp/test_rtp_h264.ipc" \ --zmq-endpoint "ipc:///tmp/test_rtp_h264.ipc" \
--label rtp_h264 \ --dummy-label rtp_h264 \
--frames 320 \ --dummy-frames 320 \
--fps 200 \ --dummy-fps 200 \
--width 640 \ --dummy-width 640 \
--height 360 & --dummy-height 360 &
./build/cvmmap_streamer \ ./build/cvmmap_streamer \
--run-mode pipeline \ --run-mode pipeline \
+10 -21
View File
@@ -126,23 +126,19 @@ run_matrix_row() {
local sim_label="acc_${order}_${protocol}_${codec}" local sim_label="acc_${order}_${protocol}_${codec}"
local sim_cmd=(
"${BUILD_DIR}/cvmmap_sim"
--shm-name "${shm_name}"
--zmq-endpoint "${zmq_endpoint}"
--label "${sim_label}"
--frames 320
--fps 200
--width 640
--height 360
)
local streamer_cmd=( local streamer_cmd=(
"${BUILD_DIR}/cvmmap_streamer" "${BUILD_DIR}/cvmmap_streamer"
--run-mode pipeline --run-mode pipeline
--codec "${codec}" --codec "${codec}"
--shm-name "${shm_name}" --shm-name "${shm_name}"
--zmq-endpoint "${zmq_endpoint}" --zmq-endpoint "${zmq_endpoint}"
--input-mode dummy
--dummy-label "${sim_label}"
--dummy-frames 320
--dummy-fps 200
--dummy-width 640
--dummy-height 360
--dummy-startup-delay-ms 0
--queue-size 1 --queue-size 1
--gop 30 --gop 30
--b-frames 0 --b-frames 0
@@ -220,12 +216,7 @@ run_matrix_row() {
cleanup_pids+=("${tester_pid}") cleanup_pids+=("${tester_pid}")
sleep 1 sleep 1
: > "${sim_log}"
"${sim_cmd[@]}" > "${sim_log}" 2>&1 &
local sim_pid=$!
cleanup_pids+=("${sim_pid}")
sleep 1
"${streamer_cmd[@]}" > "${streamer_log}" 2>&1 "${streamer_cmd[@]}" > "${streamer_log}" 2>&1
local streamer_rc=$? local streamer_rc=$?
@@ -233,8 +224,7 @@ run_matrix_row() {
wait_pid "${tester_pid}" 15 wait_pid "${tester_pid}" 15
local tester_rc=$? local tester_rc=$?
wait_pid "${sim_pid}" 15 local sim_rc=0
local sim_rc=$?
row_end_ms="$(date +%s%3N)" row_end_ms="$(date +%s%3N)"
duration_ms=$((row_end_ms - row_start_ms)) duration_ms=$((row_end_ms - row_start_ms))
@@ -269,8 +259,7 @@ run_matrix_row() {
} }
main() { main() {
local required=( local required=(
"${BUILD_DIR}/cvmmap_sim"
"${BUILD_DIR}/cvmmap_streamer" "${BUILD_DIR}/cvmmap_streamer"
"${BUILD_DIR}/rtp_receiver_tester" "${BUILD_DIR}/rtp_receiver_tester"
"${BUILD_DIR}/rtmp_stub_tester" "${BUILD_DIR}/rtmp_stub_tester"
+12 -24
View File
@@ -205,26 +205,19 @@ run_fault_scenario() {
local rtp_port local rtp_port
rtp_port="$(scenario_port "${order}")" rtp_port="$(scenario_port "${order}")"
local sim_cmd=(
"${BUILD_DIR}/cvmmap_sim"
--shm-name "${shm_name}"
--zmq-endpoint "${zmq_endpoint}"
--label "${sim_label}"
--frames "${sim_frames}"
--fps "${sim_fps}"
--width 640
--height 360
)
if [[ -n "${reset_every}" ]]; then
sim_cmd+=(--emit-reset-every "${reset_every}")
fi
local streamer_cmd=( local streamer_cmd=(
"${BUILD_DIR}/cvmmap_streamer" "${BUILD_DIR}/cvmmap_streamer"
--run-mode pipeline --run-mode pipeline
--codec h264 --codec h264
--shm-name "${shm_name}" --shm-name "${shm_name}"
--zmq-endpoint "${zmq_endpoint}" --zmq-endpoint "${zmq_endpoint}"
--input-mode dummy
--dummy-label "${sim_label}"
--dummy-frames "${sim_frames}"
--dummy-fps "${sim_fps}"
--dummy-width 640
--dummy-height 360
--dummy-startup-delay-ms 0
--queue-size 1 --queue-size 1
--gop 30 --gop 30
--b-frames 0 --b-frames 0
@@ -237,6 +230,9 @@ run_fault_scenario() {
--rtp-payload-type 96 --rtp-payload-type 96
--rtp-sdp "${sdp_path}" --rtp-sdp "${sdp_path}"
) )
if [[ -n "${reset_every}" ]]; then
streamer_cmd+=(--dummy-reset-every "${reset_every}")
fi
local tester_cmd=( local tester_cmd=(
"${BUILD_DIR}/rtp_receiver_tester" "${BUILD_DIR}/rtp_receiver_tester"
@@ -254,21 +250,14 @@ run_fault_scenario() {
cleanup_pids+=("${tester_pid}") cleanup_pids+=("${tester_pid}")
sleep 1 sleep 1
: > "${sim_log}"
"${sim_cmd[@]}" > "${sim_log}" 2>&1 &
local sim_pid=$!
cleanup_pids+=("${sim_pid}")
sleep 1
"${streamer_cmd[@]}" > "${streamer_log}" 2>&1 "${streamer_cmd[@]}" > "${streamer_log}" 2>&1
local streamer_rc=$? local streamer_rc=$?
wait_pid "${tester_pid}" 25 wait_pid "${tester_pid}" 25
local tester_rc=$? local tester_rc=$?
local sim_rc=0
wait_pid "${sim_pid}" 25
local sim_rc=$?
row_end_ms="$(date +%s%3N)" row_end_ms="$(date +%s%3N)"
duration_ms=$((row_end_ms - row_start_ms)) duration_ms=$((row_end_ms - row_start_ms))
@@ -300,7 +289,6 @@ run_fault_scenario() {
main() { main() {
local required=( local required=(
"${BUILD_DIR}/cvmmap_sim"
"${BUILD_DIR}/cvmmap_streamer" "${BUILD_DIR}/cvmmap_streamer"
"${BUILD_DIR}/rtp_receiver_tester" "${BUILD_DIR}/rtp_receiver_tester"
) )