docs(M00): 接入V5基线与本地MQTT核验
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
required_ports=(1883 8883 8083 8084 18083)
|
||||
|
||||
echo "INFO: checking WSL local MQTT baseline"
|
||||
|
||||
if dpkg-query -W emqx >/dev/null 2>&1; then
|
||||
emqx_version="$(dpkg-query -W -f='${Version}' emqx)"
|
||||
if [ "$emqx_version" = "5.8.9" ]; then
|
||||
echo "PASS: emqx package version ${emqx_version}"
|
||||
else
|
||||
echo "WARN: emqx package version ${emqx_version}, expected 5.8.9"
|
||||
fi
|
||||
else
|
||||
echo "FAIL: emqx package not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
systemctl is-active --quiet emqx && echo "PASS: emqx service active" || {
|
||||
echo "FAIL: emqx service is not active"
|
||||
exit 1
|
||||
}
|
||||
|
||||
systemctl is-enabled --quiet emqx && echo "PASS: emqx service enabled" || {
|
||||
echo "FAIL: emqx service is not enabled"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$(command -v mqttx 2>/dev/null)" = "/usr/local/bin/mqttx" ]; then
|
||||
echo "PASS: mqttx path /usr/local/bin/mqttx"
|
||||
else
|
||||
echo "FAIL: mqttx path mismatch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mqttx_version="$(mqttx --version 2>/dev/null | head -1)"
|
||||
if [ "$mqttx_version" = "1.13.0" ]; then
|
||||
echo "PASS: mqttx version ${mqttx_version}"
|
||||
else
|
||||
echo "WARN: mqttx version ${mqttx_version}, expected 1.13.0"
|
||||
fi
|
||||
|
||||
for port in "${required_ports[@]}"; do
|
||||
if ss -ltn "sport = :${port}" 2>/dev/null | grep -q ":${port}"; then
|
||||
echo "PASS: port ${port} listening"
|
||||
else
|
||||
echo "FAIL: port ${port} not listening"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "INFO: service-level check only; auth, ACL, TLS, will-message and idempotency tests are not covered here."
|
||||
Reference in New Issue
Block a user