Skip to content

Commit

Permalink
test-gvfs-protocol: add cache_http_503 to mayhem
Browse files Browse the repository at this point in the history
Create new `cache_http_503` mayhem method where only the cache server
sends a 503.  The normal `http_503` directs both cache and origin
server to send 503s.  This will be used to help test fallback.

Signed-off-by: Jeff Hostetler <[email protected]>
  • Loading branch information
jeffhostetler authored and dscho committed Dec 18, 2024
1 parent 20fad5c commit d17fd04
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions t/helper/test-gvfs-protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,14 @@ static enum worker_result dispatch(struct req *req)
const char *method;
enum worker_result wr;

if (strstr(req->uri_base.buf, MY_SERVER_TYPE__CACHE)) {
if (string_list_has_string(&mayhem_list, "cache_http_503")) {
logmayhem("cache_http_503");
return send_http_error(1, 503, "Service Unavailable", 2,
WR_MAYHEM | WR_HANGUP);
}
}

if (string_list_has_string(&mayhem_list, "close_no_write")) {
logmayhem("close_no_write");
return WR_MAYHEM | WR_HANGUP;
Expand Down

0 comments on commit d17fd04

Please sign in to comment.