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 16load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library", "grpc_cc_test") 17 18def test_options(): 19 return struct() 20 21# maps test names to options 22BAD_SSL_TESTS = ["cert", "alpn"] 23 24def grpc_bad_ssl_tests(): 25 grpc_cc_library( 26 name = "bad_ssl_test_server", 27 srcs = ["server_common.cc"], 28 hdrs = ["server_common.h"], 29 deps = [ 30 "//test/core/util:grpc_test_util", 31 "//:grpc", 32 ], 33 ) 34 for t in BAD_SSL_TESTS: 35 grpc_cc_binary( 36 name = "bad_ssl_%s_server" % t, 37 srcs = ["servers/%s.cc" % t], 38 deps = [":bad_ssl_test_server"], 39 ) 40 grpc_cc_test( 41 name = "bad_ssl_%s_test" % t, 42 srcs = ["bad_ssl_test.cc"], 43 data = [ 44 ":bad_ssl_%s_server" % t, 45 "//src/core/tsi/test_creds:badserver.key", 46 "//src/core/tsi/test_creds:badserver.pem", 47 "//src/core/tsi/test_creds:ca.pem", 48 "//src/core/tsi/test_creds:server1.key", 49 "//src/core/tsi/test_creds:server1.pem", 50 ], 51 deps = [ 52 "//test/core/util:grpc_test_util", 53 "//:gpr", 54 "//test/core/end2end:cq_verifier", 55 ], 56 tags = ["no_windows"], 57 ) 58