mirror of
https://github.com/jmagar/unraid-mcp.git
synced 2026-03-23 12:39:24 -07:00
fix: flash_backup validation, smoke test assertions, docker/notification test coverage
- storage.py: validate initiateFlashBackup response before returning success=True - test-tools.sh: remove set -e/inherit_errexit; add success assertion to smoke tests - test_destructive_guards.py: add confirm-guard tests for new docker destructive actions - test_docker.py: assert mutation variables in organizer tests; add items branch test - test_query_validation.py: add 5 missing notification mutation schema test methods - test_notifications.py: use lowercase importance to test uppercasing logic Resolves review threads PRRT_kwDOO6Hdxs50FgPb PRRT_kwDOO6Hdxs50FgO4 PRRT_kwDOO6Hdxs50FgO8 PRRT_kwDOO6Hdxs50FgPI PRRT_kwDOO6Hdxs50FgPL PRRT_kwDOO6Hdxs50FgPm PRRT_kwDOO6Hdxs50E2iK PRRT_kwDOO6Hdxs50E2im
This commit is contained in:
@@ -20,8 +20,7 @@
|
||||
# 2 — prerequisite check failed (mcporter, uv, server startup)
|
||||
# =============================================================================
|
||||
|
||||
set -Eeuo pipefail
|
||||
shopt -s inherit_errexit
|
||||
set -uo pipefail
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Constants
|
||||
@@ -178,6 +177,29 @@ smoke_test_server() {
|
||||
return 2
|
||||
fi
|
||||
|
||||
# Assert the response contains a valid tool response field, not a bare JSON error.
|
||||
# unraid_health action=check always returns {"status": ...} on success.
|
||||
local key_check
|
||||
key_check="$(
|
||||
printf '%s' "${output}" | python3 -c "
|
||||
import sys, json
|
||||
try:
|
||||
d = json.load(sys.stdin)
|
||||
if 'status' in d or 'success' in d or 'error' in d:
|
||||
print('ok')
|
||||
else:
|
||||
print('missing: no status/success/error key in response')
|
||||
except Exception as e:
|
||||
print('parse_error: ' + str(e))
|
||||
" 2>/dev/null
|
||||
)" || key_check="parse_error"
|
||||
|
||||
if [[ "${key_check}" != "ok" ]]; then
|
||||
log_error "Smoke test: unexpected response shape — ${key_check}"
|
||||
printf '%s\n' "${output}" >&2
|
||||
return 2
|
||||
fi
|
||||
|
||||
log_info "Server started successfully (health response received)."
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user