Skip to content
Snippets Groups Projects
Commit 51a9de43 authored by Craig Tiller's avatar Craig Tiller
Browse files

Cover ancillary frame error conditions

parent f9263bcf
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,14 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq) {
cq_verifier_destroy(cqv);
}
static void failure_verifier(grpc_server *server, grpc_completion_queue *cq) {
while (grpc_server_has_open_connections(server)) {
GPR_ASSERT(grpc_completion_queue_next(cq,
GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20),
NULL).type == GRPC_QUEUE_TIMEOUT);
}
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
......@@ -115,6 +123,28 @@ int main(int argc, char **argv) {
/* push a data frame with bad flags */
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x00\x00\x02\x00\x00\x00\x01", 0);
/* push a window update with a bad length */
GRPC_RUN_BAD_CLIENT_TEST(failure_verifier,
PFX_STR "\x00\x00\x01\x08\x00\x00\x00\x00\x01", 0);
/* push a window update with bad flags */
GRPC_RUN_BAD_CLIENT_TEST(failure_verifier,
PFX_STR "\x00\x00\x00\x08\x10\x00\x00\x00\x01", 0);
/* push a window update with bad data */
GRPC_RUN_BAD_CLIENT_TEST(failure_verifier,
PFX_STR "\x00\x00\x04\x08\x00\x00\x00\x00\x01" "\xff\xff\xff\xff", 0);
/* push a short goaway */
GRPC_RUN_BAD_CLIENT_TEST(failure_verifier,
PFX_STR "\x00\x00\x04\x07\x00\x00\x00\x00\x00", 0);
/* disconnect before sending goaway */
GRPC_RUN_BAD_CLIENT_TEST(failure_verifier,
PFX_STR "\x00\x01\x12\x07\x00\x00\x00\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
/* push a rst_stream with a bad length */
GRPC_RUN_BAD_CLIENT_TEST(failure_verifier,
PFX_STR "\x00\x00\x01\x03\x00\x00\x00\x00\x01", 0);
/* push a rst_stream with bad flags */
GRPC_RUN_BAD_CLIENT_TEST(failure_verifier,
PFX_STR "\x00\x00\x00\x03\x10\x00\x00\x00\x01", 0);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment