added nosec_tests to end2end test suite

pull/16965/head
Bill Feng 6 years ago
parent 2521fefb35
commit 5455a3ae3d
  1. 19
      test/core/end2end/BUILD
  2. 103
      test/core/end2end/generate_tests.bzl

@ -18,7 +18,7 @@ licenses(["notice"]) # Apache v2
grpc_package(name = "test/core/end2end")
load(":generate_tests.bzl", "grpc_end2end_tests")
load(":generate_tests.bzl", "grpc_end2end_tests", "grpc_end2end_nosec_tests")
grpc_cc_library(
name = "cq_verifier",
@ -46,7 +46,6 @@ grpc_cc_library(
visibility = ["//test:__subpackages__"],
)
grpc_cc_library(
name = "http_proxy",
srcs = ["fixtures/http_proxy_fixture.cc"],
@ -128,7 +127,7 @@ grpc_cc_test(
srcs = ["inproc_callback_test.cc"],
language = "C++",
deps = [
':end2end_tests',
":end2end_tests",
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
@ -177,6 +176,8 @@ grpc_cc_test(
grpc_end2end_tests()
grpc_end2end_nosec_tests()
grpc_cc_test(
name = "h2_ssl_session_reuse_test",
srcs = ["h2_ssl_session_reuse_test.cc"],
@ -185,11 +186,11 @@ grpc_cc_test(
],
language = "C++",
deps = [
':end2end_tests',
'//:gpr',
'//:grpc',
'//:tsi',
'//test/core/util:gpr_test_util',
'//test/core/util:grpc_test_util',
":end2end_tests",
"//:gpr",
"//:grpc",
"//:tsi",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

@ -102,6 +102,55 @@ END2END_FIXTURES = {
),
}
# maps fixture name to whether it requires the security library
END2END_NOSEC_FIXTURES = {
"h2_compress": _fixture_options(secure = False),
"h2_census": _fixture_options(secure = False),
# TODO(juanlishen): This is disabled for now, but should be considered to re-enable once we have
# decided how the load reporting service should be enabled.
#'h2_load_reporting': _fixture_options(),
"h2_fakesec": _fixture_options(),
"h2_fd": _fixture_options(
dns_resolver = False,
fullstack = False,
client_channel = False,
secure = False,
_platforms = ["linux", "mac", "posix"],
),
"h2_full": _fixture_options(secure = False),
"h2_full+pipe": _fixture_options(secure = False, _platforms = ["linux"]),
"h2_full+trace": _fixture_options(secure = False, tracing = True),
"h2_full+workarounds": _fixture_options(secure = False),
"h2_http_proxy": _fixture_options(secure = False, supports_proxy_auth = True),
"h2_proxy": _fixture_options(secure = False, includes_proxy = True),
"h2_sockpair_1byte": _fixture_options(
fullstack = False,
dns_resolver = False,
client_channel = False,
secure = False,
),
"h2_sockpair": _fixture_options(
fullstack = False,
dns_resolver = False,
client_channel = False,
secure = False,
),
"h2_sockpair+trace": _fixture_options(
fullstack = False,
dns_resolver = False,
tracing = True,
secure = False,
client_channel = False,
),
"h2_ssl": _fixture_options(secure = False),
"h2_ssl_proxy": _fixture_options(includes_proxy = True, secure = False),
"h2_uds": _fixture_options(
dns_resolver = False,
_platforms = ["linux", "mac", "posix"],
secure = False,
),
}
def _test_options(
needs_fullstack = False,
needs_dns = False,
@ -357,3 +406,57 @@ def grpc_end2end_tests():
poller,
],
)
def grpc_end2end_nosec_tests():
grpc_cc_library(
name = "end2end_nosec_tests",
srcs = ["end2end_nosec_tests.cc", "end2end_test_utils.cc"] + [
"tests/%s.cc" % t
for t in sorted(END2END_TESTS.keys())
if not END2END_TESTS[t].secure
],
hdrs = [
"tests/cancel_test_helpers.h",
"end2end_tests.h",
],
language = "C++",
deps = [
":cq_verifier",
":ssl_test_data",
":http_proxy",
":proxy",
],
)
for f, fopt in END2END_NOSEC_FIXTURES.items():
if fopt.secure:
continue
grpc_cc_binary(
name = "%s_nosec_test" % f,
srcs = ["fixtures/%s.cc" % f],
language = "C++",
deps = [
":end2end_nosec_tests",
"//test/core/util:grpc_test_util_unsecure",
"//:grpc_unsecure",
"//test/core/util:gpr_test_util",
"//:gpr",
],
)
for t, topt in END2END_TESTS.items():
#print(_compatible(fopt, topt), f, t, fopt, topt)
if not _compatible(fopt, topt):
continue
if topt.secure:
continue
for poller in POLLERS:
native.sh_test(
name = "%s_nosec_test@%s@poller=%s" % (f, t, poller),
data = [":%s_nosec_test" % f],
srcs = ["end2end_test.sh"],
args = [
"$(location %s_nosec_test)" % f,
t,
poller,
],
)

Loading…
Cancel
Save