Merge github.com:grpc/grpc into strong-includes

pull/6092/head
Craig Tiller 9 years ago
commit 5db5e13293
  1. 164
      Makefile
  2. 53
      build.yaml
  3. 20
      src/core/ext/transport/chttp2/transport/chttp2_transport.c
  4. 6
      src/core/ext/transport/chttp2/transport/parsing.c
  5. 31
      src/core/lib/surface/call.c
  6. 8
      src/core/lib/surface/server.c
  7. 6
      src/core/lib/transport/metadata.c
  8. 2
      src/core/lib/transport/transport.h
  9. 6
      src/node/stress/stress_client.js
  10. 25
      src/proto/grpc/testing/control.proto
  11. 14
      templates/test/core/end2end/end2end_defs.include
  12. 40
      templates/tools/dockerfile/stress_test/grpc_interop_stress_cxx/Dockerfile.template
  13. 11
      templates/tools/dockerfile/stress_test/grpc_interop_stress_node/Dockerfile.template
  14. 2
      templates/tools/fuzzer/runners.template
  15. 3
      test/core/bad_client/bad_client.c
  16. 90
      test/core/end2end/end2end_nosec_tests.c
  17. 92
      test/core/end2end/end2end_tests.c
  18. 1
      test/core/end2end/end2end_tests.h
  19. 1
      test/core/end2end/fixtures/h2_census.c
  20. 1
      test/core/end2end/fixtures/h2_compress.c
  21. 2
      test/core/end2end/fixtures/h2_fakesec.c
  22. 1
      test/core/end2end/fixtures/h2_full+pipe.c
  23. 1
      test/core/end2end/fixtures/h2_full+trace.c
  24. 1
      test/core/end2end/fixtures/h2_full.c
  25. 2
      test/core/end2end/fixtures/h2_oauth2.c
  26. 1
      test/core/end2end/fixtures/h2_proxy.c
  27. 1
      test/core/end2end/fixtures/h2_sockpair+trace.c
  28. 1
      test/core/end2end/fixtures/h2_sockpair.c
  29. 1
      test/core/end2end/fixtures/h2_sockpair_1byte.c
  30. 1
      test/core/end2end/fixtures/h2_ssl.c
  31. 1
      test/core/end2end/fixtures/h2_ssl_proxy.c
  32. 1
      test/core/end2end/fixtures/h2_uds.c
  33. 121
      test/core/end2end/fuzzers/server_fuzzer.c
  34. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/01c008fa.bin
  35. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/021ec59f.bin
  36. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/02918e4ad9e8928845f232c0cb043057add3c9a9
  37. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0336e1ff71939de9e2007fdb4aba891e35a37488
  38. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/033dd2f6.bin
  39. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0384345c.bin
  40. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/03b9be1fa172dff5d1543be079b9c64fa2c9a278
  41. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/05c3a0390d0f52d241728926fa901599a47e4606
  42. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/06bd2f82fefb9943787d63ea359f9b77072380c2
  43. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0766afc7c27c06ea18d896083470d587a380de3c
  44. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/07c96c06eddbed5a3ce050436bc805f6821cbc9b
  45. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/081e56ce6f6b1c57adb806fbc5baa9f93f87513a
  46. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/08492d3d0994005206d1d3213b8747d1026ae1eb
  47. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/09938e3256d06a8e168eb038d8a58b8462f7f697
  48. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0aa599e20761777c2cb9b41cd89e5c2e18f82d9e
  49. 1
      test/core/end2end/fuzzers/server_fuzzer_corpus/0aa7b949.bin
  50. 2
      test/core/end2end/fuzzers/server_fuzzer_corpus/0abd533e.bin
  51. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0b275a7f.bin
  52. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0d10bb63.bin
  53. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0e349b8762703d080b3a696600e21d64c23a2ed3
  54. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0f700e05.bin
  55. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/0ff4d220.bin
  56. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/10724098.bin
  57. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/108e270a272e312fc97ec23004b80fdc7bad3906
  58. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/11516d58.bin
  59. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/11cda3f70be4b507ea936bca93af9ce5aaab3be7
  60. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/13501419f349b7855d2e94060bd08b28923d1f37
  61. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/146b7d66ad932c4b623eec8004e286d3705697d3
  62. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/14f9a0cda0d64590430218aaf6dedd9be2a3533f
  63. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/15ae78a8543a4794a27e6c79b0d34540322b97fd
  64. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1650b19093c56a1e86ee192bd9cd8d2266a9e353
  65. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/16753235697083ecc45c117287f1d8ce6ad1ad1a
  66. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/17d7c718ec2597353a5dd2c78d6717a3d6aabfae
  67. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/18d8d274aa7c163fd6d0084d5c25c8623e10c541
  68. 1
      test/core/end2end/fuzzers/server_fuzzer_corpus/18f00b5f.bin
  69. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1939a9021aba59ea2e49d3d0909e6fdf86ac3f9e
  70. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1a69d5fc.bin
  71. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1aa6897b6eebb8c68c972cc5025b39c7e60c17fe
  72. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1cf17783de9e662f3720847f2d83d86dcdcab500
  73. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1cfdde7a.bin
  74. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1e92aaa5.bin
  75. 1
      test/core/end2end/fuzzers/server_fuzzer_corpus/1ea5651f.bin
  76. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/1f992057.bin
  77. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/20fd12d3670571283dc0c5dbb3fc139a8e943790
  78. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/21475569.bin
  79. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/218c1b123428a07622570947e9b7cdb48c310ca5
  80. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/21a2dcda.bin
  81. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/22ad891a.bin
  82. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2463aea879c5ab49f8409d0e5c062c7e086b034b
  83. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/24ed80095e58199c52997f174046272f61ce4a8d
  84. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/25ab638f.bin
  85. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/26048c58bd5f2a94843f6fd1e4ab0be04b232636
  86. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/26870785fd0564f552af4e0ca418738a85b21086
  87. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2701d1669c2996c097a74c5255d569615357b916
  88. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/27ac2ae2.bin
  89. 1
      test/core/end2end/fuzzers/server_fuzzer_corpus/2814d70c.bin
  90. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/282b6585.bin
  91. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2abe64b96e5e72adcf2dcc43444a69d0fb664b66
  92. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2ad6cedd32cd646ba8e25226c7c13a107c1d6447
  93. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2b14c6e618ec95754ea7e24fe6bc5a3a97df6897
  94. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2b40aa21723c7e67e92e74a3083df008461d591c
  95. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2bf69fe6b40734cc3f0abdd765757809b14b0b88
  96. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2c6660ba.bin
  97. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2cc6d1f3ee8933518e91b8410781fa6e105b3a15
  98. 3
      test/core/end2end/fuzzers/server_fuzzer_corpus/2e4805c3.bin
  99. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2f20e2decd09b6f211a5469c67efbada355e6c04
  100. BIN
      test/core/end2end/fuzzers/server_fuzzer_corpus/2f3b1cd6780fe475f76f17e9e36541963d993165
  101. Some files were not shown because too many files have changed in this diff Show More

@ -968,6 +968,7 @@ resolve_address_test: $(BINDIR)/$(CONFIG)/resolve_address_test
secure_channel_create_test: $(BINDIR)/$(CONFIG)/secure_channel_create_test
secure_endpoint_test: $(BINDIR)/$(CONFIG)/secure_endpoint_test
server_chttp2_test: $(BINDIR)/$(CONFIG)/server_chttp2_test
server_fuzzer: $(BINDIR)/$(CONFIG)/server_fuzzer
server_test: $(BINDIR)/$(CONFIG)/server_test
set_initial_connect_string_test: $(BINDIR)/$(CONFIG)/set_initial_connect_string_test
sockaddr_resolver_test: $(BINDIR)/$(CONFIG)/sockaddr_resolver_test
@ -1017,10 +1018,12 @@ hybrid_end2end_test: $(BINDIR)/$(CONFIG)/hybrid_end2end_test
interop_client: $(BINDIR)/$(CONFIG)/interop_client
interop_server: $(BINDIR)/$(CONFIG)/interop_server
interop_test: $(BINDIR)/$(CONFIG)/interop_test
json_run_localhost: $(BINDIR)/$(CONFIG)/json_run_localhost
metrics_client: $(BINDIR)/$(CONFIG)/metrics_client
mock_test: $(BINDIR)/$(CONFIG)/mock_test
qps_driver: $(BINDIR)/$(CONFIG)/qps_driver
qps_interarrival_test: $(BINDIR)/$(CONFIG)/qps_interarrival_test
qps_json_driver: $(BINDIR)/$(CONFIG)/qps_json_driver
qps_openloop_test: $(BINDIR)/$(CONFIG)/qps_openloop_test
qps_test: $(BINDIR)/$(CONFIG)/qps_test
qps_worker: $(BINDIR)/$(CONFIG)/qps_worker
@ -1118,6 +1121,7 @@ http_fuzzer_test_one_entry: $(BINDIR)/$(CONFIG)/http_fuzzer_test_one_entry
json_fuzzer_test_one_entry: $(BINDIR)/$(CONFIG)/json_fuzzer_test_one_entry
nanopb_fuzzer_response_test_one_entry: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_response_test_one_entry
nanopb_fuzzer_serverlist_test_one_entry: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_serverlist_test_one_entry
server_fuzzer_one_entry: $(BINDIR)/$(CONFIG)/server_fuzzer_one_entry
uri_fuzzer_test_one_entry: $(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry
run_dep_checks:
@ -1343,6 +1347,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/json_fuzzer_test_one_entry \
$(BINDIR)/$(CONFIG)/nanopb_fuzzer_response_test_one_entry \
$(BINDIR)/$(CONFIG)/nanopb_fuzzer_serverlist_test_one_entry \
$(BINDIR)/$(CONFIG)/server_fuzzer_one_entry \
$(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry \
@ -1371,11 +1376,14 @@ buildtests_cxx: buildtests_zookeeper privatelibs_cxx \
$(BINDIR)/$(CONFIG)/interop_client \
$(BINDIR)/$(CONFIG)/interop_server \
$(BINDIR)/$(CONFIG)/interop_test \
$(BINDIR)/$(CONFIG)/json_run_localhost \
$(BINDIR)/$(CONFIG)/metrics_client \
$(BINDIR)/$(CONFIG)/mock_test \
$(BINDIR)/$(CONFIG)/qps_interarrival_test \
$(BINDIR)/$(CONFIG)/qps_json_driver \
$(BINDIR)/$(CONFIG)/qps_openloop_test \
$(BINDIR)/$(CONFIG)/qps_test \
$(BINDIR)/$(CONFIG)/qps_worker \
$(BINDIR)/$(CONFIG)/reconnect_interop_client \
$(BINDIR)/$(CONFIG)/reconnect_interop_server \
$(BINDIR)/$(CONFIG)/secure_auth_context_test \
@ -1749,7 +1757,7 @@ tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/
tools_cxx: privatelibs_cxx
buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker
buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark $(BINDIR)/$(CONFIG)/qps_driver
benchmarks: buildbenchmarks
@ -2733,6 +2741,7 @@ LIBGRPC_TEST_UTIL_SRC = \
test/core/iomgr/endpoint_tests.c \
test/core/security/oauth2_utils.c \
test/core/util/grpc_profiler.c \
test/core/util/mock_endpoint.c \
test/core/util/parse_hexstring.c \
test/core/util/port_posix.c \
test/core/util/port_server_client.c \
@ -2780,6 +2789,7 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
test/core/end2end/fixtures/proxy.c \
test/core/iomgr/endpoint_tests.c \
test/core/util/grpc_profiler.c \
test/core/util/mock_endpoint.c \
test/core/util/parse_hexstring.c \
test/core/util/port_posix.c \
test/core/util/port_server_client.c \
@ -5860,6 +5870,7 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/tests/default_host.c \
test/core/end2end/tests/disappearing_server.c \
test/core/end2end/tests/empty_batch.c \
test/core/end2end/tests/filter_causes_close.c \
test/core/end2end/tests/graceful_server_shutdown.c \
test/core/end2end/tests/high_initial_seqno.c \
test/core/end2end/tests/hpack_size.c \
@ -5935,6 +5946,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/tests/default_host.c \
test/core/end2end/tests/disappearing_server.c \
test/core/end2end/tests/empty_batch.c \
test/core/end2end/tests/filter_causes_close.c \
test/core/end2end/tests/graceful_server_shutdown.c \
test/core/end2end/tests/high_initial_seqno.c \
test/core/end2end/tests/hpack_size.c \
@ -8897,6 +8909,38 @@ endif
endif
SERVER_FUZZER_SRC = \
test/core/end2end/fuzzers/server_fuzzer.c \
SERVER_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_FUZZER_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/server_fuzzer: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/server_fuzzer: $(SERVER_FUZZER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(SERVER_FUZZER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -lFuzzer -o $(BINDIR)/$(CONFIG)/server_fuzzer
endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/fuzzers/server_fuzzer.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_server_fuzzer: $(SERVER_FUZZER_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(SERVER_FUZZER_OBJS:.o=.dep)
endif
endif
SERVER_TEST_SRC = \
test/core/surface/server_test.c \
@ -10723,6 +10767,49 @@ endif
endif
JSON_RUN_LOCALHOST_SRC = \
test/cpp/qps/json_run_localhost.cc \
JSON_RUN_LOCALHOST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_RUN_LOCALHOST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/json_run_localhost: openssl_dep_error
else
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/json_run_localhost: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/json_run_localhost: $(PROTOBUF_DEP) $(JSON_RUN_LOCALHOST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(JSON_RUN_LOCALHOST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/json_run_localhost
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/qps/json_run_localhost.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_json_run_localhost: $(JSON_RUN_LOCALHOST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(JSON_RUN_LOCALHOST_OBJS:.o=.dep)
endif
endif
METRICS_CLIENT_SRC = \
$(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc \
test/cpp/interop/metrics_client.cc \
@ -10899,6 +10986,49 @@ endif
endif
QPS_JSON_DRIVER_SRC = \
test/cpp/qps/qps_json_driver.cc \
QPS_JSON_DRIVER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(QPS_JSON_DRIVER_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/qps_json_driver: openssl_dep_error
else
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/qps_json_driver: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/qps_json_driver: $(PROTOBUF_DEP) $(QPS_JSON_DRIVER_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(QPS_JSON_DRIVER_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/qps_json_driver
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_json_driver.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_qps_json_driver: $(QPS_JSON_DRIVER_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(QPS_JSON_DRIVER_OBJS:.o=.dep)
endif
endif
QPS_OPENLOOP_TEST_SRC = \
test/cpp/qps/qps_openloop_test.cc \
@ -13830,6 +13960,38 @@ endif
endif
SERVER_FUZZER_ONE_ENTRY_SRC = \
test/core/end2end/fuzzers/server_fuzzer.c \
SERVER_FUZZER_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_FUZZER_ONE_ENTRY_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/server_fuzzer_one_entry: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/server_fuzzer_one_entry: $(SERVER_FUZZER_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(SERVER_FUZZER_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/server_fuzzer_one_entry
endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/fuzzers/server_fuzzer.o: $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_server_fuzzer_one_entry: $(SERVER_FUZZER_ONE_ENTRY_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(SERVER_FUZZER_ONE_ENTRY_OBJS:.o=.dep)
endif
endif
URI_FUZZER_TEST_ONE_ENTRY_SRC = \
test/core/client_config/uri_fuzzer_test.c \

@ -559,6 +559,7 @@ filegroups:
- test/core/end2end/fixtures/proxy.h
- test/core/iomgr/endpoint_tests.h
- test/core/util/grpc_profiler.h
- test/core/util/mock_endpoint.h
- test/core/util/parse_hexstring.h
- test/core/util/port.h
- test/core/util/port_server_client.h
@ -568,6 +569,7 @@ filegroups:
- test/core/end2end/fixtures/proxy.c
- test/core/iomgr/endpoint_tests.c
- test/core/util/grpc_profiler.c
- test/core/util/mock_endpoint.c
- test/core/util/parse_hexstring.c
- test/core/util/port_posix.c
- test/core/util/port_server_client.c
@ -1682,6 +1684,7 @@ targets:
- gpr
corpus_dirs:
- test/core/transport/chttp2/hpack_parser_corpus
maxlen: 512
- name: hpack_parser_test
build: test
language: c
@ -1714,6 +1717,7 @@ targets:
- gpr
corpus_dirs:
- test/core/http/corpus
maxlen: 2048
- name: http_parser_test
build: test
language: c
@ -1827,6 +1831,7 @@ targets:
- gpr
corpus_dirs:
- test/core/json/corpus
maxlen: 512
- name: json_rewrite
build: test
run: false
@ -1953,6 +1958,7 @@ targets:
- gpr
corpus_dirs:
- test/core/nanopb/corpus_response
maxlen: 128
- name: nanopb_fuzzer_serverlist_test
build: fuzzer
language: c
@ -1965,6 +1971,7 @@ targets:
- gpr
corpus_dirs:
- test/core/nanopb/corpus_serverlist
maxlen: 128
- name: no_server_test
cpu_cost: 0.1
build: test
@ -2016,6 +2023,19 @@ targets:
- grpc
- gpr_test_util
- gpr
- name: server_fuzzer
build: fuzzer
language: c
src:
- test/core/end2end/fuzzers/server_fuzzer.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
corpus_dirs:
- test/core/end2end/fuzzers/server_fuzzer_corpus
maxlen: 2048
- name: server_test
build: test
language: c
@ -2226,6 +2246,7 @@ targets:
- gpr
corpus_dirs:
- test/core/client_config/uri_corpus
maxlen: 128
- name: uri_parser_test
build: test
language: c
@ -2631,6 +2652,20 @@ targets:
- mac
- linux
- posix
- name: json_run_localhost
build: test
run: false
language: c++
src:
- test/cpp/qps/json_run_localhost.cc
deps:
- grpc++_test_util
- grpc_test_util
- grpc++
- grpc
- gpr_test_util
- gpr
- grpc++_test_config
- name: metrics_client
build: test
run: false
@ -2690,6 +2725,21 @@ targets:
- mac
- linux
- posix
- name: qps_json_driver
build: test
run: false
language: c++
src:
- test/cpp/qps/qps_json_driver.cc
deps:
- qps
- grpc++_test_util
- grpc_test_util
- grpc++
- grpc
- gpr_test_util
- gpr
- grpc++_test_config
- name: qps_openloop_test
cpu_cost: 0.5
build: test
@ -2729,7 +2779,8 @@ targets:
- linux
- posix
- name: qps_worker
build: benchmark
build: test
run: false
language: c++
headers:
- test/cpp/qps/client.h

@ -1147,16 +1147,18 @@ static void cancel_from_api(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport_global *transport_global,
grpc_chttp2_stream_global *stream_global,
grpc_status_code status) {
if (stream_global->id != 0) {
gpr_slice_buffer_add(
&transport_global->qbuf,
grpc_chttp2_rst_stream_create(
stream_global->id,
(uint32_t)grpc_chttp2_grpc_status_to_http2_error(status),
&stream_global->stats.outgoing));
if (!stream_global->read_closed || !stream_global->write_closed) {
if (stream_global->id != 0) {
gpr_slice_buffer_add(
&transport_global->qbuf,
grpc_chttp2_rst_stream_create(
stream_global->id,
(uint32_t)grpc_chttp2_grpc_status_to_http2_error(status),
&stream_global->stats.outgoing));
}
grpc_chttp2_fake_status(exec_ctx, transport_global, stream_global, status,
NULL);
}
grpc_chttp2_fake_status(exec_ctx, transport_global, stream_global, status,
NULL);
grpc_chttp2_mark_stream_closed(exec_ctx, transport_global, stream_global, 1,
1);
}

@ -112,7 +112,7 @@ void grpc_chttp2_publish_reads(
GOAWAY last-grpc_chttp2_stream-id=0 in this case. */
if (!transport_parsing->is_client) {
transport_global->last_incoming_stream_id =
transport_parsing->incoming_stream_id;
transport_parsing->last_incoming_stream_id;
}
/* update global settings */
@ -371,7 +371,9 @@ int grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
if (!init_frame_parser(exec_ctx, transport_parsing)) {
return 0;
}
if (transport_parsing->incoming_stream_id) {
if (transport_parsing->incoming_stream_id != 0 &&
transport_parsing->incoming_stream_id >
transport_parsing->last_incoming_stream_id) {
transport_parsing->last_incoming_stream_id =
transport_parsing->incoming_stream_id;
}

@ -1074,24 +1074,29 @@ static void receiving_initial_metadata_ready(grpc_exec_ctx *exec_ctx,
gpr_mu_lock(&call->mu);
grpc_metadata_batch *md =
&call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
grpc_metadata_batch_filter(md, recv_initial_filter, call);
call->has_initial_md_been_received = true;
if (gpr_time_cmp(md->deadline, gpr_inf_future(md->deadline.clock_type)) !=
0 &&
!call->is_client) {
GPR_TIMER_BEGIN("set_deadline_alarm", 0);
set_deadline_alarm(exec_ctx, call, md->deadline);
GPR_TIMER_END("set_deadline_alarm", 0);
if (!success) {
bctl->success = false;
} else {
grpc_metadata_batch *md =
&call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
grpc_metadata_batch_filter(md, recv_initial_filter, call);
if (gpr_time_cmp(md->deadline, gpr_inf_future(md->deadline.clock_type)) !=
0 &&
!call->is_client) {
GPR_TIMER_BEGIN("set_deadline_alarm", 0);
set_deadline_alarm(exec_ctx, call, md->deadline);
GPR_TIMER_END("set_deadline_alarm", 0);
}
}
call->has_initial_md_been_received = true;
if (call->saved_receiving_stream_ready_ctx.bctlp != NULL) {
grpc_closure *saved_rsr_closure = grpc_closure_create(
receiving_stream_ready, call->saved_receiving_stream_ready_ctx.bctlp);
grpc_exec_ctx_enqueue(exec_ctx, saved_rsr_closure,
call->saved_receiving_stream_ready_ctx.success, NULL);
grpc_exec_ctx_enqueue(
exec_ctx, saved_rsr_closure,
call->saved_receiving_stream_ready_ctx.success && success, NULL);
call->saved_receiving_stream_ready_ctx.bctlp = NULL;
}

@ -685,10 +685,14 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) {
grpc_call_element *elem = user_data;
call_data *calld = elem->call_data;
if (md->key == GRPC_MDSTR_PATH) {
calld->path = GRPC_MDSTR_REF(md->value);
if (calld->path == NULL) {
calld->path = GRPC_MDSTR_REF(md->value);
}
return NULL;
} else if (md->key == GRPC_MDSTR_AUTHORITY) {
calld->host = GRPC_MDSTR_REF(md->value);
if (calld->host == NULL) {
calld->host = GRPC_MDSTR_REF(md->value);
}
return NULL;
}
return md;

@ -243,6 +243,12 @@ void grpc_mdctx_global_shutdown(void) {
if (shard->count != 0) {
gpr_log(GPR_DEBUG, "WARNING: %d metadata strings were leaked",
shard->count);
for (size_t j = 0; j < shard->capacity; j++) {
for (internal_string *s = shard->strs[j]; s; s = s->bucket_next) {
gpr_log(GPR_DEBUG, "LEAKED: %s",
grpc_mdstr_as_c_string((grpc_mdstr *)s));
}
}
if (grpc_iomgr_abort_on_leaks()) {
abort();
}

@ -50,7 +50,7 @@ typedef struct grpc_transport grpc_transport;
for a stream. */
typedef struct grpc_stream grpc_stream;
/*#define GRPC_STREAM_REFCOUNT_DEBUG*/
//#define GRPC_STREAM_REFCOUNT_DEBUG
typedef struct grpc_stream_refcount {
gpr_refcount refs;

@ -102,7 +102,7 @@ function main() {
var argv = parseArgs(process.argv, {
string: ['server_addresses', 'test_cases', 'metrics_port'],
default: {'server_addresses': 'localhost:8080',
'test_duration-secs': -1,
'test_duration_secs': -1,
'num_channels_per_server': 1,
'num_stubs_per_channel': 1,
'metrics_port': '8081'}
@ -118,8 +118,8 @@ function main() {
}));
start(server_addresses, test_cases, argv.num_channels_per_server,
argv.num_stubs_per_channel, argv.metrics_port);
if (argv['test_duration-secs'] > -1) {
setTimeout(stop, argv['test_duration-secs'] * 1000);
if (argv.test_duration_secs > -1) {
setTimeout(stop, argv.test_duration_secs * 1000);
}
}

@ -169,3 +169,28 @@ message CoreResponse {
message Void {
}
// A single performance scenario: input to qps_json_driver
message Scenario {
// Human readable name for this scenario
string name = 1;
// Client configuration
ClientConfig client_config = 2;
// Number of clients to start for the test
int32 num_clients = 3;
// Server configuration
ServerConfig server_config = 4;
// Number of servers to start for the test
int32 num_servers = 5;
// Warmup period, in seconds
int32 warmup_seconds = 6;
// Benchmark time, in seconds
int32 benchmark_seconds = 7;
// Number of workers to spawn locally (usually zero)
int32 spawn_local_worker_count = 8;
}
// A set of scenarios to be run with qps_json_driver
message Scenarios {
repeated Scenario scenarios = 1;
}

@ -37,18 +37,32 @@
#include "test/core/end2end/end2end_tests.h"
#include <stdbool.h>
#include <string.h>
#include <grpc/support/log.h>
static bool g_pre_init_called = false;
% for test in tests:
extern void ${test}(grpc_end2end_test_config config);
extern void ${test}_pre_init(void);
% endfor
void grpc_end2end_tests_pre_init(void) {
GPR_ASSERT(!g_pre_init_called);
g_pre_init_called = true;
% for test in tests:
${test}_pre_init();
% endfor
}
void grpc_end2end_tests(int argc, char **argv,
grpc_end2end_test_config config) {
int i;
GPR_ASSERT(g_pre_init_called);
if (argc <= 1) {
% for test in tests:
${test}(config);

@ -0,0 +1,40 @@
%YAML 1.2
--- |
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM debian:jessie
<%include file="../../apt_get_basic.include"/>
<%include file="../../ccache_setup.include"/>
<%include file="../../cxx_deps.include"/>
<%include file="../../gcp_api_libraries.include"/>
<%include file="../../clang_update.include"/>
# Define the default command.
CMD ["bash"]

@ -1,6 +1,6 @@
%YAML 1.2
--- |
# Copyright 2015, Google Inc.
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -31,10 +31,9 @@
FROM debian:jessie
<%include file="../apt_get_basic.include"/>
<%include file="../ccache_setup.include"/>
<%include file="../cxx_deps.include"/>
<%include file="../gcp_api_libraries.include"/>
<%include file="../clang_update.include"/>
<%include file="../../apt_get_basic.include"/>
<%include file="../../node_deps.include"/>
<%include file="../../gcp_api_libraries.include"/>
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -35,7 +35,7 @@ template: |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
flags="-max_total_time=3600 -jobs=3 -workers=3"
flags="-max_total_time=3600 -jobs=3 -workers=3 -artifact_prefix=fuzzer_output/ -max_len=${selected.maxlen}"
if [ "$config" == "asan-trace-cmp" ]
then
flags="-use_traces=1 $flags"

@ -34,12 +34,15 @@
#include "test/core/bad_client/bad_client.h"
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <stdio.h>
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/support/murmur_hash.h"
#include "src/core/lib/support/string.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/server.h"

@ -36,51 +36,136 @@
#include "test/core/end2end/end2end_tests.h"
#include <stdbool.h>
#include <string.h>
#include <grpc/support/log.h>
static bool g_pre_init_called = false;
extern void bad_hostname(grpc_end2end_test_config config);
extern void bad_hostname_pre_init(void);
extern void binary_metadata(grpc_end2end_test_config config);
extern void binary_metadata_pre_init(void);
extern void cancel_after_accept(grpc_end2end_test_config config);
extern void cancel_after_accept_pre_init(void);
extern void cancel_after_client_done(grpc_end2end_test_config config);
extern void cancel_after_client_done_pre_init(void);
extern void cancel_after_invoke(grpc_end2end_test_config config);
extern void cancel_after_invoke_pre_init(void);
extern void cancel_before_invoke(grpc_end2end_test_config config);
extern void cancel_before_invoke_pre_init(void);
extern void cancel_in_a_vacuum(grpc_end2end_test_config config);
extern void cancel_in_a_vacuum_pre_init(void);
extern void cancel_with_status(grpc_end2end_test_config config);
extern void cancel_with_status_pre_init(void);
extern void compressed_payload(grpc_end2end_test_config config);
extern void compressed_payload_pre_init(void);
extern void connectivity(grpc_end2end_test_config config);
extern void connectivity_pre_init(void);
extern void default_host(grpc_end2end_test_config config);
extern void default_host_pre_init(void);
extern void disappearing_server(grpc_end2end_test_config config);
extern void disappearing_server_pre_init(void);
extern void empty_batch(grpc_end2end_test_config config);
extern void empty_batch_pre_init(void);
extern void filter_causes_close(grpc_end2end_test_config config);
extern void filter_causes_close_pre_init(void);
extern void graceful_server_shutdown(grpc_end2end_test_config config);
extern void graceful_server_shutdown_pre_init(void);
extern void high_initial_seqno(grpc_end2end_test_config config);
extern void high_initial_seqno_pre_init(void);
extern void hpack_size(grpc_end2end_test_config config);
extern void hpack_size_pre_init(void);
extern void idempotent_request(grpc_end2end_test_config config);
extern void idempotent_request_pre_init(void);
extern void invoke_large_request(grpc_end2end_test_config config);
extern void invoke_large_request_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void);
extern void max_message_length(grpc_end2end_test_config config);
extern void max_message_length_pre_init(void);
extern void negative_deadline(grpc_end2end_test_config config);
extern void negative_deadline_pre_init(void);
extern void no_op(grpc_end2end_test_config config);
extern void no_op_pre_init(void);
extern void payload(grpc_end2end_test_config config);
extern void payload_pre_init(void);
extern void ping(grpc_end2end_test_config config);
extern void ping_pre_init(void);
extern void ping_pong_streaming(grpc_end2end_test_config config);
extern void ping_pong_streaming_pre_init(void);
extern void registered_call(grpc_end2end_test_config config);
extern void registered_call_pre_init(void);
extern void request_with_flags(grpc_end2end_test_config config);
extern void request_with_flags_pre_init(void);
extern void request_with_payload(grpc_end2end_test_config config);
extern void request_with_payload_pre_init(void);
extern void server_finishes_request(grpc_end2end_test_config config);
extern void server_finishes_request_pre_init(void);
extern void shutdown_finishes_calls(grpc_end2end_test_config config);
extern void shutdown_finishes_calls_pre_init(void);
extern void shutdown_finishes_tags(grpc_end2end_test_config config);
extern void shutdown_finishes_tags_pre_init(void);
extern void simple_delayed_request(grpc_end2end_test_config config);
extern void simple_delayed_request_pre_init(void);
extern void simple_metadata(grpc_end2end_test_config config);
extern void simple_metadata_pre_init(void);
extern void simple_request(grpc_end2end_test_config config);
extern void simple_request_pre_init(void);
extern void trailing_metadata(grpc_end2end_test_config config);
extern void trailing_metadata_pre_init(void);
void grpc_end2end_tests_pre_init(void) {
GPR_ASSERT(!g_pre_init_called);
g_pre_init_called = true;
bad_hostname_pre_init();
binary_metadata_pre_init();
cancel_after_accept_pre_init();
cancel_after_client_done_pre_init();
cancel_after_invoke_pre_init();
cancel_before_invoke_pre_init();
cancel_in_a_vacuum_pre_init();
cancel_with_status_pre_init();
compressed_payload_pre_init();
connectivity_pre_init();
default_host_pre_init();
disappearing_server_pre_init();
empty_batch_pre_init();
filter_causes_close_pre_init();
graceful_server_shutdown_pre_init();
high_initial_seqno_pre_init();
hpack_size_pre_init();
idempotent_request_pre_init();
invoke_large_request_pre_init();
large_metadata_pre_init();
max_concurrent_streams_pre_init();
max_message_length_pre_init();
negative_deadline_pre_init();
no_op_pre_init();
payload_pre_init();
ping_pre_init();
ping_pong_streaming_pre_init();
registered_call_pre_init();
request_with_flags_pre_init();
request_with_payload_pre_init();
server_finishes_request_pre_init();
shutdown_finishes_calls_pre_init();
shutdown_finishes_tags_pre_init();
simple_delayed_request_pre_init();
simple_metadata_pre_init();
simple_request_pre_init();
trailing_metadata_pre_init();
}
void grpc_end2end_tests(int argc, char **argv,
grpc_end2end_test_config config) {
int i;
GPR_ASSERT(g_pre_init_called);
if (argc <= 1) {
bad_hostname(config);
binary_metadata(config);
@ -95,6 +180,7 @@ void grpc_end2end_tests(int argc, char **argv,
default_host(config);
disappearing_server(config);
empty_batch(config);
filter_causes_close(config);
graceful_server_shutdown(config);
high_initial_seqno(config);
hpack_size(config);
@ -174,6 +260,10 @@ void grpc_end2end_tests(int argc, char **argv,
empty_batch(config);
continue;
}
if (0 == strcmp("filter_causes_close", argv[i])) {
filter_causes_close(config);
continue;
}
if (0 == strcmp("graceful_server_shutdown", argv[i])) {
graceful_server_shutdown(config);
continue;

@ -36,52 +36,139 @@
#include "test/core/end2end/end2end_tests.h"
#include <stdbool.h>
#include <string.h>
#include <grpc/support/log.h>
static bool g_pre_init_called = false;
extern void bad_hostname(grpc_end2end_test_config config);
extern void bad_hostname_pre_init(void);
extern void binary_metadata(grpc_end2end_test_config config);
extern void binary_metadata_pre_init(void);
extern void call_creds(grpc_end2end_test_config config);
extern void call_creds_pre_init(void);
extern void cancel_after_accept(grpc_end2end_test_config config);
extern void cancel_after_accept_pre_init(void);
extern void cancel_after_client_done(grpc_end2end_test_config config);
extern void cancel_after_client_done_pre_init(void);
extern void cancel_after_invoke(grpc_end2end_test_config config);
extern void cancel_after_invoke_pre_init(void);
extern void cancel_before_invoke(grpc_end2end_test_config config);
extern void cancel_before_invoke_pre_init(void);
extern void cancel_in_a_vacuum(grpc_end2end_test_config config);
extern void cancel_in_a_vacuum_pre_init(void);
extern void cancel_with_status(grpc_end2end_test_config config);
extern void cancel_with_status_pre_init(void);
extern void compressed_payload(grpc_end2end_test_config config);
extern void compressed_payload_pre_init(void);
extern void connectivity(grpc_end2end_test_config config);
extern void connectivity_pre_init(void);
extern void default_host(grpc_end2end_test_config config);
extern void default_host_pre_init(void);
extern void disappearing_server(grpc_end2end_test_config config);
extern void disappearing_server_pre_init(void);
extern void empty_batch(grpc_end2end_test_config config);
extern void empty_batch_pre_init(void);
extern void filter_causes_close(grpc_end2end_test_config config);
extern void filter_causes_close_pre_init(void);
extern void graceful_server_shutdown(grpc_end2end_test_config config);
extern void graceful_server_shutdown_pre_init(void);
extern void high_initial_seqno(grpc_end2end_test_config config);
extern void high_initial_seqno_pre_init(void);
extern void hpack_size(grpc_end2end_test_config config);
extern void hpack_size_pre_init(void);
extern void idempotent_request(grpc_end2end_test_config config);
extern void idempotent_request_pre_init(void);
extern void invoke_large_request(grpc_end2end_test_config config);
extern void invoke_large_request_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void);
extern void max_message_length(grpc_end2end_test_config config);
extern void max_message_length_pre_init(void);
extern void negative_deadline(grpc_end2end_test_config config);
extern void negative_deadline_pre_init(void);
extern void no_op(grpc_end2end_test_config config);
extern void no_op_pre_init(void);
extern void payload(grpc_end2end_test_config config);
extern void payload_pre_init(void);
extern void ping(grpc_end2end_test_config config);
extern void ping_pre_init(void);
extern void ping_pong_streaming(grpc_end2end_test_config config);
extern void ping_pong_streaming_pre_init(void);
extern void registered_call(grpc_end2end_test_config config);
extern void registered_call_pre_init(void);
extern void request_with_flags(grpc_end2end_test_config config);
extern void request_with_flags_pre_init(void);
extern void request_with_payload(grpc_end2end_test_config config);
extern void request_with_payload_pre_init(void);
extern void server_finishes_request(grpc_end2end_test_config config);
extern void server_finishes_request_pre_init(void);
extern void shutdown_finishes_calls(grpc_end2end_test_config config);
extern void shutdown_finishes_calls_pre_init(void);
extern void shutdown_finishes_tags(grpc_end2end_test_config config);
extern void shutdown_finishes_tags_pre_init(void);
extern void simple_delayed_request(grpc_end2end_test_config config);
extern void simple_delayed_request_pre_init(void);
extern void simple_metadata(grpc_end2end_test_config config);
extern void simple_metadata_pre_init(void);
extern void simple_request(grpc_end2end_test_config config);
extern void simple_request_pre_init(void);
extern void trailing_metadata(grpc_end2end_test_config config);
extern void trailing_metadata_pre_init(void);
void grpc_end2end_tests_pre_init(void) {
GPR_ASSERT(!g_pre_init_called);
g_pre_init_called = true;
bad_hostname_pre_init();
binary_metadata_pre_init();
call_creds_pre_init();
cancel_after_accept_pre_init();
cancel_after_client_done_pre_init();
cancel_after_invoke_pre_init();
cancel_before_invoke_pre_init();
cancel_in_a_vacuum_pre_init();
cancel_with_status_pre_init();
compressed_payload_pre_init();
connectivity_pre_init();
default_host_pre_init();
disappearing_server_pre_init();
empty_batch_pre_init();
filter_causes_close_pre_init();
graceful_server_shutdown_pre_init();
high_initial_seqno_pre_init();
hpack_size_pre_init();
idempotent_request_pre_init();
invoke_large_request_pre_init();
large_metadata_pre_init();
max_concurrent_streams_pre_init();
max_message_length_pre_init();
negative_deadline_pre_init();
no_op_pre_init();
payload_pre_init();
ping_pre_init();
ping_pong_streaming_pre_init();
registered_call_pre_init();
request_with_flags_pre_init();
request_with_payload_pre_init();
server_finishes_request_pre_init();
shutdown_finishes_calls_pre_init();
shutdown_finishes_tags_pre_init();
simple_delayed_request_pre_init();
simple_metadata_pre_init();
simple_request_pre_init();
trailing_metadata_pre_init();
}
void grpc_end2end_tests(int argc, char **argv,
grpc_end2end_test_config config) {
int i;
GPR_ASSERT(g_pre_init_called);
if (argc <= 1) {
bad_hostname(config);
binary_metadata(config);
@ -97,6 +184,7 @@ void grpc_end2end_tests(int argc, char **argv,
default_host(config);
disappearing_server(config);
empty_batch(config);
filter_causes_close(config);
graceful_server_shutdown(config);
high_initial_seqno(config);
hpack_size(config);
@ -180,6 +268,10 @@ void grpc_end2end_tests(int argc, char **argv,
empty_batch(config);
continue;
}
if (0 == strcmp("filter_causes_close", argv[i])) {
filter_causes_close(config);
continue;
}
if (0 == strcmp("graceful_server_shutdown", argv[i])) {
graceful_server_shutdown(config);
continue;

@ -64,6 +64,7 @@ struct grpc_end2end_test_config {
void (*tear_down_data)(grpc_end2end_test_fixture *f);
};
void grpc_end2end_tests_pre_init(void);
void grpc_end2end_tests(int argc, char **argv, grpc_end2end_test_config config);
#endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */

@ -120,6 +120,7 @@ int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -124,6 +124,7 @@ int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -150,7 +150,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -108,6 +108,7 @@ int main(int argc, char **argv) {
grpc_allow_specialized_wakeup_fd = 0;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -116,6 +116,7 @@ int main(int argc, char **argv) {
#endif
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
GPR_ASSERT(0 == grpc_tracer_set_enabled("also-doesnt-exist", 0));

@ -105,6 +105,7 @@ int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -226,7 +226,7 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -120,6 +120,7 @@ int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -150,6 +150,7 @@ int main(int argc, char **argv) {
#endif
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
grpc_exec_ctx_finish(&exec_ctx);

@ -139,6 +139,7 @@ int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -139,6 +139,7 @@ int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -165,6 +165,7 @@ int main(int argc, char **argv) {
char *roots_filename;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
/* Set the SSL roots env var. */
roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);

@ -195,6 +195,7 @@ int main(int argc, char **argv) {
char *roots_filename;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
/* Set the SSL roots env var. */
roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);

@ -110,6 +110,7 @@ int main(int argc, char **argv) {
size_t i;
grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init();
grpc_init();
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {

@ -0,0 +1,121 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <grpc/grpc.h>
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/surface/server.h"
#include "test/core/util/mock_endpoint.h"
static const bool squelch = true;
static void discard_write(gpr_slice slice) {}
static void *tag(int n) { return (void *)(uintptr_t)n; }
static int detag(void *p) { return (int)(uintptr_t)p; }
static void dont_log(gpr_log_func_args *args) {}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_test_only_set_metadata_hash_seed(0);
if (squelch) gpr_set_log_function(dont_log);
grpc_init();
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_endpoint *mock_endpoint = grpc_mock_endpoint_create(discard_write);
grpc_mock_endpoint_put_read(
&exec_ctx, mock_endpoint,
gpr_slice_from_copied_buffer((const char *)data, size));
grpc_server *server = grpc_server_create(NULL, NULL);
grpc_completion_queue *cq = grpc_completion_queue_create(NULL);
grpc_server_register_completion_queue(server, cq, NULL);
// TODO(ctiller): add registered methods (one for POST, one for PUT)
// void *registered_method =
// grpc_server_register_method(server, "/reg", NULL, 0);
grpc_server_start(server);
grpc_transport *transport =
grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 0);
grpc_server_setup_transport(&exec_ctx, server, transport, NULL);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0);
grpc_call *call1 = NULL;
grpc_call_details call_details1;
grpc_metadata_array request_metadata1;
grpc_call_details_init(&call_details1);
grpc_metadata_array_init(&request_metadata1);
int requested_calls = 0;
grpc_server_request_call(server, &call1, &call_details1, &request_metadata1,
cq, cq, tag(1));
requested_calls++;
grpc_event ev;
while (1) {
grpc_exec_ctx_flush(&exec_ctx);
ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
switch (ev.type) {
case GRPC_QUEUE_TIMEOUT:
goto done;
case GRPC_QUEUE_SHUTDOWN:
break;
case GRPC_OP_COMPLETE:
switch (detag(ev.tag)) {
case 1:
requested_calls--;
// TODO(ctiller): keep reading that call!
break;
}
}
}
done:
if (call1 != NULL) grpc_call_destroy(call1);
grpc_call_details_destroy(&call_details1);
grpc_metadata_array_destroy(&request_metadata1);
grpc_server_shutdown_and_notify(server, cq, tag(0xdead));
grpc_server_cancel_all_calls(server);
for (int i = 0; i <= requested_calls; i++) {
ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
}
grpc_completion_queue_shutdown(cq);
for (int i = 0; i <= requested_calls; i++) {
ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
}
grpc_server_destroy(server);
grpc_completion_queue_destroy(cq);
grpc_shutdown();
return 0;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save