# Resilience Tests ### NFT-RES-01: API unavailable during login **Summary**: Verify the system returns an error when the upstream API is unreachable. **Traces to**: AC-2 (negative), AC-3 **Category**: External dependency failure **Preconditions**: Loader service is running; mock API is stopped. **Steps**: | Step | Consumer Action | Expected System Response | |------|----------------|------------------------| | 1 | POST /login with valid credentials | HTTP 401, body has `"detail"` field with connection error | **Expected outcome**: HTTP 401 with error message indicating API unreachable --- ### NFT-RES-02: CDN unavailable during resource download **Summary**: Verify the system returns an error when CDN is unreachable and no local cache exists. **Traces to**: AC-4 (negative) **Category**: External dependency failure **Preconditions**: Logged in; mock CDN is stopped; no local `.big` file cached. **Steps**: | Step | Consumer Action | Expected System Response | |------|----------------|------------------------| | 1 | POST /load/testmodel | HTTP 500, body has `"detail"` field | **Expected outcome**: HTTP 500 indicating CDN download failure --- ### NFT-RES-03: Docker daemon unavailable during unlock **Summary**: Verify unlock reports error when Docker daemon is not accessible. **Traces to**: AC-9 (negative) **Category**: External dependency failure **Preconditions**: Docker socket not mounted / daemon stopped; encrypted archive exists. **Steps**: | Step | Consumer Action | Expected System Response | |------|----------------|------------------------| | 1 | POST /unlock with valid credentials | HTTP 200 (background task starts) | | 2 | Poll GET /unlock/status | State transitions to "error", error field describes Docker failure | **Expected outcome**: unlock_state = "error" with CalledProcessError detail