aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2016-09-15 23:01:09 -0700
committerGravatar yang-g <yangg@google.com>2016-09-15 23:01:09 -0700
commit4b4571ab887f4c067a54d1121a48cbe1ccda3dfd (patch)
tree951f07df6715f66c400c3dc6fa55f3336b0cf159
parentc580af37e0bae96b5ef5ae13960742afe22d949e (diff)
Add a test for nonbin header containing binary value
-rw-r--r--test/cpp/end2end/end2end_test.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 1d78f4a911..e64186a271 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -1350,6 +1350,23 @@ TEST_P(SecureEnd2endTest, AuthMetadataPluginKeyFailure) {
EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED);
}
+TEST_P(SecureEnd2endTest, AuthMetadataPluginValueFailure) {
+ ResetStub();
+ EchoRequest request;
+ EchoResponse response;
+ ClientContext context;
+ context.set_credentials(
+ MetadataCredentialsFromPlugin(std::unique_ptr<MetadataCredentialsPlugin>(
+ new TestMetadataCredentialsPlugin(
+ TestMetadataCredentialsPlugin::kGoodMetadataKey,
+ "With binary \n data", false, true))));
+ request.set_message("Hello");
+
+ Status s = stub_->Echo(&context, request, &response);
+ EXPECT_FALSE(s.ok());
+ EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED);
+}
+
TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginFailure) {
ResetStub();
EchoRequest request;