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_test", "grpc_cc_library", "grpc_cc_binary") 17 18def test_options(): 19 return struct() 20 21 22# maps test names to options 23BAD_SSL_TESTS = ['cert', 'alpn'] 24 25def grpc_bad_ssl_tests(): 26 grpc_cc_library( 27 name = 'bad_ssl_test_server', 28 srcs = ['server_common.cc'], 29 hdrs = ['server_common.h'], 30 deps = ['//test/core/util:grpc_test_util', 31 '//:grpc', 32 '//test/core/end2end:ssl_test_data'] 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 = [':bad_ssl_%s_server' % t, 44 '//src/core/tsi/test_creds:badserver.key', 45 '//src/core/tsi/test_creds:badserver.pem',], 46 deps = ['//test/core/util:grpc_test_util', 47 '//:gpr', 48 '//test/core/end2end:cq_verifier'], 49 ) 50