Merge pull request #4380 from ctiller/window_updates

Cover ancillary frame error conditions
pull/4438/head
Yang Gao 9 years ago
commit 47d69c634d
  1. 30
      test/core/bad_client/tests/simple_request.c

@ -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;
}

Loading…
Cancel
Save