From 5e3da3f7724d192ff1afd42792bda66c0b1eeb91 Mon Sep 17 00:00:00 2001 From: tanvi-jagtap Date: Fri, 19 Apr 2024 15:28:28 +0000 Subject: [PATCH] [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT --- CMakeLists.txt | 4 + build_autogenerated.yaml | 4 + test/core/security/BUILD | 20 ++- test/core/security/alts_credentials_fuzzer.cc | 2 + test/core/security/aws_request_signer_test.cc | 12 +- test/core/security/fetch_oauth2.cc | 2 + .../grpc_tls_certificate_distributor_test.cc | 8 +- .../grpc_tls_certificate_provider_test.cc | 8 +- .../print_google_default_creds_token.cc | 4 +- test/core/security/ssl_server_fuzzer.cc | 3 +- .../security/tls_security_connector_test.cc | 146 +++++++++--------- test/core/security/verify_jwt.cc | 2 + 12 files changed, 126 insertions(+), 89 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8ea2f99e2f..2b2c36f0168 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7395,6 +7395,7 @@ target_include_directories(aws_request_signer_test target_link_libraries(aws_request_signer_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::check grpc_test_util ) @@ -15799,6 +15800,7 @@ target_include_directories(grpc_tls_certificate_distributor_test target_link_libraries(grpc_tls_certificate_distributor_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::check grpc_test_util ) @@ -15850,6 +15852,7 @@ target_include_directories(grpc_tls_certificate_provider_test target_link_libraries(grpc_tls_certificate_provider_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::check grpc_test_util ) @@ -31267,6 +31270,7 @@ target_include_directories(tls_security_connector_test target_link_libraries(tls_security_connector_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::check grpc_test_util ) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 6716d165cec..be8be543969 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -5775,6 +5775,7 @@ targets: - test/core/util/tracer_util.cc deps: - gtest + - absl/log:check - grpc_test_util - name: backend_metrics_lb_policy_test gtest: true @@ -10691,6 +10692,7 @@ targets: - test/core/util/tracer_util.cc deps: - gtest + - absl/log:check - grpc_test_util - name: grpc_tls_certificate_provider_test gtest: true @@ -10721,6 +10723,7 @@ targets: - test/core/util/tracer_util.cc deps: - gtest + - absl/log:check - grpc_test_util - name: grpc_tls_certificate_verifier_test gtest: true @@ -19545,6 +19548,7 @@ targets: - test/core/util/tracer_util.cc deps: - gtest + - absl/log:check - grpc_test_util - name: too_many_pings_test gtest: true diff --git a/test/core/security/BUILD b/test/core/security/BUILD index 2899bc9f523..d3a09ad5d45 100644 --- a/test/core/security/BUILD +++ b/test/core/security/BUILD @@ -23,6 +23,7 @@ grpc_fuzzer( name = "alts_credentials_fuzzer", srcs = ["alts_credentials_fuzzer.cc"], corpus = "corpus/alts_credentials_corpus", + external_deps = ["absl/log:check"], language = "C++", tags = ["no_windows"], deps = [ @@ -42,6 +43,7 @@ grpc_fuzzer( "//src/core/tsi/test_creds:server1.key", "//src/core/tsi/test_creds:server1.pem", ], + external_deps = ["absl/log:check"], language = "C++", tags = ["no_windows"], deps = [ @@ -109,7 +111,10 @@ grpc_cc_test( grpc_cc_test( name = "aws_request_signer_test", srcs = ["aws_request_signer_test.cc"], - external_deps = ["gtest"], + external_deps = [ + "absl/log:check", + "gtest", + ], language = "C++", deps = [ "//:gpr", @@ -247,6 +252,7 @@ grpc_cc_binary( grpc_cc_binary( name = "fetch_oauth2", srcs = ["fetch_oauth2.cc"], + external_deps = ["absl/log:check"], language = "C++", deps = [ ":oauth2_utils", @@ -261,6 +267,7 @@ grpc_cc_binary( grpc_cc_binary( name = "verify_jwt", srcs = ["verify_jwt.cc"], + external_deps = ["absl/log:check"], language = "C++", deps = [ "//:gpr", @@ -336,6 +343,7 @@ grpc_cc_test( "//src/core/tsi/test_creds:server1.pem", ], external_deps = [ + "absl/log:check", "gtest", ], language = "C++", @@ -386,7 +394,10 @@ grpc_cc_test( grpc_cc_test( name = "grpc_tls_certificate_distributor_test", srcs = ["grpc_tls_certificate_distributor_test.cc"], - external_deps = ["gtest"], + external_deps = [ + "absl/log:check", + "gtest", + ], language = "C++", deps = [ "//:gpr", @@ -409,7 +420,10 @@ grpc_cc_test( "//src/core/tsi/test_creds:server1.key", "//src/core/tsi/test_creds:server1.pem", ], - external_deps = ["gtest"], + external_deps = [ + "absl/log:check", + "gtest", + ], language = "C++", deps = [ "//:gpr", diff --git a/test/core/security/alts_credentials_fuzzer.cc b/test/core/security/alts_credentials_fuzzer.cc index 3f9f9496a9b..6a94daafc00 100644 --- a/test/core/security/alts_credentials_fuzzer.cc +++ b/test/core/security/alts_credentials_fuzzer.cc @@ -18,6 +18,8 @@ #include +#include "absl/log/check.h" + #include #include #include diff --git a/test/core/security/aws_request_signer_test.cc b/test/core/security/aws_request_signer_test.cc index 5752efa2428..c877fd5ae47 100644 --- a/test/core/security/aws_request_signer_test.cc +++ b/test/core/security/aws_request_signer_test.cc @@ -18,6 +18,8 @@ #include +#include "absl/log/check.h" + #include #include "test/core/util/test_config.h" @@ -247,9 +249,8 @@ TEST(GrpcAwsRequestSignerTest, InvalidUrl) { "token", "POST", "invalid_url", "us-east-1", "", {}, &error); std::string actual_error_description; - CHECK(grpc_error_get_str(error, - grpc_core::StatusStrProperty::kDescription, - &actual_error_description)); + CHECK(grpc_error_get_str(error, grpc_core::StatusStrProperty::kDescription, + &actual_error_description)); EXPECT_EQ(actual_error_description, "Invalid Aws request url."); } @@ -260,9 +261,8 @@ TEST(GrpcAwsRequestSignerTest, DuplicateRequestDate) { "us-east-1", "", {{"date", kBotoTestDate}, {"x-amz-date", kAmzTestDate}}, &error); std::string actual_error_description; - CHECK(grpc_error_get_str(error, - grpc_core::StatusStrProperty::kDescription, - &actual_error_description)); + CHECK(grpc_error_get_str(error, grpc_core::StatusStrProperty::kDescription, + &actual_error_description)); EXPECT_EQ(actual_error_description, "Only one of {date, x-amz-date} can be specified, not both."); } diff --git a/test/core/security/fetch_oauth2.cc b/test/core/security/fetch_oauth2.cc index d1d0ad0ea7d..cd96105418a 100644 --- a/test/core/security/fetch_oauth2.cc +++ b/test/core/security/fetch_oauth2.cc @@ -19,6 +19,8 @@ #include #include +#include "absl/log/check.h" + #include #include #include diff --git a/test/core/security/grpc_tls_certificate_distributor_test.cc b/test/core/security/grpc_tls_certificate_distributor_test.cc index edbcb5125e3..4b4259e9191 100644 --- a/test/core/security/grpc_tls_certificate_distributor_test.cc +++ b/test/core/security/grpc_tls_certificate_distributor_test.cc @@ -24,6 +24,8 @@ #include #include +#include "absl/log/check.h" + #include #include #include @@ -133,7 +135,7 @@ class GrpcTlsCertificateDistributorTest : public ::testing::Test { void OnError(grpc_error_handle root_cert_error, grpc_error_handle identity_cert_error) override { - CHECK_DONT(!root_cert_error.ok() || !identity_cert_error.ok()); + CHECK(!root_cert_error.ok() || !identity_cert_error.ok()); std::string root_error_str; std::string identity_error_str; if (!root_cert_error.ok()) { @@ -142,8 +144,8 @@ class GrpcTlsCertificateDistributorTest : public ::testing::Test { } if (!identity_cert_error.ok()) { CHECK(grpc_error_get_str(identity_cert_error, - StatusStrProperty::kDescription, - &identity_error_str)); + StatusStrProperty::kDescription, + &identity_error_str)); } state_->error_queue.emplace_back(std::move(root_error_str), std::move(identity_error_str)); diff --git a/test/core/security/grpc_tls_certificate_provider_test.cc b/test/core/security/grpc_tls_certificate_provider_test.cc index 975fbc2cc52..af5491a48e4 100644 --- a/test/core/security/grpc_tls_certificate_provider_test.cc +++ b/test/core/security/grpc_tls_certificate_provider_test.cc @@ -22,6 +22,8 @@ #include #include +#include "absl/log/check.h" + #include #include #include @@ -134,7 +136,7 @@ class GrpcTlsCertificateProviderTest : public ::testing::Test { void OnError(grpc_error_handle root_cert_error, grpc_error_handle identity_cert_error) override { MutexLock lock(&state_->mu); - CHECK_DONT(!root_cert_error.ok() || !identity_cert_error.ok()); + CHECK(!root_cert_error.ok() || !identity_cert_error.ok()); std::string root_error_str; std::string identity_error_str; if (!root_cert_error.ok()) { @@ -143,8 +145,8 @@ class GrpcTlsCertificateProviderTest : public ::testing::Test { } if (!identity_cert_error.ok()) { CHECK(grpc_error_get_str(identity_cert_error, - StatusStrProperty::kDescription, - &identity_error_str)); + StatusStrProperty::kDescription, + &identity_error_str)); } state_->error_queue.emplace_back(std::move(root_error_str), std::move(identity_error_str)); diff --git a/test/core/security/print_google_default_creds_token.cc b/test/core/security/print_google_default_creds_token.cc index d191b29a81c..abd5616809f 100644 --- a/test/core/security/print_google_default_creds_token.cc +++ b/test/core/security/print_google_default_creds_token.cc @@ -19,6 +19,8 @@ #include #include +#include "absl/log/check.h" + #include #include #include @@ -50,7 +52,7 @@ static void on_metadata_response(void* arg, grpc_error_handle error) { fflush(stderr); } else { char* token; - CHECK_EQ(sync->md_array.size, 1); + CHECK_EQ(sync->md_array.size, 1u); token = grpc_slice_to_c_string(GRPC_MDVALUE(sync->md_array.md[0])); printf("\nGot token: %s\n\n", token); gpr_free(token); diff --git a/test/core/security/ssl_server_fuzzer.cc b/test/core/security/ssl_server_fuzzer.cc index 8a2a92dddf0..774693e7bf5 100644 --- a/test/core/security/ssl_server_fuzzer.cc +++ b/test/core/security/ssl_server_fuzzer.cc @@ -15,6 +15,7 @@ // limitations under the License. // // +#include "absl/log/check.h" #include #include @@ -56,7 +57,7 @@ static void on_handshake_done(void* arg, grpc_error_handle error) { CHECK(state->done_callback_called == false); state->done_callback_called = true; // The fuzzer should not pass the handshake. - CHECK_DONT(!error.ok()); + CHECK(!error.ok()); } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { diff --git a/test/core/security/tls_security_connector_test.cc b/test/core/security/tls_security_connector_test.cc index 7580268444e..ee072ff9816 100644 --- a/test/core/security/tls_security_connector_test.cc +++ b/test/core/security/tls_security_connector_test.cc @@ -24,6 +24,8 @@ #include #include +#include "absl/log/check.h" + #include #include #include @@ -368,12 +370,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( @@ -404,12 +406,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " @@ -557,12 +559,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( @@ -593,12 +595,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " @@ -631,28 +633,28 @@ TEST_F(TlsSecurityConnectorTest, // Construct a full TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(7, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) == - TSI_OK); + TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) == + TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_SECURITY_LEVEL_PEER_PROPERTY, - tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY), - &peer.properties[3]) == TSI_OK); + TSI_SECURITY_LEVEL_PEER_PROPERTY, + tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY), + &peer.properties[3]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain", - &peer.properties[4]) == TSI_OK); + TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain", + &peer.properties[4]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[5]) == TSI_OK); + TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[5]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com", - &peer.properties[6]) == TSI_OK); + TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com", + &peer.properties[6]) == TSI_OK); RefCountedPtr auth_context; ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( @@ -679,28 +681,28 @@ TEST_F(TlsSecurityConnectorTest, // Construct a full TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(7, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.com", + &peer.properties[1]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) == - TSI_OK); + TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) == + TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_SECURITY_LEVEL_PEER_PROPERTY, - tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY), - &peer.properties[3]) == TSI_OK); + TSI_SECURITY_LEVEL_PEER_PROPERTY, + tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY), + &peer.properties[3]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain", - &peer.properties[4]) == TSI_OK); + TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain", + &peer.properties[4]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "*.com", - &peer.properties[5]) == TSI_OK); + TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "*.com", + &peer.properties[5]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com", - &peer.properties[6]) == TSI_OK); + TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com", + &peer.properties[6]) == TSI_OK); RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: Hostname " @@ -988,12 +990,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( @@ -1019,12 +1021,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " @@ -1054,12 +1056,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( @@ -1087,12 +1089,12 @@ TEST_F(TlsSecurityConnectorTest, // Construct a basic TSI Peer. tsi_peer peer; CHECK(tsi_construct_peer(2, &peer) == TSI_OK); - CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, - "h2", strlen("h2"), - &peer.properties[0]) == TSI_OK); + CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2", + strlen("h2"), + &peer.properties[0]) == TSI_OK); CHECK(tsi_construct_string_peer_property_from_cstring( - TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", - &peer.properties[1]) == TSI_OK); + TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", + &peer.properties[1]) == TSI_OK); RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " diff --git a/test/core/security/verify_jwt.cc b/test/core/security/verify_jwt.cc index 9b1be95aec8..c9178d230f1 100644 --- a/test/core/security/verify_jwt.cc +++ b/test/core/security/verify_jwt.cc @@ -19,6 +19,8 @@ #include #include +#include "absl/log/check.h" + #include #include #include