feat(e2e): add debug/tcplogger E2E scenario kinds using debugclient
Adds a trimmed debug_e2e.cfg (DebugService on 8080/8081, TcpLogger on
9090) and two new scenarios (s55_debug_force_trace_break, kind=debug;
s56_tcplogger_delivery, kind=tcplogger) reusing it, with matching
run_e2e.sh scenario-list/dispatch wiring and debugclient build steps.
Also fixes a real bug found while wiring s56: debugclient's tcplogger
check was tautological (it matched MarteController's own local
"CMD"-level echo of the outgoing command, which contains the same text
as the triggered event, instead of a line actually delivered over the
real TCPLogger TCP socket) and its trigger command (an invalid FORCE)
never reaches DebugServiceBase's REPORT_ERROR at all. Switched the
trigger to a MSG-to-missing-destination command (which does call
REPORT_ERROR) and the match to require the real log text
("not found in ORD"), recorded only after a connect-settle baseline —
verified with a positive run (real Warning-level TCPLogger line
received) and a negative control (LogPort=0 disables TcpLogger and the
scenario correctly FAILs).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,8 @@ export LD_LIBRARY_PATH="\
|
||||
${BUILD_DIR}/Components/DataSources/UDPStreamer:\
|
||||
${BUILD_DIR}/Components/DataSources/UDPStreamerClient:\
|
||||
${BUILD_DIR}/Components/Interfaces/UDPStream:\
|
||||
${BUILD_DIR}/Components/Interfaces/DebugService:\
|
||||
${BUILD_DIR}/Components/Interfaces/TCPLogger:\
|
||||
${MARTe2_DIR}/Build/${TARGET}/Core:\
|
||||
${COMP}/DataSources/LinuxTimer:\
|
||||
${COMP}/DataSources/FileDataSource:\
|
||||
@@ -56,6 +58,7 @@ ${LD_LIBRARY_PATH:-}"
|
||||
MARTE_APP="${MARTe2_DIR}/Build/${TARGET}/App/MARTeApp.ex"
|
||||
STREAMHUB_EX="${BUILD_DIR}/StreamHub/StreamHub.ex"
|
||||
CLIENT="${SCRIPT_DIR}/client/chain-client"
|
||||
DEBUGCLIENT="${SCRIPT_DIR}/debugclient/debugclient"
|
||||
|
||||
PY="python3"
|
||||
SCEN() { ${PY} "${SCRIPT_DIR}/scenarios.py" >/dev/null 2>&1; }
|
||||
@@ -84,13 +87,18 @@ if [ ! -x "${CLIENT}" ]; then
|
||||
echo "── Building chain-client ──"
|
||||
(cd "${SCRIPT_DIR}/client" && go build -o chain-client .) || { echo "client build failed"; exit 1; }
|
||||
fi
|
||||
if [ ! -x "${DEBUGCLIENT}" ]; then
|
||||
echo "── Building debugclient ──"
|
||||
(cd "${SCRIPT_DIR}/debugclient" && go build -o debugclient .) || { echo "debugclient build failed"; exit 1; }
|
||||
fi
|
||||
[ -x "${MARTE_APP}" ] || { echo "ERROR: MARTeApp.ex not found at ${MARTE_APP}" >&2; exit 1; }
|
||||
[ -x "${STREAMHUB_EX}" ] || { echo "ERROR: StreamHub.ex not found" >&2; exit 1; }
|
||||
|
||||
# ── Scenario list (kind|id|f2|f3|f4|f5|f6|f7) ────────────────────────────────
|
||||
# chain: kind|id|ws_port|udp_port0|network|oracle|trig|checks
|
||||
# direct: kind|id|cfg|-|-|-|-|-
|
||||
# recorder: kind|id|marte_cfg|hub_cfg|-|-|-|-
|
||||
# chain: kind|id|ws_port|udp_port0|network|oracle|trig|checks
|
||||
# direct: kind|id|cfg|-|-|-|-|-
|
||||
# recorder: kind|id|marte_cfg|hub_cfg|-|-|-|-
|
||||
# debug/tcplogger: kind|id|cfg|cmd_port|udp_port|log_port|-|-
|
||||
LIST="$(${PY} - "${ONLY}" <<'PY'
|
||||
import sys, os
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath("Test/E2E/suite/scenarios.py")))
|
||||
@@ -112,6 +120,10 @@ for s in S.SCENARIOS:
|
||||
print("|".join([kind, s["id"], s["cfg"], "", "", "", "", ""]))
|
||||
elif kind == "recorder":
|
||||
print("|".join([kind, s["id"], s["marte_cfg"], s["hub_cfg"], "", "", "", ""]))
|
||||
elif kind == "debug":
|
||||
print("|".join([kind, s["id"], s["cfg"], str(s["cmd_port"]), str(s["udp_port"]), str(s["log_port"]), "", ""]))
|
||||
elif kind == "tcplogger":
|
||||
print("|".join([kind, s["id"], s["cfg"], str(s["cmd_port"]), str(s["udp_port"]), str(s["log_port"]), "", ""]))
|
||||
PY
|
||||
)"
|
||||
|
||||
@@ -286,6 +298,28 @@ sys.exit(0 if ok else 1)
|
||||
fi
|
||||
;;
|
||||
|
||||
debug|tcplogger)
|
||||
CFG="${F2}"; CMDPORT="${F3}"; UDPPORT2="${F4}"; LOGPORT="${F5}"
|
||||
echo ""
|
||||
echo "══ scenario ${ID} (kind=${KIND} cfg=${CFG}) ══"
|
||||
timeout 15 "${MARTE_APP}" -l RealTimeLoader -f "${REPO_ROOT}/${CFG}" -s Running \
|
||||
> "${OUT_DIR}/marte_${ID}.log" 2>&1 &
|
||||
APP_PID=$!
|
||||
sleep 1
|
||||
"${DEBUGCLIENT}" -host 127.0.0.1 \
|
||||
-cmdport "${CMDPORT}" -udpport "${UDPPORT2}" -logport "${LOGPORT}" \
|
||||
-mode "${KIND}" -scenario "${ID}" -out "${WORK}" -dur 4s \
|
||||
> "${OUT_DIR}/client_${ID}.log" 2>&1
|
||||
CLIENT_RC=$?
|
||||
kill "${APP_PID}" 2>/dev/null; wait "${APP_PID}" 2>/dev/null; APP_PID=""
|
||||
if [ "${CLIENT_RC}" -eq 0 ]; then
|
||||
echo "PASS" > "${WORK}/status_${ID}.txt"
|
||||
else
|
||||
echo "FAIL" > "${WORK}/status_${ID}.txt"
|
||||
fi
|
||||
echo "${ID}: $(cat "${WORK}/status_${ID}.txt")"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo " SKIP: unknown scenario kind '${KIND}' for ${ID}"
|
||||
echo "SKIP" > "${WORK}/status_${ID}.txt"
|
||||
@@ -375,6 +409,7 @@ if [ "${CPP_COV}" -eq 1 ]; then
|
||||
make -C "${REPO_ROOT}" -f Makefile.gcc clean >/dev/null 2>&1 || true
|
||||
make -C "${REPO_ROOT}" -f Makefile.gcc core apps TARGET="${TARGET}" 2>&1 | tail -1
|
||||
(cd "${SCRIPT_DIR}/client" && go build -o chain-client . >/dev/null 2>&1) || true
|
||||
(cd "${SCRIPT_DIR}/debugclient" && go build -o debugclient . >/dev/null 2>&1) || true
|
||||
fi
|
||||
|
||||
# ── Consolidated report data (+ history/regression + trend plots) ────────────
|
||||
|
||||
Reference in New Issue
Block a user