From d7f768b2b2a6fc1d0dfd209dcdb35ba38fee227b Mon Sep 17 00:00:00 2001
From: Julien Boeuf <jboeuf@google.com>
Date: Fri, 8 May 2015 16:37:16 -0700
Subject: [PATCH] Addressing comments.

---
 BUILD                                         |  4 +-
 Makefile                                      |  4 +-
 build.json                                    |  4 +-
 src/core/security/auth.c                      |  2 +-
 .../{context.c => security_context.c}         |  2 +-
 .../{context.h => security_context.h}         |  6 +-
 test/core/end2end/gen_build_json.py           | 61 +++++++++----------
 tools/run_tests/tests.json                    | 14 ++---
 vsprojects/grpc/grpc.vcxproj                  |  6 +-
 vsprojects/grpc/grpc.vcxproj.filters          | 12 ++--
 10 files changed, 57 insertions(+), 58 deletions(-)
 rename src/core/security/{context.c => security_context.c} (98%)
 rename src/core/security/{context.h => security_context.h} (91%)

diff --git a/BUILD b/BUILD
index 881fffd315..f7136e4b84 100644
--- a/BUILD
+++ b/BUILD
@@ -130,12 +130,12 @@ cc_library(
     "src/core/httpcli/parser.h",
     "src/core/security/auth.h",
     "src/core/security/base64.h",
-    "src/core/security/context.h",
     "src/core/security/credentials.h",
     "src/core/security/json_token.h",
     "src/core/security/secure_endpoint.h",
     "src/core/security/secure_transport_setup.h",
     "src/core/security/security_connector.h",
+    "src/core/security/security_context.h",
     "src/core/tsi/fake_transport_security.h",
     "src/core/tsi/ssl_transport_security.h",
     "src/core/tsi/transport_security.h",
@@ -233,7 +233,6 @@ cc_library(
     "src/core/httpcli/parser.c",
     "src/core/security/auth.c",
     "src/core/security/base64.c",
-    "src/core/security/context.c",
     "src/core/security/credentials.c",
     "src/core/security/credentials_posix.c",
     "src/core/security/credentials_win32.c",
@@ -242,6 +241,7 @@ cc_library(
     "src/core/security/secure_endpoint.c",
     "src/core/security/secure_transport_setup.c",
     "src/core/security/security_connector.c",
+    "src/core/security/security_context.c",
     "src/core/security/server_secure_chttp2.c",
     "src/core/surface/init_secure.c",
     "src/core/surface/secure_channel_create.c",
diff --git a/Makefile b/Makefile
index c3369d7727..7988f8e71f 100644
--- a/Makefile
+++ b/Makefile
@@ -2411,7 +2411,6 @@ LIBGRPC_SRC = \
     src/core/httpcli/parser.c \
     src/core/security/auth.c \
     src/core/security/base64.c \
-    src/core/security/context.c \
     src/core/security/credentials.c \
     src/core/security/credentials_posix.c \
     src/core/security/credentials_win32.c \
@@ -2420,6 +2419,7 @@ LIBGRPC_SRC = \
     src/core/security/secure_endpoint.c \
     src/core/security/secure_transport_setup.c \
     src/core/security/security_connector.c \
+    src/core/security/security_context.c \
     src/core/security/server_secure_chttp2.c \
     src/core/surface/init_secure.c \
     src/core/surface/secure_channel_create.c \
@@ -12004,7 +12004,6 @@ src/core/httpcli/httpcli_security_connector.c: $(OPENSSL_DEP)
 src/core/httpcli/parser.c: $(OPENSSL_DEP)
 src/core/security/auth.c: $(OPENSSL_DEP)
 src/core/security/base64.c: $(OPENSSL_DEP)
-src/core/security/context.c: $(OPENSSL_DEP)
 src/core/security/credentials.c: $(OPENSSL_DEP)
 src/core/security/credentials_posix.c: $(OPENSSL_DEP)
 src/core/security/credentials_win32.c: $(OPENSSL_DEP)
@@ -12013,6 +12012,7 @@ src/core/security/json_token.c: $(OPENSSL_DEP)
 src/core/security/secure_endpoint.c: $(OPENSSL_DEP)
 src/core/security/secure_transport_setup.c: $(OPENSSL_DEP)
 src/core/security/security_connector.c: $(OPENSSL_DEP)
+src/core/security/security_context.c: $(OPENSSL_DEP)
 src/core/security/server_secure_chttp2.c: $(OPENSSL_DEP)
 src/core/surface/init_secure.c: $(OPENSSL_DEP)
 src/core/surface/secure_channel_create.c: $(OPENSSL_DEP)
diff --git a/build.json b/build.json
index c154f1365e..6bf6cead3d 100644
--- a/build.json
+++ b/build.json
@@ -405,12 +405,12 @@
         "src/core/httpcli/parser.h",
         "src/core/security/auth.h",
         "src/core/security/base64.h",
-        "src/core/security/context.h",
         "src/core/security/credentials.h",
         "src/core/security/json_token.h",
         "src/core/security/secure_endpoint.h",
         "src/core/security/secure_transport_setup.h",
         "src/core/security/security_connector.h",
+        "src/core/security/security_context.h",
         "src/core/tsi/fake_transport_security.h",
         "src/core/tsi/ssl_transport_security.h",
         "src/core/tsi/transport_security.h",
@@ -423,7 +423,6 @@
         "src/core/httpcli/parser.c",
         "src/core/security/auth.c",
         "src/core/security/base64.c",
-        "src/core/security/context.c",
         "src/core/security/credentials.c",
         "src/core/security/credentials_posix.c",
         "src/core/security/credentials_win32.c",
@@ -432,6 +431,7 @@
         "src/core/security/secure_endpoint.c",
         "src/core/security/secure_transport_setup.c",
         "src/core/security/security_connector.c",
+        "src/core/security/security_context.c",
         "src/core/security/server_secure_chttp2.c",
         "src/core/surface/init_secure.c",
         "src/core/surface/secure_channel_create.c",
diff --git a/src/core/security/auth.c b/src/core/security/auth.c
index 7fcedac795..faf12d8f14 100644
--- a/src/core/security/auth.c
+++ b/src/core/security/auth.c
@@ -40,7 +40,7 @@
 
 #include "src/core/support/string.h"
 #include "src/core/channel/channel_stack.h"
-#include "src/core/security/context.h"
+#include "src/core/security/security_context.h"
 #include "src/core/security/security_connector.h"
 #include "src/core/security/credentials.h"
 #include "src/core/surface/call.h"
diff --git a/src/core/security/context.c b/src/core/security/security_context.c
similarity index 98%
rename from src/core/security/context.c
rename to src/core/security/security_context.c
index a365002a74..b90dc5097a 100644
--- a/src/core/security/context.c
+++ b/src/core/security/security_context.c
@@ -33,7 +33,7 @@
 
 #include <string.h>
 
-#include "src/core/security/context.h"
+#include "src/core/security/security_context.h"
 #include "src/core/surface/call.h"
 
 #include <grpc/grpc_security.h>
diff --git a/src/core/security/context.h b/src/core/security/security_context.h
similarity index 91%
rename from src/core/security/context.h
rename to src/core/security/security_context.h
index 3e46c378ff..561633b452 100644
--- a/src/core/security/context.h
+++ b/src/core/security/security_context.h
@@ -31,8 +31,8 @@
  *
  */
 
-#ifndef GRPC_INTERNAL_CORE_SECURITY_CONTEXT_H
-#define GRPC_INTERNAL_CORE_SECURITY_CONTEXT_H
+#ifndef GRPC_INTERNAL_CORE_SECURITY_SECURITY_CONTEXT_H
+#define GRPC_INTERNAL_CORE_SECURITY_SECURITY_CONTEXT_H
 
 #include "src/core/security/credentials.h"
 
@@ -44,5 +44,5 @@ typedef struct {
 grpc_client_security_context *grpc_client_security_context_create(void);
 void grpc_client_security_context_destroy(void *ctx);
 
-#endif  /* GRPC_INTERNAL_CORE_SECURITY_CONTEXT_H */
+#endif  /* GRPC_INTERNAL_CORE_SECURITY_SECURITY_CONTEXT_H */
 
diff --git a/test/core/end2end/gen_build_json.py b/test/core/end2end/gen_build_json.py
index 934e93561b..e916f186e1 100755
--- a/test/core/end2end/gen_build_json.py
+++ b/test/core/end2end/gen_build_json.py
@@ -33,6 +33,7 @@
 
 
 import simplejson
+import collections
 
 
 # maps fixture name to whether it requires the security library
@@ -46,40 +47,38 @@ END2END_FIXTURES = {
     'chttp2_socket_pair_one_byte_at_a_time': False,
 }
 
-class TestOptions(object):
-  def __init__(self, flaky=False, secure=False):
-    self.flaky = flaky
-    self.secure = secure
+TestOptions = collections.namedtuple('TestOptions', 'flaky secure')
+default_test_options = TestOptions(False, False)
 
 # maps test names to options
 END2END_TESTS = {
-    'bad_hostname': TestOptions(),
-    'cancel_after_accept': TestOptions(flaky=True),
-    'cancel_after_accept_and_writes_closed': TestOptions(),
-    'cancel_after_invoke': TestOptions(),
-    'cancel_before_invoke': TestOptions(),
-    'cancel_in_a_vacuum': TestOptions(),
-    'census_simple_request': TestOptions(),
-    'disappearing_server': TestOptions(),
-    'early_server_shutdown_finishes_inflight_calls': TestOptions(),
-    'early_server_shutdown_finishes_tags': TestOptions(),
-    'empty_batch': TestOptions(),
-    'graceful_server_shutdown': TestOptions(),
-    'invoke_large_request': TestOptions(flaky=False),
-    'max_concurrent_streams': TestOptions(),
-    'max_message_length': TestOptions(),
-    'no_op': TestOptions(),
-    'ping_pong_streaming': TestOptions(),
-    'registered_call': TestOptions(),
-    'request_response_with_binary_metadata_and_payload': TestOptions(),
-    'request_response_with_metadata_and_payload': TestOptions(),
-    'request_response_with_payload': TestOptions(),
-    'request_response_with_payload_and_call_creds': TestOptions(secure=True),
-    'request_with_large_metadata': TestOptions(),
-    'request_with_payload': TestOptions(),
-    'simple_delayed_request': TestOptions(),
-    'simple_request': TestOptions(),
-    'simple_request_with_high_initial_sequence_number': TestOptions(),
+    'bad_hostname': default_test_options,
+    'cancel_after_accept': TestOptions(flaky=True, secure=False),
+    'cancel_after_accept_and_writes_closed': default_test_options,
+    'cancel_after_invoke': default_test_options,
+    'cancel_before_invoke': default_test_options,
+    'cancel_in_a_vacuum': default_test_options,
+    'census_simple_request': default_test_options,
+    'disappearing_server': default_test_options,
+    'early_server_shutdown_finishes_inflight_calls': default_test_options,
+    'early_server_shutdown_finishes_tags': default_test_options,
+    'empty_batch': default_test_options,
+    'graceful_server_shutdown': default_test_options,
+    'invoke_large_request': TestOptions(flaky=True, secure=False),
+    'max_concurrent_streams': default_test_options,
+    'max_message_length': default_test_options,
+    'no_op': default_test_options,
+    'ping_pong_streaming': default_test_options,
+    'registered_call': default_test_options,
+    'request_response_with_binary_metadata_and_payload': default_test_options,
+    'request_response_with_metadata_and_payload': default_test_options,
+    'request_response_with_payload': default_test_options,
+    'request_response_with_payload_and_call_creds': TestOptions(flaky=False, secure=True),
+    'request_with_large_metadata': default_test_options,
+    'request_with_payload': default_test_options,
+    'simple_delayed_request': default_test_options,
+    'simple_request': default_test_options,
+    'simple_request_with_high_initial_sequence_number': default_test_options,
 }
 
 
diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json
index 8c6d78786e..51fae2fb17 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/tests.json
@@ -802,7 +802,7 @@
     ]
   }, 
   {
-    "flaky": false, 
+    "flaky": true, 
     "language": "c", 
     "name": "chttp2_fake_security_invoke_large_request_test", 
     "platforms": [
@@ -1045,7 +1045,7 @@
     ]
   }, 
   {
-    "flaky": false, 
+    "flaky": true, 
     "language": "c", 
     "name": "chttp2_fullstack_invoke_large_request_test", 
     "platforms": [
@@ -1288,7 +1288,7 @@
     ]
   }, 
   {
-    "flaky": false, 
+    "flaky": true, 
     "language": "c", 
     "name": "chttp2_fullstack_uds_invoke_large_request_test", 
     "platforms": [
@@ -1531,7 +1531,7 @@
     ]
   }, 
   {
-    "flaky": false, 
+    "flaky": true, 
     "language": "c", 
     "name": "chttp2_simple_ssl_fullstack_invoke_large_request_test", 
     "platforms": [
@@ -1774,7 +1774,7 @@
     ]
   }, 
   {
-    "flaky": false, 
+    "flaky": true, 
     "language": "c", 
     "name": "chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test", 
     "platforms": [
@@ -2017,7 +2017,7 @@
     ]
   }, 
   {
-    "flaky": false, 
+    "flaky": true, 
     "language": "c", 
     "name": "chttp2_socket_pair_invoke_large_request_test", 
     "platforms": [
@@ -2260,7 +2260,7 @@
     ]
   }, 
   {
-    "flaky": false, 
+    "flaky": true, 
     "language": "c", 
     "name": "chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test", 
     "platforms": [
diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj
index b1a92cff6d..e6c474541d 100644
--- a/vsprojects/grpc/grpc.vcxproj
+++ b/vsprojects/grpc/grpc.vcxproj
@@ -161,12 +161,12 @@
     <ClInclude Include="..\..\src\core\httpcli\parser.h" />
     <ClInclude Include="..\..\src\core\security\auth.h" />
     <ClInclude Include="..\..\src\core\security\base64.h" />
-    <ClInclude Include="..\..\src\core\security\context.h" />
     <ClInclude Include="..\..\src\core\security\credentials.h" />
     <ClInclude Include="..\..\src\core\security\json_token.h" />
     <ClInclude Include="..\..\src\core\security\secure_endpoint.h" />
     <ClInclude Include="..\..\src\core\security\secure_transport_setup.h" />
     <ClInclude Include="..\..\src\core\security\security_connector.h" />
+    <ClInclude Include="..\..\src\core\security\security_context.h" />
     <ClInclude Include="..\..\src\core\tsi\fake_transport_security.h" />
     <ClInclude Include="..\..\src\core\tsi\ssl_transport_security.h" />
     <ClInclude Include="..\..\src\core\tsi\transport_security.h" />
@@ -272,8 +272,6 @@
     </ClCompile>
     <ClCompile Include="..\..\src\core\security\base64.c">
     </ClCompile>
-    <ClCompile Include="..\..\src\core\security\context.c">
-    </ClCompile>
     <ClCompile Include="..\..\src\core\security\credentials.c">
     </ClCompile>
     <ClCompile Include="..\..\src\core\security\credentials_posix.c">
@@ -290,6 +288,8 @@
     </ClCompile>
     <ClCompile Include="..\..\src\core\security\security_connector.c">
     </ClCompile>
+    <ClCompile Include="..\..\src\core\security\security_context.c">
+    </ClCompile>
     <ClCompile Include="..\..\src\core\security\server_secure_chttp2.c">
     </ClCompile>
     <ClCompile Include="..\..\src\core\surface\init_secure.c">
diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters
index 28e6fabc2d..ef9387dd2a 100644
--- a/vsprojects/grpc/grpc.vcxproj.filters
+++ b/vsprojects/grpc/grpc.vcxproj.filters
@@ -19,9 +19,6 @@
     <ClCompile Include="..\..\src\core\security\base64.c">
       <Filter>src\core\security</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\core\security\context.c">
-      <Filter>src\core\security</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\src\core\security\credentials.c">
       <Filter>src\core\security</Filter>
     </ClCompile>
@@ -46,6 +43,9 @@
     <ClCompile Include="..\..\src\core\security\security_connector.c">
       <Filter>src\core\security</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\core\security\security_context.c">
+      <Filter>src\core\security</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\src\core\security\server_secure_chttp2.c">
       <Filter>src\core\security</Filter>
     </ClCompile>
@@ -395,9 +395,6 @@
     <ClInclude Include="..\..\src\core\security\base64.h">
       <Filter>src\core\security</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\src\core\security\context.h">
-      <Filter>src\core\security</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\src\core\security\credentials.h">
       <Filter>src\core\security</Filter>
     </ClInclude>
@@ -413,6 +410,9 @@
     <ClInclude Include="..\..\src\core\security\security_connector.h">
       <Filter>src\core\security</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\core\security\security_context.h">
+      <Filter>src\core\security</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\src\core\tsi\fake_transport_security.h">
       <Filter>src\core\tsi</Filter>
     </ClInclude>
-- 
GitLab