• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python2.7
2# Copyright 2015 gRPC authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16"""
17Houses grpc_bad_ssl_tests.
18"""
19
20load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library", "grpc_cc_test")
21
22def test_options():
23    return struct()
24
25# maps test names to options
26BAD_SSL_TESTS = ["cert", "alpn"]
27
28# buildifier: disable=unnamed-macro
29def grpc_bad_ssl_tests():
30    """Instantiates gRPC bad SSL tests."""
31
32    grpc_cc_library(
33        name = "bad_ssl_test_server",
34        srcs = ["server_common.cc"],
35        hdrs = ["server_common.h"],
36        deps = [
37            "//test/core/util:grpc_test_util",
38            "//test/core/util:grpc_test_util_base",
39            "//:grpc",
40        ],
41    )
42    for t in BAD_SSL_TESTS:
43        grpc_cc_binary(
44            name = "bad_ssl_%s_server" % t,
45            srcs = ["servers/%s.cc" % t],
46            deps = [":bad_ssl_test_server"],
47        )
48        grpc_cc_test(
49            name = "bad_ssl_%s_test" % t,
50            srcs = ["bad_ssl_test.cc"],
51            data = [
52                ":bad_ssl_%s_server" % t,
53                "//src/core/tsi/test_creds:badserver.key",
54                "//src/core/tsi/test_creds:badserver.pem",
55                "//src/core/tsi/test_creds:ca.pem",
56                "//src/core/tsi/test_creds:server1.key",
57                "//src/core/tsi/test_creds:server1.pem",
58            ],
59            deps = [
60                "//test/core/util:grpc_test_util",
61                "//test/core/util:grpc_test_util_base",
62                "//:gpr",
63                "//:grpc",
64                "//:subprocess",
65                "//test/core/end2end:cq_verifier",
66            ],
67            tags = ["no_windows"],
68        )
69