Skip to content

Commit 07e0f90

Browse files
jeffhostetlerdscho
authored andcommitted
test-gvfs-protocol: add cache_http_503 to mayhem
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 <jeffhostetler@github.com>
1 parent c70e49f commit 07e0f90

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: t/helper/test-gvfs-protocol.c

+8
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,14 @@ static enum worker_result dispatch(struct req *req)
15811581
const char *method;
15821582
enum worker_result wr;
15831583

1584+
if (strstr(req->uri_base.buf, MY_SERVER_TYPE__CACHE)) {
1585+
if (string_list_has_string(&mayhem_list, "cache_http_503")) {
1586+
logmayhem("cache_http_503");
1587+
return send_http_error(1, 503, "Service Unavailable", 2,
1588+
WR_MAYHEM | WR_HANGUP);
1589+
}
1590+
}
1591+
15841592
if (string_list_has_string(&mayhem_list, "close_no_write")) {
15851593
logmayhem("close_no_write");
15861594
return WR_MAYHEM | WR_HANGUP;

0 commit comments

Comments
 (0)