From 732a875fe82c80a735cc9ca6a430f962811188ab Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 22 Feb 2016 15:59:19 -0800 Subject: Add a sanity test for name aliasing --- build.yaml | 61 +- src/core/census/log.c | 600 -- src/core/census/log.h | 93 - src/core/census/mlog.c | 600 ++ src/core/census/mlog.h | 93 + src/core/compression/algorithm.c | 166 - src/core/compression/compression_algorithm.c | 166 + src/core/security/b64.c | 233 + src/core/security/b64.h | 52 + src/core/security/base64.c | 233 - src/core/security/base64.h | 52 - src/core/security/google_default_credentials.c | 2 +- src/core/security/json_token.c | 2 +- src/core/security/jwt_verifier.c | 2 +- src/core/security/security_connector.c | 14 +- src/core/support/file.c | 91 - src/core/support/file.h | 63 - src/core/support/file_posix.c | 85 - src/core/support/file_win32.c | 84 - src/core/support/load_file.c | 91 + src/core/support/load_file.h | 63 + src/core/support/tmpfile.h | 0 src/core/support/tmpfile_posix.c | 85 + src/core/support/tmpfile_win32.c | 84 + .../run_tests/sources_and_headers.json.template | 47 +- test/core/bad_ssl/gen_build_yaml.py | 4 +- test/core/bad_ssl/server.c | 113 - test/core/bad_ssl/server.h | 42 - test/core/bad_ssl/server_common.c | 113 + test/core/bad_ssl/server_common.h | 42 + test/core/bad_ssl/servers/alpn.c | 2 +- test/core/bad_ssl/servers/cert.c | 4 +- test/core/census/log_test.c | 589 -- test/core/census/mlog_test.c | 589 ++ test/core/end2end/fixtures/h2_ssl+poll.c | 13 +- test/core/end2end/fixtures/h2_ssl.c | 13 +- test/core/end2end/fixtures/h2_ssl_proxy.c | 11 +- test/core/end2end/gen_build_yaml.py | 6 +- test/core/end2end/tests/channel_connectivity.c | 174 - test/core/end2end/tests/channel_ping.c | 97 - test/core/end2end/tests/connectivity.c | 174 + test/core/end2end/tests/metadata.c | 265 - test/core/end2end/tests/ping.c | 97 + test/core/end2end/tests/simple_metadata.c | 265 + test/core/security/b64_test.c | 224 + test/core/security/base64_test.c | 224 - test/core/security/create_jwt.c | 2 +- test/core/security/credentials_test.c | 17 +- test/core/security/fetch_oauth2.c | 2 +- test/core/security/json_token_test.c | 7 +- test/core/security/jwt_verifier_test.c | 2 +- test/core/security/security_connector_test.c | 15 +- test/core/support/file_test.c | 173 - test/core/support/load_file_test.c | 173 + test/cpp/interop/server.cc | 274 - test/cpp/interop/server_main.cc | 274 + test/cpp/qps/client.h | 4 +- test/cpp/qps/client_async.cc | 28 +- test/cpp/qps/client_sync.cc | 2 +- test/cpp/qps/server.h | 2 +- test/cpp/qps/server_sync.cc | 12 +- test/cpp/qps/timer.cc | 71 - test/cpp/qps/timer.h | 57 - test/cpp/qps/usage_timer.cc | 71 + test/cpp/qps/usage_timer.h | 57 + .../run_tests/sanity/check_sources_and_headers.py | 54 +- tools/run_tests/sources_and_headers.json | 5970 +++++++++++++------- 67 files changed, 7705 insertions(+), 5685 deletions(-) delete mode 100644 src/core/census/log.c delete mode 100644 src/core/census/log.h create mode 100644 src/core/census/mlog.c create mode 100644 src/core/census/mlog.h delete mode 100644 src/core/compression/algorithm.c create mode 100644 src/core/compression/compression_algorithm.c create mode 100644 src/core/security/b64.c create mode 100644 src/core/security/b64.h delete mode 100644 src/core/security/base64.c delete mode 100644 src/core/security/base64.h delete mode 100644 src/core/support/file.c delete mode 100644 src/core/support/file.h delete mode 100644 src/core/support/file_posix.c delete mode 100644 src/core/support/file_win32.c create mode 100644 src/core/support/load_file.c create mode 100644 src/core/support/load_file.h create mode 100644 src/core/support/tmpfile.h create mode 100644 src/core/support/tmpfile_posix.c create mode 100644 src/core/support/tmpfile_win32.c delete mode 100644 test/core/bad_ssl/server.c delete mode 100644 test/core/bad_ssl/server.h create mode 100644 test/core/bad_ssl/server_common.c create mode 100644 test/core/bad_ssl/server_common.h delete mode 100644 test/core/census/log_test.c create mode 100644 test/core/census/mlog_test.c delete mode 100644 test/core/end2end/tests/channel_connectivity.c delete mode 100644 test/core/end2end/tests/channel_ping.c create mode 100644 test/core/end2end/tests/connectivity.c delete mode 100644 test/core/end2end/tests/metadata.c create mode 100644 test/core/end2end/tests/ping.c create mode 100644 test/core/end2end/tests/simple_metadata.c create mode 100644 test/core/security/b64_test.c delete mode 100644 test/core/security/base64_test.c delete mode 100644 test/core/support/file_test.c create mode 100644 test/core/support/load_file_test.c delete mode 100644 test/cpp/interop/server.cc create mode 100644 test/cpp/interop/server_main.cc delete mode 100644 test/cpp/qps/timer.cc delete mode 100644 test/cpp/qps/timer.h create mode 100644 test/cpp/qps/usage_timer.cc create mode 100644 test/cpp/qps/usage_timer.h diff --git a/build.yaml b/build.yaml index cb6cb56844..9a20f2a55a 100644 --- a/build.yaml +++ b/build.yaml @@ -14,12 +14,12 @@ filegroups: - include/grpc/census.h headers: - src/core/census/aggregation.h - - src/core/census/log.h + - src/core/census/mlog.h - src/core/census/rpc_metric_id.h src: - src/core/census/context.c - src/core/census/initialize.c - - src/core/census/log.c + - src/core/census/mlog.c - src/core/census/operation.c - src/core/census/placeholders.c - src/core/census/tracing.c @@ -57,13 +57,14 @@ filegroups: - src/core/profiling/timers.h - src/core/support/block_annotate.h - src/core/support/env.h - - src/core/support/file.h + - src/core/support/load_file.h - src/core/support/murmur_hash.h - src/core/support/stack_lockfree.h - src/core/support/string.h - src/core/support/string_win32.h - src/core/support/thd_internal.h - src/core/support/time_precise.h + - src/core/support/tmpfile.h src: - src/core/profiling/basic_timers.c - src/core/profiling/stap_timers.c @@ -77,11 +78,9 @@ filegroups: - src/core/support/env_linux.c - src/core/support/env_posix.c - src/core/support/env_win32.c - - src/core/support/file.c - - src/core/support/file_posix.c - - src/core/support/file_win32.c - src/core/support/histogram.c - src/core/support/host_port.c + - src/core/support/load_file.c - src/core/support/log.c - src/core/support/log_android.c - src/core/support/log_linux.c @@ -107,6 +106,8 @@ filegroups: - src/core/support/time_precise.c - src/core/support/time_win32.c - src/core/support/tls_pthread.c + - src/core/support/tmpfile_posix.c + - src/core/support/tmpfile_win32.c - src/core/support/wrap_memcpy.c - name: gpr_codegen public_headers: @@ -388,7 +389,7 @@ filegroups: - src/core/client_config/subchannel_factory.c - src/core/client_config/subchannel_index.c - src/core/client_config/uri_parser.c - - src/core/compression/algorithm.c + - src/core/compression/compression_algorithm.c - src/core/compression/message_compress.c - src/core/debug/trace.c - src/core/httpcli/format_request.c @@ -498,7 +499,7 @@ filegroups: - name: grpc_secure headers: - src/core/security/auth_filters.h - - src/core/security/base64.h + - src/core/security/b64.h - src/core/security/credentials.h - src/core/security/handshake.h - src/core/security/json_token.h @@ -513,7 +514,7 @@ filegroups: - src/core/tsi/transport_security_interface.h src: - src/core/httpcli/httpcli_security_connector.c - - src/core/security/base64.c + - src/core/security/b64.c - src/core/security/client_auth_filter.c - src/core/security/credentials.c - src/core/security/credentials_metadata.c @@ -852,7 +853,7 @@ libs: - src/proto/grpc/testing/empty.proto - src/proto/grpc/testing/messages.proto - src/proto/grpc/testing/test.proto - - test/cpp/interop/server.cc + - test/cpp/interop/server_main.cc deps: - interop_server_helper - grpc++_test_util @@ -876,7 +877,7 @@ libs: - test/cpp/qps/report.h - test/cpp/qps/server.h - test/cpp/qps/stats.h - - test/cpp/qps/timer.h + - test/cpp/qps/usage_timer.h - test/cpp/util/benchmark_config.h src: - src/proto/grpc/testing/messages.proto @@ -894,7 +895,7 @@ libs: - test/cpp/qps/report.cc - test/cpp/qps/server_async.cc - test/cpp/qps/server_sync.cc - - test/cpp/qps/timer.cc + - test/cpp/qps/usage_timer.cc - test/cpp/util/benchmark_config.cc deps: - grpc_test_util @@ -978,16 +979,6 @@ targets: - grpc - gpr_test_util - gpr -- name: census_log_test - build: test - language: c - src: - - test/core/census/log_test.c - deps: - - grpc_test_util - - grpc - - gpr_test_util - - gpr - name: channel_create_test build: test language: c @@ -1209,27 +1200,27 @@ targets: deps: - gpr_test_util - gpr -- name: gpr_file_test +- name: gpr_histogram_test build: test language: c src: - - test/core/support/file_test.c + - test/core/support/histogram_test.c deps: - gpr_test_util - gpr -- name: gpr_histogram_test +- name: gpr_host_port_test build: test language: c src: - - test/core/support/histogram_test.c + - test/core/support/host_port_test.c deps: - gpr_test_util - gpr -- name: gpr_host_port_test +- name: gpr_load_file_test build: test language: c src: - - test/core/support/host_port_test.c + - test/core/support/load_file_test.c deps: - gpr_test_util - gpr @@ -1326,11 +1317,11 @@ targets: - grpc - gpr_test_util - gpr -- name: grpc_base64_test +- name: grpc_b64_test build: test language: c src: - - test/core/security/base64_test.c + - test/core/security/b64_test.c deps: - grpc_test_util - grpc @@ -1642,6 +1633,16 @@ targets: - grpc - gpr_test_util - gpr +- name: mlog_test + build: test + language: c + src: + - test/core/census/mlog_test.c + deps: + - grpc_test_util + - grpc + - gpr_test_util + - gpr - name: multiple_server_queues_test build: test language: c diff --git a/src/core/census/log.c b/src/core/census/log.c deleted file mode 100644 index 91b26941b8..0000000000 --- a/src/core/census/log.c +++ /dev/null @@ -1,600 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -// Implements an efficient in-memory log, optimized for multiple writers and -// a single reader. Available log space is divided up in blocks of -// CENSUS_LOG_2_MAX_RECORD_SIZE bytes. A block can be in one of the following -// three data structures: -// - Free blocks (free_block_list) -// - Blocks with unread data (dirty_block_list) -// - Blocks currently attached to cores (core_local_blocks[]) -// -// census_log_start_write() moves a block from core_local_blocks[] to the end of -// dirty_block_list when block: -// - is out-of-space OR -// - has an incomplete record (an incomplete record occurs when a thread calls -// census_log_start_write() and is context-switched before calling -// census_log_end_write() -// So, blocks in dirty_block_list are ordered, from oldest to newest, by the -// time when block is detached from the core. -// -// census_log_read_next() first iterates over dirty_block_list and then -// core_local_blocks[]. It moves completely read blocks from dirty_block_list -// to free_block_list. Blocks in core_local_blocks[] are not freed, even when -// completely read. -// -// If the log is configured to discard old records and free_block_list is empty, -// census_log_start_write() iterates over dirty_block_list to allocate a -// new block. It moves the oldest available block (no pending read/write) to -// core_local_blocks[]. -// -// core_local_block_struct is used to implement a map from core id to the block -// associated with that core. This mapping is advisory. It is possible that the -// block returned by this mapping is no longer associated with that core. This -// mapping is updated, lazily, by census_log_start_write(). -// -// Locking in block struct: -// -// Exclusive g_log.lock must be held before calling any functions operating on -// block structs except census_log_start_write() and census_log_end_write(). -// -// Writes to a block are serialized via writer_lock. census_log_start_write() -// acquires this lock and census_log_end_write() releases it. On failure to -// acquire the lock, writer allocates a new block for the current core and -// updates core_local_block accordingly. -// -// Simultaneous read and write access is allowed. Readers can safely read up to -// committed bytes (bytes_committed). -// -// reader_lock protects the block, currently being read, from getting recycled. -// start_read() acquires reader_lock and end_read() releases the lock. -// -// Read/write access to a block is disabled via try_disable_access(). It returns -// with both writer_lock and reader_lock held. These locks are subsequently -// released by enable_access() to enable access to the block. -// -// A note on naming: Most function/struct names are prepended by cl_ -// (shorthand for census_log). Further, functions that manipulate structures -// include the name of the structure, which will be passed as the first -// argument. E.g. cl_block_initialize() will initialize a cl_block. - -#include "src/core/census/log.h" -#include -#include -#include -#include -#include -#include -#include -#include - -// End of platform specific code - -typedef struct census_log_block_list_struct { - struct census_log_block_list_struct* next; - struct census_log_block_list_struct* prev; - struct census_log_block* block; -} cl_block_list_struct; - -typedef struct census_log_block { - // Pointer to underlying buffer. - char* buffer; - gpr_atm writer_lock; - gpr_atm reader_lock; - // Keeps completely written bytes. Declared atomic because accessed - // simultaneously by reader and writer. - gpr_atm bytes_committed; - // Bytes already read. - size_t bytes_read; - // Links for list. - cl_block_list_struct link; -// We want this structure to be cacheline aligned. We assume the following -// sizes for the various parts on 32/64bit systems: -// type 32b size 64b size -// char* 4 8 -// 3x gpr_atm 12 24 -// size_t 4 8 -// cl_block_list_struct 12 24 -// TOTAL 32 64 -// -// Depending on the size of our cacheline and the architecture, we -// selectively add char buffering to this structure. The size is checked -// via assert in census_log_initialize(). -#if defined(GPR_ARCH_64) -#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 64) -#else -#if defined(GPR_ARCH_32) -#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 32) -#else -#error "Unknown architecture" -#endif -#endif -#if CL_BLOCK_PAD_SIZE > 0 - char padding[CL_BLOCK_PAD_SIZE]; -#endif -} cl_block; - -// A list of cl_blocks, doubly-linked through cl_block::link. -typedef struct census_log_block_list { - int32_t count; // Number of items in list. - cl_block_list_struct ht; // head/tail of linked list. -} cl_block_list; - -// Cacheline aligned block pointers to avoid false sharing. Block pointer must -// be initialized via set_block(), before calling other functions -typedef struct census_log_core_local_block { - gpr_atm block; -// Ensure cachline alignment: we assume sizeof(gpr_atm) == 4 or 8 -#if defined(GPR_ARCH_64) -#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 8) -#else -#if defined(GPR_ARCH_32) -#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 4) -#else -#error "Unknown architecture" -#endif -#endif -#if CL_CORE_LOCAL_BLOCK_PAD_SIZE > 0 - char padding[CL_CORE_LOCAL_BLOCK_PAD_SIZE]; -#endif -} cl_core_local_block; - -struct census_log { - int discard_old_records; - // Number of cores (aka hardware-contexts) - unsigned num_cores; - // number of CENSUS_LOG_2_MAX_RECORD_SIZE blocks in log - uint32_t num_blocks; - cl_block* blocks; // Block metadata. - cl_core_local_block* core_local_blocks; // Keeps core to block mappings. - gpr_mu lock; - int initialized; // has log been initialized? - // Keeps the state of the reader iterator. A value of 0 indicates that - // iterator has reached the end. census_log_init_reader() resets the value - // to num_core to restart iteration. - uint32_t read_iterator_state; - // Points to the block being read. If non-NULL, the block is locked for - // reading(block_being_read_->reader_lock is held). - cl_block* block_being_read; - char* buffer; - cl_block_list free_block_list; - cl_block_list dirty_block_list; - gpr_atm out_of_space_count; -}; - -// Single internal log. -static struct census_log g_log; - -// Functions that operate on an atomic memory location used as a lock. - -// Returns non-zero if lock is acquired. -static int cl_try_lock(gpr_atm* lock) { return gpr_atm_acq_cas(lock, 0, 1); } - -static void cl_unlock(gpr_atm* lock) { gpr_atm_rel_store(lock, 0); } - -// Functions that operate on cl_core_local_block's. - -static void cl_core_local_block_set_block(cl_core_local_block* clb, - cl_block* block) { - gpr_atm_rel_store(&clb->block, (gpr_atm)block); -} - -static cl_block* cl_core_local_block_get_block(cl_core_local_block* clb) { - return (cl_block*)gpr_atm_acq_load(&clb->block); -} - -// Functions that operate on cl_block_list_struct's. - -static void cl_block_list_struct_initialize(cl_block_list_struct* bls, - cl_block* block) { - bls->next = bls->prev = bls; - bls->block = block; -} - -// Functions that operate on cl_block_list's. - -static void cl_block_list_initialize(cl_block_list* list) { - list->count = 0; - cl_block_list_struct_initialize(&list->ht, NULL); -} - -// Returns head of *this, or NULL if empty. -static cl_block* cl_block_list_head(cl_block_list* list) { - return list->ht.next->block; -} - -// Insert element *e after *pos. -static void cl_block_list_insert(cl_block_list* list, cl_block_list_struct* pos, - cl_block_list_struct* e) { - list->count++; - e->next = pos->next; - e->prev = pos; - e->next->prev = e; - e->prev->next = e; -} - -// Insert block at the head of the list -static void cl_block_list_insert_at_head(cl_block_list* list, cl_block* block) { - cl_block_list_insert(list, &list->ht, &block->link); -} - -// Insert block at the tail of the list. -static void cl_block_list_insert_at_tail(cl_block_list* list, cl_block* block) { - cl_block_list_insert(list, list->ht.prev, &block->link); -} - -// Removes block *b. Requires *b be in the list. -static void cl_block_list_remove(cl_block_list* list, cl_block* b) { - list->count--; - b->link.next->prev = b->link.prev; - b->link.prev->next = b->link.next; -} - -// Functions that operate on cl_block's - -static void cl_block_initialize(cl_block* block, char* buffer) { - block->buffer = buffer; - gpr_atm_rel_store(&block->writer_lock, 0); - gpr_atm_rel_store(&block->reader_lock, 0); - gpr_atm_rel_store(&block->bytes_committed, 0); - block->bytes_read = 0; - cl_block_list_struct_initialize(&block->link, block); -} - -// Guards against exposing partially written buffer to the reader. -static void cl_block_set_bytes_committed(cl_block* block, - size_t bytes_committed) { - gpr_atm_rel_store(&block->bytes_committed, (gpr_atm)bytes_committed); -} - -static size_t cl_block_get_bytes_committed(cl_block* block) { - return (size_t)gpr_atm_acq_load(&block->bytes_committed); -} - -// Tries to disable future read/write access to this block. Succeeds if: -// - no in-progress write AND -// - no in-progress read AND -// - 'discard_data' set to true OR no unread data -// On success, clears the block state and returns with writer_lock_ and -// reader_lock_ held. These locks are released by a subsequent -// cl_block_access_enable() call. -static bool cl_block_try_disable_access(cl_block* block, int discard_data) { - if (!cl_try_lock(&block->writer_lock)) { - return false; - } - if (!cl_try_lock(&block->reader_lock)) { - cl_unlock(&block->writer_lock); - return false; - } - if (!discard_data && - (block->bytes_read != cl_block_get_bytes_committed(block))) { - cl_unlock(&block->reader_lock); - cl_unlock(&block->writer_lock); - return false; - } - cl_block_set_bytes_committed(block, 0); - block->bytes_read = 0; - return true; -} - -static void cl_block_enable_access(cl_block* block) { - cl_unlock(&block->reader_lock); - cl_unlock(&block->writer_lock); -} - -// Returns with writer_lock held. -static void* cl_block_start_write(cl_block* block, size_t size) { - if (!cl_try_lock(&block->writer_lock)) { - return NULL; - } - size_t bytes_committed = cl_block_get_bytes_committed(block); - if (bytes_committed + size > CENSUS_LOG_MAX_RECORD_SIZE) { - cl_unlock(&block->writer_lock); - return NULL; - } - return block->buffer + bytes_committed; -} - -// Releases writer_lock and increments committed bytes by 'bytes_written'. -// 'bytes_written' must be <= 'size' specified in the corresponding -// StartWrite() call. This function is thread-safe. -static void cl_block_end_write(cl_block* block, size_t bytes_written) { - cl_block_set_bytes_committed( - block, cl_block_get_bytes_committed(block) + bytes_written); - cl_unlock(&block->writer_lock); -} - -// Returns a pointer to the first unread byte in buffer. The number of bytes -// available are returned in 'bytes_available'. Acquires reader lock that is -// released by a subsequent cl_block_end_read() call. Returns NULL if: -// - read in progress -// - no data available -static void* cl_block_start_read(cl_block* block, size_t* bytes_available) { - if (!cl_try_lock(&block->reader_lock)) { - return NULL; - } - // bytes_committed may change from under us. Use bytes_available to update - // bytes_read below. - size_t bytes_committed = cl_block_get_bytes_committed(block); - GPR_ASSERT(bytes_committed >= block->bytes_read); - *bytes_available = bytes_committed - block->bytes_read; - if (*bytes_available == 0) { - cl_unlock(&block->reader_lock); - return NULL; - } - void* record = block->buffer + block->bytes_read; - block->bytes_read += *bytes_available; - return record; -} - -static void cl_block_end_read(cl_block* block) { - cl_unlock(&block->reader_lock); -} - -// Internal functions operating on g_log - -// Allocates a new free block (or recycles an available dirty block if log is -// configured to discard old records). Returns NULL if out-of-space. -static cl_block* cl_allocate_block(void) { - cl_block* block = cl_block_list_head(&g_log.free_block_list); - if (block != NULL) { - cl_block_list_remove(&g_log.free_block_list, block); - return block; - } - if (!g_log.discard_old_records) { - // No free block and log is configured to keep old records. - return NULL; - } - // Recycle dirty block. Start from the oldest. - for (block = cl_block_list_head(&g_log.dirty_block_list); block != NULL; - block = block->link.next->block) { - if (cl_block_try_disable_access(block, 1 /* discard data */)) { - cl_block_list_remove(&g_log.dirty_block_list, block); - return block; - } - } - return NULL; -} - -// Allocates a new block and updates core id => block mapping. 'old_block' -// points to the block that the caller thinks is attached to -// 'core_id'. 'old_block' may be NULL. Returns true if: -// - allocated a new block OR -// - 'core_id' => 'old_block' mapping changed (another thread allocated a -// block before lock was acquired). -static bool cl_allocate_core_local_block(uint32_t core_id, - cl_block* old_block) { - // Now that we have the lock, check if core-local mapping has changed. - cl_core_local_block* core_local_block = &g_log.core_local_blocks[core_id]; - cl_block* block = cl_core_local_block_get_block(core_local_block); - if ((block != NULL) && (block != old_block)) { - return true; - } - if (block != NULL) { - cl_core_local_block_set_block(core_local_block, NULL); - cl_block_list_insert_at_tail(&g_log.dirty_block_list, block); - } - block = cl_allocate_block(); - if (block == NULL) { - return false; - } - cl_core_local_block_set_block(core_local_block, block); - cl_block_enable_access(block); - return true; -} - -static cl_block* cl_get_block(void* record) { - uintptr_t p = (uintptr_t)((char*)record - g_log.buffer); - uintptr_t index = p >> CENSUS_LOG_2_MAX_RECORD_SIZE; - return &g_log.blocks[index]; -} - -// Gets the next block to read and tries to free 'prev' block (if not NULL). -// Returns NULL if reached the end. -static cl_block* cl_next_block_to_read(cl_block* prev) { - cl_block* block = NULL; - if (g_log.read_iterator_state == g_log.num_cores) { - // We are traversing dirty list; find the next dirty block. - if (prev != NULL) { - // Try to free the previous block if there is no unread data. This - // block - // may have unread data if previously incomplete record completed - // between - // read_next() calls. - block = prev->link.next->block; - if (cl_block_try_disable_access(prev, 0 /* do not discard data */)) { - cl_block_list_remove(&g_log.dirty_block_list, prev); - cl_block_list_insert_at_head(&g_log.free_block_list, prev); - } - } else { - block = cl_block_list_head(&g_log.dirty_block_list); - } - if (block != NULL) { - return block; - } - // We are done with the dirty list; moving on to core-local blocks. - } - while (g_log.read_iterator_state > 0) { - g_log.read_iterator_state--; - block = cl_core_local_block_get_block( - &g_log.core_local_blocks[g_log.read_iterator_state]); - if (block != NULL) { - return block; - } - } - return NULL; -} - -#define CL_LOG_2_MB 20 // 2^20 = 1MB - -// External functions: primary stats_log interface -void census_log_initialize(size_t size_in_mb, int discard_old_records) { - // Check cacheline alignment. - GPR_ASSERT(sizeof(cl_block) % GPR_CACHELINE_SIZE == 0); - GPR_ASSERT(sizeof(cl_core_local_block) % GPR_CACHELINE_SIZE == 0); - GPR_ASSERT(!g_log.initialized); - g_log.discard_old_records = discard_old_records; - g_log.num_cores = gpr_cpu_num_cores(); - // Ensure that we will not get any overflow in calaculating num_blocks - GPR_ASSERT(CL_LOG_2_MB >= CENSUS_LOG_2_MAX_RECORD_SIZE); - GPR_ASSERT(size_in_mb < 1000); - // Ensure at least 2x as many blocks as there are cores. - g_log.num_blocks = - (uint32_t)GPR_MAX(2 * g_log.num_cores, (size_in_mb << CL_LOG_2_MB) >> - CENSUS_LOG_2_MAX_RECORD_SIZE); - gpr_mu_init(&g_log.lock); - g_log.read_iterator_state = 0; - g_log.block_being_read = NULL; - g_log.core_local_blocks = (cl_core_local_block*)gpr_malloc_aligned( - g_log.num_cores * sizeof(cl_core_local_block), GPR_CACHELINE_SIZE_LOG); - memset(g_log.core_local_blocks, 0, - g_log.num_cores * sizeof(cl_core_local_block)); - g_log.blocks = (cl_block*)gpr_malloc_aligned( - g_log.num_blocks * sizeof(cl_block), GPR_CACHELINE_SIZE_LOG); - memset(g_log.blocks, 0, g_log.num_blocks * sizeof(cl_block)); - g_log.buffer = gpr_malloc(g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE); - memset(g_log.buffer, 0, g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE); - cl_block_list_initialize(&g_log.free_block_list); - cl_block_list_initialize(&g_log.dirty_block_list); - for (uint32_t i = 0; i < g_log.num_blocks; ++i) { - cl_block* block = g_log.blocks + i; - cl_block_initialize(block, g_log.buffer + (CENSUS_LOG_MAX_RECORD_SIZE * i)); - cl_block_try_disable_access(block, 1 /* discard data */); - cl_block_list_insert_at_tail(&g_log.free_block_list, block); - } - gpr_atm_rel_store(&g_log.out_of_space_count, 0); - g_log.initialized = 1; -} - -void census_log_shutdown(void) { - GPR_ASSERT(g_log.initialized); - gpr_mu_destroy(&g_log.lock); - gpr_free_aligned(g_log.core_local_blocks); - g_log.core_local_blocks = NULL; - gpr_free_aligned(g_log.blocks); - g_log.blocks = NULL; - gpr_free(g_log.buffer); - g_log.buffer = NULL; - g_log.initialized = 0; -} - -void* census_log_start_write(size_t size) { - // Used to bound number of times block allocation is attempted. - GPR_ASSERT(size > 0); - GPR_ASSERT(g_log.initialized); - if (size > CENSUS_LOG_MAX_RECORD_SIZE) { - return NULL; - } - uint32_t attempts_remaining = g_log.num_blocks; - uint32_t core_id = gpr_cpu_current_cpu(); - do { - void* record = NULL; - cl_block* block = - cl_core_local_block_get_block(&g_log.core_local_blocks[core_id]); - if (block && (record = cl_block_start_write(block, size))) { - return record; - } - // Need to allocate a new block. We are here if: - // - No block associated with the core OR - // - Write in-progress on the block OR - // - block is out of space - gpr_mu_lock(&g_log.lock); - bool allocated = cl_allocate_core_local_block(core_id, block); - gpr_mu_unlock(&g_log.lock); - if (!allocated) { - gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1); - return NULL; - } - } while (attempts_remaining--); - // Give up. - gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1); - return NULL; -} - -void census_log_end_write(void* record, size_t bytes_written) { - GPR_ASSERT(g_log.initialized); - cl_block_end_write(cl_get_block(record), bytes_written); -} - -void census_log_init_reader(void) { - GPR_ASSERT(g_log.initialized); - gpr_mu_lock(&g_log.lock); - // If a block is locked for reading unlock it. - if (g_log.block_being_read != NULL) { - cl_block_end_read(g_log.block_being_read); - g_log.block_being_read = NULL; - } - g_log.read_iterator_state = g_log.num_cores; - gpr_mu_unlock(&g_log.lock); -} - -const void* census_log_read_next(size_t* bytes_available) { - GPR_ASSERT(g_log.initialized); - gpr_mu_lock(&g_log.lock); - if (g_log.block_being_read != NULL) { - cl_block_end_read(g_log.block_being_read); - } - do { - g_log.block_being_read = cl_next_block_to_read(g_log.block_being_read); - if (g_log.block_being_read != NULL) { - void* record = - cl_block_start_read(g_log.block_being_read, bytes_available); - if (record != NULL) { - gpr_mu_unlock(&g_log.lock); - return record; - } - } - } while (g_log.block_being_read != NULL); - gpr_mu_unlock(&g_log.lock); - return NULL; -} - -size_t census_log_remaining_space(void) { - GPR_ASSERT(g_log.initialized); - size_t space = 0; - gpr_mu_lock(&g_log.lock); - if (g_log.discard_old_records) { - // Remaining space is not meaningful; just return the entire log space. - space = g_log.num_blocks << CENSUS_LOG_2_MAX_RECORD_SIZE; - } else { - GPR_ASSERT(g_log.free_block_list.count >= 0); - space = (size_t)g_log.free_block_list.count * CENSUS_LOG_MAX_RECORD_SIZE; - } - gpr_mu_unlock(&g_log.lock); - return space; -} - -int64_t census_log_out_of_space_count(void) { - GPR_ASSERT(g_log.initialized); - return gpr_atm_acq_load(&g_log.out_of_space_count); -} diff --git a/src/core/census/log.h b/src/core/census/log.h deleted file mode 100644 index 05daea066f..0000000000 --- a/src/core/census/log.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_INTERNAL_CORE_CENSUS_LOG_H -#define GRPC_INTERNAL_CORE_CENSUS_LOG_H - -#include -#include - -/* Maximum record size, in bytes. */ -#define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */ -#define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE) - -/* Initialize the statistics logging subsystem with the given log size. A log - size of 0 will result in the smallest possible log for the platform - (approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If - discard_old_records is non-zero, then new records will displace older ones - when the log is full. This function must be called before any other - census_log functions. -*/ -void census_log_initialize(size_t size_in_mb, int discard_old_records); - -/* Shutdown the logging subsystem. Caller must ensure that: - - no in progress or future call to any census_log functions - - no incomplete records -*/ -void census_log_shutdown(void); - -/* Allocates and returns a 'size' bytes record and marks it in use. A - subsequent census_log_end_write() marks the record complete. The - 'bytes_written' census_log_end_write() argument must be <= - 'size'. Returns NULL if out-of-space AND: - - log is configured to keep old records OR - - all blocks are pinned by incomplete records. -*/ -void* census_log_start_write(size_t size); - -void census_log_end_write(void* record, size_t bytes_written); - -void census_log_init_reader(void); - -/* census_log_read_next() iterates over blocks with data and for each block - returns a pointer to the first unread byte. The number of bytes that can be - read are returned in 'bytes_available'. Reader is expected to read all - available data. Reading the data consumes it i.e. it cannot be read again. - census_log_read_next() returns NULL if the end is reached i.e last block - is read. census_log_init_reader() starts the iteration or aborts the - current iteration. -*/ -const void* census_log_read_next(size_t* bytes_available); - -/* Returns estimated remaining space across all blocks, in bytes. If log is - configured to discard old records, returns total log space. Otherwise, - returns space available in empty blocks (partially filled blocks are - treated as full). -*/ -size_t census_log_remaining_space(void); - -/* Returns the number of times gprc_stats_log_start_write() failed due to - out-of-space. */ -int64_t census_log_out_of_space_count(void); - -#endif /* GRPC_INTERNAL_CORE_CENSUS_LOG_H */ diff --git a/src/core/census/mlog.c b/src/core/census/mlog.c new file mode 100644 index 0000000000..a2cc46d3f2 --- /dev/null +++ b/src/core/census/mlog.c @@ -0,0 +1,600 @@ +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +// Implements an efficient in-memory log, optimized for multiple writers and +// a single reader. Available log space is divided up in blocks of +// CENSUS_LOG_2_MAX_RECORD_SIZE bytes. A block can be in one of the following +// three data structures: +// - Free blocks (free_block_list) +// - Blocks with unread data (dirty_block_list) +// - Blocks currently attached to cores (core_local_blocks[]) +// +// census_log_start_write() moves a block from core_local_blocks[] to the end of +// dirty_block_list when block: +// - is out-of-space OR +// - has an incomplete record (an incomplete record occurs when a thread calls +// census_log_start_write() and is context-switched before calling +// census_log_end_write() +// So, blocks in dirty_block_list are ordered, from oldest to newest, by the +// time when block is detached from the core. +// +// census_log_read_next() first iterates over dirty_block_list and then +// core_local_blocks[]. It moves completely read blocks from dirty_block_list +// to free_block_list. Blocks in core_local_blocks[] are not freed, even when +// completely read. +// +// If the log is configured to discard old records and free_block_list is empty, +// census_log_start_write() iterates over dirty_block_list to allocate a +// new block. It moves the oldest available block (no pending read/write) to +// core_local_blocks[]. +// +// core_local_block_struct is used to implement a map from core id to the block +// associated with that core. This mapping is advisory. It is possible that the +// block returned by this mapping is no longer associated with that core. This +// mapping is updated, lazily, by census_log_start_write(). +// +// Locking in block struct: +// +// Exclusive g_log.lock must be held before calling any functions operating on +// block structs except census_log_start_write() and census_log_end_write(). +// +// Writes to a block are serialized via writer_lock. census_log_start_write() +// acquires this lock and census_log_end_write() releases it. On failure to +// acquire the lock, writer allocates a new block for the current core and +// updates core_local_block accordingly. +// +// Simultaneous read and write access is allowed. Readers can safely read up to +// committed bytes (bytes_committed). +// +// reader_lock protects the block, currently being read, from getting recycled. +// start_read() acquires reader_lock and end_read() releases the lock. +// +// Read/write access to a block is disabled via try_disable_access(). It returns +// with both writer_lock and reader_lock held. These locks are subsequently +// released by enable_access() to enable access to the block. +// +// A note on naming: Most function/struct names are prepended by cl_ +// (shorthand for census_log). Further, functions that manipulate structures +// include the name of the structure, which will be passed as the first +// argument. E.g. cl_block_initialize() will initialize a cl_block. + +#include "src/core/census/mlog.h" +#include +#include +#include +#include +#include +#include +#include +#include + +// End of platform specific code + +typedef struct census_log_block_list_struct { + struct census_log_block_list_struct* next; + struct census_log_block_list_struct* prev; + struct census_log_block* block; +} cl_block_list_struct; + +typedef struct census_log_block { + // Pointer to underlying buffer. + char* buffer; + gpr_atm writer_lock; + gpr_atm reader_lock; + // Keeps completely written bytes. Declared atomic because accessed + // simultaneously by reader and writer. + gpr_atm bytes_committed; + // Bytes already read. + size_t bytes_read; + // Links for list. + cl_block_list_struct link; +// We want this structure to be cacheline aligned. We assume the following +// sizes for the various parts on 32/64bit systems: +// type 32b size 64b size +// char* 4 8 +// 3x gpr_atm 12 24 +// size_t 4 8 +// cl_block_list_struct 12 24 +// TOTAL 32 64 +// +// Depending on the size of our cacheline and the architecture, we +// selectively add char buffering to this structure. The size is checked +// via assert in census_log_initialize(). +#if defined(GPR_ARCH_64) +#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 64) +#else +#if defined(GPR_ARCH_32) +#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 32) +#else +#error "Unknown architecture" +#endif +#endif +#if CL_BLOCK_PAD_SIZE > 0 + char padding[CL_BLOCK_PAD_SIZE]; +#endif +} cl_block; + +// A list of cl_blocks, doubly-linked through cl_block::link. +typedef struct census_log_block_list { + int32_t count; // Number of items in list. + cl_block_list_struct ht; // head/tail of linked list. +} cl_block_list; + +// Cacheline aligned block pointers to avoid false sharing. Block pointer must +// be initialized via set_block(), before calling other functions +typedef struct census_log_core_local_block { + gpr_atm block; +// Ensure cachline alignment: we assume sizeof(gpr_atm) == 4 or 8 +#if defined(GPR_ARCH_64) +#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 8) +#else +#if defined(GPR_ARCH_32) +#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 4) +#else +#error "Unknown architecture" +#endif +#endif +#if CL_CORE_LOCAL_BLOCK_PAD_SIZE > 0 + char padding[CL_CORE_LOCAL_BLOCK_PAD_SIZE]; +#endif +} cl_core_local_block; + +struct census_log { + int discard_old_records; + // Number of cores (aka hardware-contexts) + unsigned num_cores; + // number of CENSUS_LOG_2_MAX_RECORD_SIZE blocks in log + uint32_t num_blocks; + cl_block* blocks; // Block metadata. + cl_core_local_block* core_local_blocks; // Keeps core to block mappings. + gpr_mu lock; + int initialized; // has log been initialized? + // Keeps the state of the reader iterator. A value of 0 indicates that + // iterator has reached the end. census_log_init_reader() resets the value + // to num_core to restart iteration. + uint32_t read_iterator_state; + // Points to the block being read. If non-NULL, the block is locked for + // reading(block_being_read_->reader_lock is held). + cl_block* block_being_read; + char* buffer; + cl_block_list free_block_list; + cl_block_list dirty_block_list; + gpr_atm out_of_space_count; +}; + +// Single internal log. +static struct census_log g_log; + +// Functions that operate on an atomic memory location used as a lock. + +// Returns non-zero if lock is acquired. +static int cl_try_lock(gpr_atm* lock) { return gpr_atm_acq_cas(lock, 0, 1); } + +static void cl_unlock(gpr_atm* lock) { gpr_atm_rel_store(lock, 0); } + +// Functions that operate on cl_core_local_block's. + +static void cl_core_local_block_set_block(cl_core_local_block* clb, + cl_block* block) { + gpr_atm_rel_store(&clb->block, (gpr_atm)block); +} + +static cl_block* cl_core_local_block_get_block(cl_core_local_block* clb) { + return (cl_block*)gpr_atm_acq_load(&clb->block); +} + +// Functions that operate on cl_block_list_struct's. + +static void cl_block_list_struct_initialize(cl_block_list_struct* bls, + cl_block* block) { + bls->next = bls->prev = bls; + bls->block = block; +} + +// Functions that operate on cl_block_list's. + +static void cl_block_list_initialize(cl_block_list* list) { + list->count = 0; + cl_block_list_struct_initialize(&list->ht, NULL); +} + +// Returns head of *this, or NULL if empty. +static cl_block* cl_block_list_head(cl_block_list* list) { + return list->ht.next->block; +} + +// Insert element *e after *pos. +static void cl_block_list_insert(cl_block_list* list, cl_block_list_struct* pos, + cl_block_list_struct* e) { + list->count++; + e->next = pos->next; + e->prev = pos; + e->next->prev = e; + e->prev->next = e; +} + +// Insert block at the head of the list +static void cl_block_list_insert_at_head(cl_block_list* list, cl_block* block) { + cl_block_list_insert(list, &list->ht, &block->link); +} + +// Insert block at the tail of the list. +static void cl_block_list_insert_at_tail(cl_block_list* list, cl_block* block) { + cl_block_list_insert(list, list->ht.prev, &block->link); +} + +// Removes block *b. Requires *b be in the list. +static void cl_block_list_remove(cl_block_list* list, cl_block* b) { + list->count--; + b->link.next->prev = b->link.prev; + b->link.prev->next = b->link.next; +} + +// Functions that operate on cl_block's + +static void cl_block_initialize(cl_block* block, char* buffer) { + block->buffer = buffer; + gpr_atm_rel_store(&block->writer_lock, 0); + gpr_atm_rel_store(&block->reader_lock, 0); + gpr_atm_rel_store(&block->bytes_committed, 0); + block->bytes_read = 0; + cl_block_list_struct_initialize(&block->link, block); +} + +// Guards against exposing partially written buffer to the reader. +static void cl_block_set_bytes_committed(cl_block* block, + size_t bytes_committed) { + gpr_atm_rel_store(&block->bytes_committed, (gpr_atm)bytes_committed); +} + +static size_t cl_block_get_bytes_committed(cl_block* block) { + return (size_t)gpr_atm_acq_load(&block->bytes_committed); +} + +// Tries to disable future read/write access to this block. Succeeds if: +// - no in-progress write AND +// - no in-progress read AND +// - 'discard_data' set to true OR no unread data +// On success, clears the block state and returns with writer_lock_ and +// reader_lock_ held. These locks are released by a subsequent +// cl_block_access_enable() call. +static bool cl_block_try_disable_access(cl_block* block, int discard_data) { + if (!cl_try_lock(&block->writer_lock)) { + return false; + } + if (!cl_try_lock(&block->reader_lock)) { + cl_unlock(&block->writer_lock); + return false; + } + if (!discard_data && + (block->bytes_read != cl_block_get_bytes_committed(block))) { + cl_unlock(&block->reader_lock); + cl_unlock(&block->writer_lock); + return false; + } + cl_block_set_bytes_committed(block, 0); + block->bytes_read = 0; + return true; +} + +static void cl_block_enable_access(cl_block* block) { + cl_unlock(&block->reader_lock); + cl_unlock(&block->writer_lock); +} + +// Returns with writer_lock held. +static void* cl_block_start_write(cl_block* block, size_t size) { + if (!cl_try_lock(&block->writer_lock)) { + return NULL; + } + size_t bytes_committed = cl_block_get_bytes_committed(block); + if (bytes_committed + size > CENSUS_LOG_MAX_RECORD_SIZE) { + cl_unlock(&block->writer_lock); + return NULL; + } + return block->buffer + bytes_committed; +} + +// Releases writer_lock and increments committed bytes by 'bytes_written'. +// 'bytes_written' must be <= 'size' specified in the corresponding +// StartWrite() call. This function is thread-safe. +static void cl_block_end_write(cl_block* block, size_t bytes_written) { + cl_block_set_bytes_committed( + block, cl_block_get_bytes_committed(block) + bytes_written); + cl_unlock(&block->writer_lock); +} + +// Returns a pointer to the first unread byte in buffer. The number of bytes +// available are returned in 'bytes_available'. Acquires reader lock that is +// released by a subsequent cl_block_end_read() call. Returns NULL if: +// - read in progress +// - no data available +static void* cl_block_start_read(cl_block* block, size_t* bytes_available) { + if (!cl_try_lock(&block->reader_lock)) { + return NULL; + } + // bytes_committed may change from under us. Use bytes_available to update + // bytes_read below. + size_t bytes_committed = cl_block_get_bytes_committed(block); + GPR_ASSERT(bytes_committed >= block->bytes_read); + *bytes_available = bytes_committed - block->bytes_read; + if (*bytes_available == 0) { + cl_unlock(&block->reader_lock); + return NULL; + } + void* record = block->buffer + block->bytes_read; + block->bytes_read += *bytes_available; + return record; +} + +static void cl_block_end_read(cl_block* block) { + cl_unlock(&block->reader_lock); +} + +// Internal functions operating on g_log + +// Allocates a new free block (or recycles an available dirty block if log is +// configured to discard old records). Returns NULL if out-of-space. +static cl_block* cl_allocate_block(void) { + cl_block* block = cl_block_list_head(&g_log.free_block_list); + if (block != NULL) { + cl_block_list_remove(&g_log.free_block_list, block); + return block; + } + if (!g_log.discard_old_records) { + // No free block and log is configured to keep old records. + return NULL; + } + // Recycle dirty block. Start from the oldest. + for (block = cl_block_list_head(&g_log.dirty_block_list); block != NULL; + block = block->link.next->block) { + if (cl_block_try_disable_access(block, 1 /* discard data */)) { + cl_block_list_remove(&g_log.dirty_block_list, block); + return block; + } + } + return NULL; +} + +// Allocates a new block and updates core id => block mapping. 'old_block' +// points to the block that the caller thinks is attached to +// 'core_id'. 'old_block' may be NULL. Returns true if: +// - allocated a new block OR +// - 'core_id' => 'old_block' mapping changed (another thread allocated a +// block before lock was acquired). +static bool cl_allocate_core_local_block(uint32_t core_id, + cl_block* old_block) { + // Now that we have the lock, check if core-local mapping has changed. + cl_core_local_block* core_local_block = &g_log.core_local_blocks[core_id]; + cl_block* block = cl_core_local_block_get_block(core_local_block); + if ((block != NULL) && (block != old_block)) { + return true; + } + if (block != NULL) { + cl_core_local_block_set_block(core_local_block, NULL); + cl_block_list_insert_at_tail(&g_log.dirty_block_list, block); + } + block = cl_allocate_block(); + if (block == NULL) { + return false; + } + cl_core_local_block_set_block(core_local_block, block); + cl_block_enable_access(block); + return true; +} + +static cl_block* cl_get_block(void* record) { + uintptr_t p = (uintptr_t)((char*)record - g_log.buffer); + uintptr_t index = p >> CENSUS_LOG_2_MAX_RECORD_SIZE; + return &g_log.blocks[index]; +} + +// Gets the next block to read and tries to free 'prev' block (if not NULL). +// Returns NULL if reached the end. +static cl_block* cl_next_block_to_read(cl_block* prev) { + cl_block* block = NULL; + if (g_log.read_iterator_state == g_log.num_cores) { + // We are traversing dirty list; find the next dirty block. + if (prev != NULL) { + // Try to free the previous block if there is no unread data. This + // block + // may have unread data if previously incomplete record completed + // between + // read_next() calls. + block = prev->link.next->block; + if (cl_block_try_disable_access(prev, 0 /* do not discard data */)) { + cl_block_list_remove(&g_log.dirty_block_list, prev); + cl_block_list_insert_at_head(&g_log.free_block_list, prev); + } + } else { + block = cl_block_list_head(&g_log.dirty_block_list); + } + if (block != NULL) { + return block; + } + // We are done with the dirty list; moving on to core-local blocks. + } + while (g_log.read_iterator_state > 0) { + g_log.read_iterator_state--; + block = cl_core_local_block_get_block( + &g_log.core_local_blocks[g_log.read_iterator_state]); + if (block != NULL) { + return block; + } + } + return NULL; +} + +#define CL_LOG_2_MB 20 // 2^20 = 1MB + +// External functions: primary stats_log interface +void census_log_initialize(size_t size_in_mb, int discard_old_records) { + // Check cacheline alignment. + GPR_ASSERT(sizeof(cl_block) % GPR_CACHELINE_SIZE == 0); + GPR_ASSERT(sizeof(cl_core_local_block) % GPR_CACHELINE_SIZE == 0); + GPR_ASSERT(!g_log.initialized); + g_log.discard_old_records = discard_old_records; + g_log.num_cores = gpr_cpu_num_cores(); + // Ensure that we will not get any overflow in calaculating num_blocks + GPR_ASSERT(CL_LOG_2_MB >= CENSUS_LOG_2_MAX_RECORD_SIZE); + GPR_ASSERT(size_in_mb < 1000); + // Ensure at least 2x as many blocks as there are cores. + g_log.num_blocks = + (uint32_t)GPR_MAX(2 * g_log.num_cores, (size_in_mb << CL_LOG_2_MB) >> + CENSUS_LOG_2_MAX_RECORD_SIZE); + gpr_mu_init(&g_log.lock); + g_log.read_iterator_state = 0; + g_log.block_being_read = NULL; + g_log.core_local_blocks = (cl_core_local_block*)gpr_malloc_aligned( + g_log.num_cores * sizeof(cl_core_local_block), GPR_CACHELINE_SIZE_LOG); + memset(g_log.core_local_blocks, 0, + g_log.num_cores * sizeof(cl_core_local_block)); + g_log.blocks = (cl_block*)gpr_malloc_aligned( + g_log.num_blocks * sizeof(cl_block), GPR_CACHELINE_SIZE_LOG); + memset(g_log.blocks, 0, g_log.num_blocks * sizeof(cl_block)); + g_log.buffer = gpr_malloc(g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE); + memset(g_log.buffer, 0, g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE); + cl_block_list_initialize(&g_log.free_block_list); + cl_block_list_initialize(&g_log.dirty_block_list); + for (uint32_t i = 0; i < g_log.num_blocks; ++i) { + cl_block* block = g_log.blocks + i; + cl_block_initialize(block, g_log.buffer + (CENSUS_LOG_MAX_RECORD_SIZE * i)); + cl_block_try_disable_access(block, 1 /* discard data */); + cl_block_list_insert_at_tail(&g_log.free_block_list, block); + } + gpr_atm_rel_store(&g_log.out_of_space_count, 0); + g_log.initialized = 1; +} + +void census_log_shutdown(void) { + GPR_ASSERT(g_log.initialized); + gpr_mu_destroy(&g_log.lock); + gpr_free_aligned(g_log.core_local_blocks); + g_log.core_local_blocks = NULL; + gpr_free_aligned(g_log.blocks); + g_log.blocks = NULL; + gpr_free(g_log.buffer); + g_log.buffer = NULL; + g_log.initialized = 0; +} + +void* census_log_start_write(size_t size) { + // Used to bound number of times block allocation is attempted. + GPR_ASSERT(size > 0); + GPR_ASSERT(g_log.initialized); + if (size > CENSUS_LOG_MAX_RECORD_SIZE) { + return NULL; + } + uint32_t attempts_remaining = g_log.num_blocks; + uint32_t core_id = gpr_cpu_current_cpu(); + do { + void* record = NULL; + cl_block* block = + cl_core_local_block_get_block(&g_log.core_local_blocks[core_id]); + if (block && (record = cl_block_start_write(block, size))) { + return record; + } + // Need to allocate a new block. We are here if: + // - No block associated with the core OR + // - Write in-progress on the block OR + // - block is out of space + gpr_mu_lock(&g_log.lock); + bool allocated = cl_allocate_core_local_block(core_id, block); + gpr_mu_unlock(&g_log.lock); + if (!allocated) { + gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1); + return NULL; + } + } while (attempts_remaining--); + // Give up. + gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1); + return NULL; +} + +void census_log_end_write(void* record, size_t bytes_written) { + GPR_ASSERT(g_log.initialized); + cl_block_end_write(cl_get_block(record), bytes_written); +} + +void census_log_init_reader(void) { + GPR_ASSERT(g_log.initialized); + gpr_mu_lock(&g_log.lock); + // If a block is locked for reading unlock it. + if (g_log.block_being_read != NULL) { + cl_block_end_read(g_log.block_being_read); + g_log.block_being_read = NULL; + } + g_log.read_iterator_state = g_log.num_cores; + gpr_mu_unlock(&g_log.lock); +} + +const void* census_log_read_next(size_t* bytes_available) { + GPR_ASSERT(g_log.initialized); + gpr_mu_lock(&g_log.lock); + if (g_log.block_being_read != NULL) { + cl_block_end_read(g_log.block_being_read); + } + do { + g_log.block_being_read = cl_next_block_to_read(g_log.block_being_read); + if (g_log.block_being_read != NULL) { + void* record = + cl_block_start_read(g_log.block_being_read, bytes_available); + if (record != NULL) { + gpr_mu_unlock(&g_log.lock); + return record; + } + } + } while (g_log.block_being_read != NULL); + gpr_mu_unlock(&g_log.lock); + return NULL; +} + +size_t census_log_remaining_space(void) { + GPR_ASSERT(g_log.initialized); + size_t space = 0; + gpr_mu_lock(&g_log.lock); + if (g_log.discard_old_records) { + // Remaining space is not meaningful; just return the entire log space. + space = g_log.num_blocks << CENSUS_LOG_2_MAX_RECORD_SIZE; + } else { + GPR_ASSERT(g_log.free_block_list.count >= 0); + space = (size_t)g_log.free_block_list.count * CENSUS_LOG_MAX_RECORD_SIZE; + } + gpr_mu_unlock(&g_log.lock); + return space; +} + +int64_t census_log_out_of_space_count(void) { + GPR_ASSERT(g_log.initialized); + return gpr_atm_acq_load(&g_log.out_of_space_count); +} diff --git a/src/core/census/mlog.h b/src/core/census/mlog.h new file mode 100644 index 0000000000..05daea066f --- /dev/null +++ b/src/core/census/mlog.h @@ -0,0 +1,93 @@ +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CORE_CENSUS_LOG_H +#define GRPC_INTERNAL_CORE_CENSUS_LOG_H + +#include +#include + +/* Maximum record size, in bytes. */ +#define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */ +#define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE) + +/* Initialize the statistics logging subsystem with the given log size. A log + size of 0 will result in the smallest possible log for the platform + (approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If + discard_old_records is non-zero, then new records will displace older ones + when the log is full. This function must be called before any other + census_log functions. +*/ +void census_log_initialize(size_t size_in_mb, int discard_old_records); + +/* Shutdown the logging subsystem. Caller must ensure that: + - no in progress or future call to any census_log functions + - no incomplete records +*/ +void census_log_shutdown(void); + +/* Allocates and returns a 'size' bytes record and marks it in use. A + subsequent census_log_end_write() marks the record complete. The + 'bytes_written' census_log_end_write() argument must be <= + 'size'. Returns NULL if out-of-space AND: + - log is configured to keep old records OR + - all blocks are pinned by incomplete records. +*/ +void* census_log_start_write(size_t size); + +void census_log_end_write(void* record, size_t bytes_written); + +void census_log_init_reader(void); + +/* census_log_read_next() iterates over blocks with data and for each block + returns a pointer to the first unread byte. The number of bytes that can be + read are returned in 'bytes_available'. Reader is expected to read all + available data. Reading the data consumes it i.e. it cannot be read again. + census_log_read_next() returns NULL if the end is reached i.e last block + is read. census_log_init_reader() starts the iteration or aborts the + current iteration. +*/ +const void* census_log_read_next(size_t* bytes_available); + +/* Returns estimated remaining space across all blocks, in bytes. If log is + configured to discard old records, returns total log space. Otherwise, + returns space available in empty blocks (partially filled blocks are + treated as full). +*/ +size_t census_log_remaining_space(void); + +/* Returns the number of times gprc_stats_log_start_write() failed due to + out-of-space. */ +int64_t census_log_out_of_space_count(void); + +#endif /* GRPC_INTERNAL_CORE_CENSUS_LOG_H */ diff --git a/src/core/compression/algorithm.c b/src/core/compression/algorithm.c deleted file mode 100644 index 6f3a8eb28e..0000000000 --- a/src/core/compression/algorithm.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include - -#include -#include - -#include "src/core/compression/algorithm_metadata.h" -#include "src/core/surface/api_trace.h" -#include "src/core/transport/static_metadata.h" - -int grpc_compression_algorithm_parse(const char *name, size_t name_length, - grpc_compression_algorithm *algorithm) { - /* we use strncmp not only because it's safer (even though in this case it - * doesn't matter, given that we are comparing against string literals, but - * because this way we needn't have "name" nil-terminated (useful for slice - * data, for example) */ - GRPC_API_TRACE( - "grpc_compression_algorithm_parse(" - "name=%*.*s, name_length=%lu, algorithm=%p)", - 5, ((int)name_length, (int)name_length, name, (unsigned long)name_length, - algorithm)); - if (name_length == 0) { - return 0; - } - if (strncmp(name, "identity", name_length) == 0) { - *algorithm = GRPC_COMPRESS_NONE; - } else if (strncmp(name, "gzip", name_length) == 0) { - *algorithm = GRPC_COMPRESS_GZIP; - } else if (strncmp(name, "deflate", name_length) == 0) { - *algorithm = GRPC_COMPRESS_DEFLATE; - } else { - return 0; - } - return 1; -} - -int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, - char **name) { - GRPC_API_TRACE("grpc_compression_algorithm_parse(algorithm=%d, name=%p)", 2, - ((int)algorithm, name)); - switch (algorithm) { - case GRPC_COMPRESS_NONE: - *name = "identity"; - return 1; - case GRPC_COMPRESS_DEFLATE: - *name = "deflate"; - return 1; - case GRPC_COMPRESS_GZIP: - *name = "gzip"; - return 1; - case GRPC_COMPRESS_ALGORITHMS_COUNT: - return 0; - } - return 0; -} - -grpc_compression_algorithm grpc_compression_algorithm_from_mdstr( - grpc_mdstr *str) { - if (str == GRPC_MDSTR_IDENTITY) return GRPC_COMPRESS_NONE; - if (str == GRPC_MDSTR_DEFLATE) return GRPC_COMPRESS_DEFLATE; - if (str == GRPC_MDSTR_GZIP) return GRPC_COMPRESS_GZIP; - return GRPC_COMPRESS_ALGORITHMS_COUNT; -} - -grpc_mdstr *grpc_compression_algorithm_mdstr( - grpc_compression_algorithm algorithm) { - switch (algorithm) { - case GRPC_COMPRESS_NONE: - return GRPC_MDSTR_IDENTITY; - case GRPC_COMPRESS_DEFLATE: - return GRPC_MDSTR_DEFLATE; - case GRPC_COMPRESS_GZIP: - return GRPC_MDSTR_GZIP; - case GRPC_COMPRESS_ALGORITHMS_COUNT: - return NULL; - } - return NULL; -} - -grpc_mdelem *grpc_compression_encoding_mdelem( - grpc_compression_algorithm algorithm) { - switch (algorithm) { - case GRPC_COMPRESS_NONE: - return GRPC_MDELEM_GRPC_ENCODING_IDENTITY; - case GRPC_COMPRESS_DEFLATE: - return GRPC_MDELEM_GRPC_ENCODING_DEFLATE; - case GRPC_COMPRESS_GZIP: - return GRPC_MDELEM_GRPC_ENCODING_GZIP; - default: - break; - } - return NULL; -} - -/* TODO(dgq): Add the ability to specify parameters to the individual - * compression algorithms */ -grpc_compression_algorithm grpc_compression_algorithm_for_level( - grpc_compression_level level) { - GRPC_API_TRACE("grpc_compression_algorithm_for_level(level=%d)", 1, - ((int)level)); - switch (level) { - case GRPC_COMPRESS_LEVEL_NONE: - return GRPC_COMPRESS_NONE; - case GRPC_COMPRESS_LEVEL_LOW: - case GRPC_COMPRESS_LEVEL_MED: - case GRPC_COMPRESS_LEVEL_HIGH: - return GRPC_COMPRESS_DEFLATE; - default: - gpr_log(GPR_ERROR, "Unknown compression level %d.", (int)level); - abort(); - } -} - -void grpc_compression_options_init(grpc_compression_options *opts) { - opts->enabled_algorithms_bitset = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1; - opts->default_compression_algorithm = GRPC_COMPRESS_NONE; -} - -void grpc_compression_options_enable_algorithm( - grpc_compression_options *opts, grpc_compression_algorithm algorithm) { - GPR_BITSET(&opts->enabled_algorithms_bitset, algorithm); -} - -void grpc_compression_options_disable_algorithm( - grpc_compression_options *opts, grpc_compression_algorithm algorithm) { - GPR_BITCLEAR(&opts->enabled_algorithms_bitset, algorithm); -} - -int grpc_compression_options_is_algorithm_enabled( - const grpc_compression_options *opts, - grpc_compression_algorithm algorithm) { - return GPR_BITGET(opts->enabled_algorithms_bitset, algorithm); -} diff --git a/src/core/compression/compression_algorithm.c b/src/core/compression/compression_algorithm.c new file mode 100644 index 0000000000..6f3a8eb28e --- /dev/null +++ b/src/core/compression/compression_algorithm.c @@ -0,0 +1,166 @@ +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include +#include + +#include "src/core/compression/algorithm_metadata.h" +#include "src/core/surface/api_trace.h" +#include "src/core/transport/static_metadata.h" + +int grpc_compression_algorithm_parse(const char *name, size_t name_length, + grpc_compression_algorithm *algorithm) { + /* we use strncmp not only because it's safer (even though in this case it + * doesn't matter, given that we are comparing against string literals, but + * because this way we needn't have "name" nil-terminated (useful for slice + * data, for example) */ + GRPC_API_TRACE( + "grpc_compression_algorithm_parse(" + "name=%*.*s, name_length=%lu, algorithm=%p)", + 5, ((int)name_length, (int)name_length, name, (unsigned long)name_length, + algorithm)); + if (name_length == 0) { + return 0; + } + if (strncmp(name, "identity", name_length) == 0) { + *algorithm = GRPC_COMPRESS_NONE; + } else if (strncmp(name, "gzip", name_length) == 0) { + *algorithm = GRPC_COMPRESS_GZIP; + } else if (strncmp(name, "deflate", name_length) == 0) { + *algorithm = GRPC_COMPRESS_DEFLATE; + } else { + return 0; + } + return 1; +} + +int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, + char **name) { + GRPC_API_TRACE("grpc_compression_algorithm_parse(algorithm=%d, name=%p)", 2, + ((int)algorithm, name)); + switch (algorithm) { + case GRPC_COMPRESS_NONE: + *name = "identity"; + return 1; + case GRPC_COMPRESS_DEFLATE: + *name = "deflate"; + return 1; + case GRPC_COMPRESS_GZIP: + *name = "gzip"; + return 1; + case GRPC_COMPRESS_ALGORITHMS_COUNT: + return 0; + } + return 0; +} + +grpc_compression_algorithm grpc_compression_algorithm_from_mdstr( + grpc_mdstr *str) { + if (str == GRPC_MDSTR_IDENTITY) return GRPC_COMPRESS_NONE; + if (str == GRPC_MDSTR_DEFLATE) return GRPC_COMPRESS_DEFLATE; + if (str == GRPC_MDSTR_GZIP) return GRPC_COMPRESS_GZIP; + return GRPC_COMPRESS_ALGORITHMS_COUNT; +} + +grpc_mdstr *grpc_compression_algorithm_mdstr( + grpc_compression_algorithm algorithm) { + switch (algorithm) { + case GRPC_COMPRESS_NONE: + return GRPC_MDSTR_IDENTITY; + case GRPC_COMPRESS_DEFLATE: + return GRPC_MDSTR_DEFLATE; + case GRPC_COMPRESS_GZIP: + return GRPC_MDSTR_GZIP; + case GRPC_COMPRESS_ALGORITHMS_COUNT: + return NULL; + } + return NULL; +} + +grpc_mdelem *grpc_compression_encoding_mdelem( + grpc_compression_algorithm algorithm) { + switch (algorithm) { + case GRPC_COMPRESS_NONE: + return GRPC_MDELEM_GRPC_ENCODING_IDENTITY; + case GRPC_COMPRESS_DEFLATE: + return GRPC_MDELEM_GRPC_ENCODING_DEFLATE; + case GRPC_COMPRESS_GZIP: + return GRPC_MDELEM_GRPC_ENCODING_GZIP; + default: + break; + } + return NULL; +} + +/* TODO(dgq): Add the ability to specify parameters to the individual + * compression algorithms */ +grpc_compression_algorithm grpc_compression_algorithm_for_level( + grpc_compression_level level) { + GRPC_API_TRACE("grpc_compression_algorithm_for_level(level=%d)", 1, + ((int)level)); + switch (level) { + case GRPC_COMPRESS_LEVEL_NONE: + return GRPC_COMPRESS_NONE; + case GRPC_COMPRESS_LEVEL_LOW: + case GRPC_COMPRESS_LEVEL_MED: + case GRPC_COMPRESS_LEVEL_HIGH: + return GRPC_COMPRESS_DEFLATE; + default: + gpr_log(GPR_ERROR, "Unknown compression level %d.", (int)level); + abort(); + } +} + +void grpc_compression_options_init(grpc_compression_options *opts) { + opts->enabled_algorithms_bitset = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1; + opts->default_compression_algorithm = GRPC_COMPRESS_NONE; +} + +void grpc_compression_options_enable_algorithm( + grpc_compression_options *opts, grpc_compression_algorithm algorithm) { + GPR_BITSET(&opts->enabled_algorithms_bitset, algorithm); +} + +void grpc_compression_options_disable_algorithm( + grpc_compression_options *opts, grpc_compression_algorithm algorithm) { + GPR_BITCLEAR(&opts->enabled_algorithms_bitset, algorithm); +} + +int grpc_compression_options_is_algorithm_enabled( + const grpc_compression_options *opts, + grpc_compression_algorithm algorithm) { + return GPR_BITGET(opts->enabled_algorithms_bitset, algorithm); +} diff --git a/src/core/security/b64.c b/src/core/security/b64.c new file mode 100644 index 0000000000..c40b528e2f --- /dev/null +++ b/src/core/security/b64.c @@ -0,0 +1,233 @@ +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/security/b64.h" + +#include +#include + +#include +#include +#include + +/* --- Constants. --- */ + +static const int8_t base64_bytes[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 0x3E, -1, -1, -1, 0x3F, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, -1, -1, + -1, 0x7F, -1, -1, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, + 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, -1, -1, -1, -1, -1, + -1, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, + 0x31, 0x32, 0x33, -1, -1, -1, -1, -1}; + +static const char base64_url_unsafe_chars[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static const char base64_url_safe_chars[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + +#define GRPC_BASE64_PAD_CHAR '=' +#define GRPC_BASE64_PAD_BYTE 0x7F +#define GRPC_BASE64_MULTILINE_LINE_LEN 76 +#define GRPC_BASE64_MULTILINE_NUM_BLOCKS (GRPC_BASE64_MULTILINE_LINE_LEN / 4) + +/* --- base64 functions. --- */ + +char *grpc_base64_encode(const void *vdata, size_t data_size, int url_safe, + int multiline) { + const unsigned char *data = vdata; + const char *base64_chars = + url_safe ? base64_url_safe_chars : base64_url_unsafe_chars; + size_t result_projected_size = + 4 * ((data_size + 3) / 3) + + 2 * (multiline ? (data_size / (3 * GRPC_BASE64_MULTILINE_NUM_BLOCKS)) + : 0) + + 1; + char *result = gpr_malloc(result_projected_size); + char *current = result; + size_t num_blocks = 0; + size_t i = 0; + + /* Encode each block. */ + while (data_size >= 3) { + *current++ = base64_chars[(data[i] >> 2) & 0x3F]; + *current++ = + base64_chars[((data[i] & 0x03) << 4) | ((data[i + 1] >> 4) & 0x0F)]; + *current++ = + base64_chars[((data[i + 1] & 0x0F) << 2) | ((data[i + 2] >> 6) & 0x03)]; + *current++ = base64_chars[data[i + 2] & 0x3F]; + + data_size -= 3; + i += 3; + if (multiline && (++num_blocks == GRPC_BASE64_MULTILINE_NUM_BLOCKS)) { + *current++ = '\r'; + *current++ = '\n'; + num_blocks = 0; + } + } + + /* Take care of the tail. */ + if (data_size == 2) { + *current++ = base64_chars[(data[i] >> 2) & 0x3F]; + *current++ = + base64_chars[((data[i] & 0x03) << 4) | ((data[i + 1] >> 4) & 0x0F)]; + *current++ = base64_chars[(data[i + 1] & 0x0F) << 2]; + *current++ = GRPC_BASE64_PAD_CHAR; + } else if (data_size == 1) { + *current++ = base64_chars[(data[i] >> 2) & 0x3F]; + *current++ = base64_chars[(data[i] & 0x03) << 4]; + *current++ = GRPC_BASE64_PAD_CHAR; + *current++ = GRPC_BASE64_PAD_CHAR; + } + + GPR_ASSERT(current >= result); + GPR_ASSERT((uintptr_t)(current - result) < result_projected_size); + result[current - result] = '\0'; + return result; +} + +gpr_slice grpc_base64_decode(const char *b64, int url_safe) { + return grpc_base64_decode_with_len(b64, strlen(b64), url_safe); +} + +static void decode_one_char(const unsigned char *codes, unsigned char *result, + size_t *result_offset) { + uint32_t packed = ((uint32_t)codes[0] << 2) | ((uint32_t)codes[1] >> 4); + result[(*result_offset)++] = (unsigned char)packed; +} + +static void decode_two_chars(const unsigned char *codes, unsigned char *result, + size_t *result_offset) { + uint32_t packed = ((uint32_t)codes[0] << 10) | ((uint32_t)codes[1] << 4) | + ((uint32_t)codes[2] >> 2); + result[(*result_offset)++] = (unsigned char)(packed >> 8); + result[(*result_offset)++] = (unsigned char)(packed); +} + +static int decode_group(const unsigned char *codes, size_t num_codes, + unsigned char *result, size_t *result_offset) { + GPR_ASSERT(num_codes <= 4); + + /* Short end groups that may not have padding. */ + if (num_codes == 1) { + gpr_log(GPR_ERROR, "Invalid group. Must be at least 2 bytes."); + return 0; + } + if (num_codes == 2) { + decode_one_char(codes, result, result_offset); + return 1; + } + if (num_codes == 3) { + decode_two_chars(codes, result, result_offset); + return 1; + } + + /* Regular 4 byte groups with padding or not. */ + GPR_ASSERT(num_codes == 4); + if (codes[0] == GRPC_BASE64_PAD_BYTE || codes[1] == GRPC_BASE64_PAD_BYTE) { + gpr_log(GPR_ERROR, "Invalid padding detected."); + return 0; + } + if (codes[2] == GRPC_BASE64_PAD_BYTE) { + if (codes[3] == GRPC_BASE64_PAD_BYTE) { + decode_one_char(codes, result, result_offset); + } else { + gpr_log(GPR_ERROR, "Invalid padding detected."); + return 0; + } + } else if (codes[3] == GRPC_BASE64_PAD_BYTE) { + decode_two_chars(codes, result, result_offset); + } else { + /* No padding. */ + uint32_t packed = ((uint32_t)codes[0] << 18) | ((uint32_t)codes[1] << 12) | + ((uint32_t)codes[2] << 6) | codes[3]; + result[(*result_offset)++] = (unsigned char)(packed >> 16); + result[(*result_offset)++] = (unsigned char)(packed >> 8); + result[(*result_offset)++] = (unsigned char)(packed); + } + return 1; +} + +gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len, + int url_safe) { + gpr_slice result = gpr_slice_malloc(b64_len); + unsigned char *current = GPR_SLICE_START_PTR(result); + size_t result_size = 0; + unsigned char codes[4]; + size_t num_codes = 0; + + while (b64_len--) { + unsigned char c = (unsigned char)(*b64++); + signed char code; + if (c >= GPR_ARRAY_SIZE(base64_bytes)) continue; + if (url_safe) { + if (c == '+' || c == '/') { + gpr_log(GPR_ERROR, "Invalid character for url safe base64 %c", c); + goto fail; + } + if (c == '-') { + c = '+'; + } else if (c == '_') { + c = '/'; + } + } + code = base64_bytes[c]; + if (code == -1) { + if (c != '\r' && c != '\n') { + gpr_log(GPR_ERROR, "Invalid character %c", c); + goto fail; + } + } else { + codes[num_codes++] = (unsigned char)code; + if (num_codes == 4) { + if (!decode_group(codes, num_codes, current, &result_size)) goto fail; + num_codes = 0; + } + } + } + + if (num_codes != 0 && + !decode_group(codes, num_codes, current, &result_size)) { + goto fail; + } + GPR_SLICE_SET_LENGTH(result, result_size); + return result; + +fail: + gpr_slice_unref(result); + return gpr_empty_slice(); +} diff --git a/src/core/security/b64.h b/src/core/security/b64.h new file mode 100644 index 0000000000..31ae982691 --- /dev/null +++ b/src/core/security/b64.h @@ -0,0 +1,52 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CORE_SECURITY_BASE64_H +#define GRPC_INTERNAL_CORE_SECURITY_BASE64_H + +#include + +/* Encodes data using base64. It is the caller's responsability to free + the returned char * using gpr_free. Returns NULL on NULL input. */ +char *grpc_base64_encode(const void *data, size_t data_size, int url_safe, + int multiline); + +/* Decodes data according to the base64 specification. Returns an empty + slice in case of failure. */ +gpr_slice grpc_base64_decode(const char *b64, int url_safe); + +/* Same as above except that the length is provided by the caller. */ +gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len, + int url_safe); + +#endif /* GRPC_INTERNAL_CORE_SECURITY_BASE64_H */ diff --git a/src/core/security/base64.c b/src/core/security/base64.c deleted file mode 100644 index 8367c160c3..0000000000 --- a/src/core/security/base64.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "src/core/security/base64.h" - -#include -#include - -#include -#include -#include - -/* --- Constants. --- */ - -static const int8_t base64_bytes[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 0x3E, -1, -1, -1, 0x3F, - 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, -1, -1, - -1, 0x7F, -1, -1, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, - 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, -1, -1, -1, -1, -1, - -1, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, - 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, - 0x31, 0x32, 0x33, -1, -1, -1, -1, -1}; - -static const char base64_url_unsafe_chars[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -static const char base64_url_safe_chars[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - -#define GRPC_BASE64_PAD_CHAR '=' -#define GRPC_BASE64_PAD_BYTE 0x7F -#define GRPC_BASE64_MULTILINE_LINE_LEN 76 -#define GRPC_BASE64_MULTILINE_NUM_BLOCKS (GRPC_BASE64_MULTILINE_LINE_LEN / 4) - -/* --- base64 functions. --- */ - -char *grpc_base64_encode(const void *vdata, size_t data_size, int url_safe, - int multiline) { - const unsigned char *data = vdata; - const char *base64_chars = - url_safe ? base64_url_safe_chars : base64_url_unsafe_chars; - size_t result_projected_size = - 4 * ((data_size + 3) / 3) + - 2 * (multiline ? (data_size / (3 * GRPC_BASE64_MULTILINE_NUM_BLOCKS)) - : 0) + - 1; - char *result = gpr_malloc(result_projected_size); - char *current = result; - size_t num_blocks = 0; - size_t i = 0; - - /* Encode each block. */ - while (data_size >= 3) { - *current++ = base64_chars[(data[i] >> 2) & 0x3F]; - *current++ = - base64_chars[((data[i] & 0x03) << 4) | ((data[i + 1] >> 4) & 0x0F)]; - *current++ = - base64_chars[((data[i + 1] & 0x0F) << 2) | ((data[i + 2] >> 6) & 0x03)]; - *current++ = base64_chars[data[i + 2] & 0x3F]; - - data_size -= 3; - i += 3; - if (multiline && (++num_blocks == GRPC_BASE64_MULTILINE_NUM_BLOCKS)) { - *current++ = '\r'; - *current++ = '\n'; - num_blocks = 0; - } - } - - /* Take care of the tail. */ - if (data_size == 2) { - *current++ = base64_chars[(data[i] >> 2) & 0x3F]; - *current++ = - base64_chars[((data[i] & 0x03) << 4) | ((data[i + 1] >> 4) & 0x0F)]; - *current++ = base64_chars[(data[i + 1] & 0x0F) << 2]; - *current++ = GRPC_BASE64_PAD_CHAR; - } else if (data_size == 1) { - *current++ = base64_chars[(data[i] >> 2) & 0x3F]; - *current++ = base64_chars[(data[i] & 0x03) << 4]; - *current++ = GRPC_BASE64_PAD_CHAR; - *current++ = GRPC_BASE64_PAD_CHAR; - } - - GPR_ASSERT(current >= result); - GPR_ASSERT((uintptr_t)(current - result) < result_projected_size); - result[current - result] = '\0'; - return result; -} - -gpr_slice grpc_base64_decode(const char *b64, int url_safe) { - return grpc_base64_decode_with_len(b64, strlen(b64), url_safe); -} - -static void decode_one_char(const unsigned char *codes, unsigned char *result, - size_t *result_offset) { - uint32_t packed = ((uint32_t)codes[0] << 2) | ((uint32_t)codes[1] >> 4); - result[(*result_offset)++] = (unsigned char)packed; -} - -static void decode_two_chars(const unsigned char *codes, unsigned char *result, - size_t *result_offset) { - uint32_t packed = ((uint32_t)codes[0] << 10) | ((uint32_t)codes[1] << 4) | - ((uint32_t)codes[2] >> 2); - result[(*result_offset)++] = (unsigned char)(packed >> 8); - result[(*result_offset)++] = (unsigned char)(packed); -} - -static int decode_group(const unsigned char *codes, size_t num_codes, - unsigned char *result, size_t *result_offset) { - GPR_ASSERT(num_codes <= 4); - - /* Short end groups that may not have padding. */ - if (num_codes == 1) { - gpr_log(GPR_ERROR, "Invalid group. Must be at least 2 bytes."); - return 0; - } - if (num_codes == 2) { - decode_one_char(codes, result, result_offset); - return 1; - } - if (num_codes == 3) { - decode_two_chars(codes, result, result_offset); - return 1; - } - - /* Regular 4 byte groups with padding or not. */ - GPR_ASSERT(num_codes == 4); - if (codes[0] == GRPC_BASE64_PAD_BYTE || codes[1] == GRPC_BASE64_PAD_BYTE) { - gpr_log(GPR_ERROR, "Invalid padding detected."); - return 0; - } - if (codes[2] == GRPC_BASE64_PAD_BYTE) { - if (codes[3] == GRPC_BASE64_PAD_BYTE) { - decode_one_char(codes, result, result_offset); - } else { - gpr_log(GPR_ERROR, "Invalid padding detected."); - return 0; - } - } else if (codes[3] == GRPC_BASE64_PAD_BYTE) { - decode_two_chars(codes, result, result_offset); - } else { - /* No padding. */ - uint32_t packed = ((uint32_t)codes[0] << 18) | ((uint32_t)codes[1] << 12) | - ((uint32_t)codes[2] << 6) | codes[3]; - result[(*result_offset)++] = (unsigned char)(packed >> 16); - result[(*result_offset)++] = (unsigned char)(packed >> 8); - result[(*result_offset)++] = (unsigned char)(packed); - } - return 1; -} - -gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len, - int url_safe) { - gpr_slice result = gpr_slice_malloc(b64_len); - unsigned char *current = GPR_SLICE_START_PTR(result); - size_t result_size = 0; - unsigned char codes[4]; - size_t num_codes = 0; - - while (b64_len--) { - unsigned char c = (unsigned char)(*b64++); - signed char code; - if (c >= GPR_ARRAY_SIZE(base64_bytes)) continue; - if (url_safe) { - if (c == '+' || c == '/') { - gpr_log(GPR_ERROR, "Invalid character for url safe base64 %c", c); - goto fail; - } - if (c == '-') { - c = '+'; - } else if (c == '_') { - c = '/'; - } - } - code = base64_bytes[c]; - if (code == -1) { - if (c != '\r' && c != '\n') { - gpr_log(GPR_ERROR, "Invalid character %c", c); - goto fail; - } - } else { - codes[num_codes++] = (unsigned char)code; - if (num_codes == 4) { - if (!decode_group(codes, num_codes, current, &result_size)) goto fail; - num_codes = 0; - } - } - } - - if (num_codes != 0 && - !decode_group(codes, num_codes, current, &result_size)) { - goto fail; - } - GPR_SLICE_SET_LENGTH(result, result_size); - return result; - -fail: - gpr_slice_unref(result); - return gpr_empty_slice(); -} diff --git a/src/core/security/base64.h b/src/core/security/base64.h deleted file mode 100644 index 31ae982691..0000000000 --- a/src/core/security/base64.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_INTERNAL_CORE_SECURITY_BASE64_H -#define GRPC_INTERNAL_CORE_SECURITY_BASE64_H - -#include - -/* Encodes data using base64. It is the caller's responsability to free - the returned char * using gpr_free. Returns NULL on NULL input. */ -char *grpc_base64_encode(const void *data, size_t data_size, int url_safe, - int multiline); - -/* Decodes data according to the base64 specification. Returns an empty - slice in case of failure. */ -gpr_slice grpc_base64_decode(const char *b64, int url_safe); - -/* Same as above except that the length is provided by the caller. */ -gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len, - int url_safe); - -#endif /* GRPC_INTERNAL_CORE_SECURITY_BASE64_H */ diff --git a/src/core/security/google_default_credentials.c b/src/core/security/google_default_credentials.c index f3ac14568a..bd4b0e462a 100644 --- a/src/core/security/google_default_credentials.c +++ b/src/core/security/google_default_credentials.c @@ -41,7 +41,7 @@ #include "src/core/httpcli/httpcli.h" #include "src/core/support/env.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include "src/core/surface/api_trace.h" /* -- Constants. -- */ diff --git a/src/core/security/json_token.c b/src/core/security/json_token.c index 762f02989a..372e5bfc5a 100644 --- a/src/core/security/json_token.c +++ b/src/core/security/json_token.c @@ -39,7 +39,7 @@ #include #include -#include "src/core/security/base64.h" +#include "src/core/security/b64.h" #include "src/core/support/string.h" #include diff --git a/src/core/security/jwt_verifier.c b/src/core/security/jwt_verifier.c index 042a117f5d..928c6c148d 100644 --- a/src/core/security/jwt_verifier.c +++ b/src/core/security/jwt_verifier.c @@ -37,7 +37,7 @@ #include #include "src/core/httpcli/httpcli.h" -#include "src/core/security/base64.h" +#include "src/core/security/b64.h" #include "src/core/tsi/ssl_types.h" #include diff --git a/src/core/security/security_connector.c b/src/core/security/security_connector.c index b46205323b..51a99b4492 100644 --- a/src/core/security/security_connector.c +++ b/src/core/security/security_connector.c @@ -35,20 +35,20 @@ #include +#include +#include +#include +#include +#include + #include "src/core/security/credentials.h" #include "src/core/security/handshake.h" #include "src/core/security/secure_endpoint.h" #include "src/core/security/security_context.h" #include "src/core/support/env.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include "src/core/support/string.h" #include "src/core/transport/chttp2/alpn.h" - -#include -#include -#include -#include -#include #include "src/core/tsi/fake_transport_security.h" #include "src/core/tsi/ssl_transport_security.h" diff --git a/src/core/support/file.c b/src/core/support/file.c deleted file mode 100644 index 8c673dbcc6..0000000000 --- a/src/core/support/file.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "src/core/support/file.h" - -#include -#include - -#include -#include -#include - -#include "src/core/support/block_annotate.h" -#include "src/core/support/string.h" - -gpr_slice gpr_load_file(const char *filename, int add_null_terminator, - int *success) { - unsigned char *contents = NULL; - size_t contents_size = 0; - char *error_msg = NULL; - gpr_slice result = gpr_empty_slice(); - FILE *file; - size_t bytes_read = 0; - - GRPC_SCHEDULING_START_BLOCKING_REGION; - file = fopen(filename, "rb"); - if (file == NULL) { - gpr_asprintf(&error_msg, "Could not open file %s (error = %s).", filename, - strerror(errno)); - GPR_ASSERT(error_msg != NULL); - goto end; - } - fseek(file, 0, SEEK_END); - /* Converting to size_t on the assumption that it will not fail */ - contents_size = (size_t)ftell(file); - fseek(file, 0, SEEK_SET); - contents = gpr_malloc(contents_size + (add_null_terminator ? 1 : 0)); - bytes_read = fread(contents, 1, contents_size, file); - if (bytes_read < contents_size) { - GPR_ASSERT(ferror(file)); - gpr_asprintf(&error_msg, "Error %s occured while reading file %s.", - strerror(errno), filename); - GPR_ASSERT(error_msg != NULL); - goto end; - } - if (success != NULL) *success = 1; - if (add_null_terminator) { - contents[contents_size++] = 0; - } - result = gpr_slice_new(contents, contents_size, gpr_free); - -end: - if (error_msg != NULL) { - gpr_log(GPR_ERROR, "%s", error_msg); - gpr_free(error_msg); - if (success != NULL) *success = 0; - } - if (file != NULL) fclose(file); - GRPC_SCHEDULING_END_BLOCKING_REGION; - return result; -} diff --git a/src/core/support/file.h b/src/core/support/file.h deleted file mode 100644 index d8b7cea44f..0000000000 --- a/src/core/support/file.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_INTERNAL_CORE_SUPPORT_FILE_H -#define GRPC_INTERNAL_CORE_SUPPORT_FILE_H - -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* File utility functions */ - -/* Loads the content of a file into a slice. add_null_terminator will add - a NULL terminator if non-zero. The success parameter, if not NULL, - will be set to 1 in case of success and 0 in case of failure. */ -gpr_slice gpr_load_file(const char *filename, int add_null_terminator, - int *success); - -/* Creates a temporary file from a prefix. - If tmp_filename is not NULL, *tmp_filename is assigned the name of the - created file and it is the responsibility of the caller to gpr_free it - unless an error occurs in which case it will be set to NULL. */ -FILE *gpr_tmpfile(const char *prefix, char **tmp_filename); - -#ifdef __cplusplus -} -#endif - -#endif /* GRPC_INTERNAL_CORE_SUPPORT_FILE_H */ diff --git a/src/core/support/file_posix.c b/src/core/support/file_posix.c deleted file mode 100644 index c11c07148a..0000000000 --- a/src/core/support/file_posix.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -#ifdef GPR_POSIX_FILE - -#include "src/core/support/file.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "src/core/support/string.h" - -FILE *gpr_tmpfile(const char *prefix, char **tmp_filename) { - FILE *result = NULL; - char *template; - int fd; - - if (tmp_filename != NULL) *tmp_filename = NULL; - - gpr_asprintf(&template, "/tmp/%s_XXXXXX", prefix); - GPR_ASSERT(template != NULL); - - fd = mkstemp(template); - if (fd == -1) { - gpr_log(GPR_ERROR, "mkstemp failed for template %s with error %s.", - template, strerror(errno)); - goto end; - } - result = fdopen(fd, "w+"); - if (result == NULL) { - gpr_log(GPR_ERROR, "Could not open file %s from fd %d (error = %s).", - template, fd, strerror(errno)); - unlink(template); - close(fd); - goto end; - } - -end: - if (result != NULL && tmp_filename != NULL) { - *tmp_filename = template; - } else { - gpr_free(template); - } - return result; -} - -#endif /* GPR_POSIX_FILE */ diff --git a/src/core/support/file_win32.c b/src/core/support/file_win32.c deleted file mode 100644 index 355744f79a..0000000000 --- a/src/core/support/file_win32.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -#ifdef GPR_WIN32 - -#include -#include -#include -#include - -#include -#include -#include - -#include "src/core/support/file.h" -#include "src/core/support/string_win32.h" - -FILE *gpr_tmpfile(const char *prefix, char **tmp_filename_out) { - FILE *result = NULL; - LPTSTR template_string = NULL; - TCHAR tmp_path[MAX_PATH]; - TCHAR tmp_filename[MAX_PATH]; - DWORD status; - UINT success; - - if (tmp_filename_out != NULL) *tmp_filename_out = NULL; - - /* Convert our prefix to TCHAR. */ - template_string = gpr_char_to_tchar(prefix); - GPR_ASSERT(template_string); - - /* Get the path to the best temporary folder available. */ - status = GetTempPath(MAX_PATH, tmp_path); - if (status == 0 || status > MAX_PATH) goto end; - - /* Generate a unique filename with our template + temporary path. */ - success = GetTempFileName(tmp_path, template_string, 0, tmp_filename); - if (!success) goto end; - - /* Open a file there. */ - if (_tfopen_s(&result, tmp_filename, TEXT("wb+")) != 0) goto end; - -end: - if (result && tmp_filename_out) { - *tmp_filename_out = gpr_tchar_to_char(tmp_filename); - } - - gpr_free(template_string); - return result; -} - -#endif /* GPR_WIN32 */ diff --git a/src/core/support/load_file.c b/src/core/support/load_file.c new file mode 100644 index 0000000000..2ea08a5066 --- /dev/null +++ b/src/core/support/load_file.c @@ -0,0 +1,91 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/support/load_file.h" + +#include +#include + +#include +#include +#include + +#include "src/core/support/block_annotate.h" +#include "src/core/support/string.h" + +gpr_slice gpr_load_file(const char *filename, int add_null_terminator, + int *success) { + unsigned char *contents = NULL; + size_t contents_size = 0; + char *error_msg = NULL; + gpr_slice result = gpr_empty_slice(); + FILE *file; + size_t bytes_read = 0; + + GRPC_SCHEDULING_START_BLOCKING_REGION; + file = fopen(filename, "rb"); + if (file == NULL) { + gpr_asprintf(&error_msg, "Could not open file %s (error = %s).", filename, + strerror(errno)); + GPR_ASSERT(error_msg != NULL); + goto end; + } + fseek(file, 0, SEEK_END); + /* Converting to size_t on the assumption that it will not fail */ + contents_size = (size_t)ftell(file); + fseek(file, 0, SEEK_SET); + contents = gpr_malloc(contents_size + (add_null_terminator ? 1 : 0)); + bytes_read = fread(contents, 1, contents_size, file); + if (bytes_read < contents_size) { + GPR_ASSERT(ferror(file)); + gpr_asprintf(&error_msg, "Error %s occured while reading file %s.", + strerror(errno), filename); + GPR_ASSERT(error_msg != NULL); + goto end; + } + if (success != NULL) *success = 1; + if (add_null_terminator) { + contents[contents_size++] = 0; + } + result = gpr_slice_new(contents, contents_size, gpr_free); + +end: + if (error_msg != NULL) { + gpr_log(GPR_ERROR, "%s", error_msg); + gpr_free(error_msg); + if (success != NULL) *success = 0; + } + if (file != NULL) fclose(file); + GRPC_SCHEDULING_END_BLOCKING_REGION; + return result; +} diff --git a/src/core/support/load_file.h b/src/core/support/load_file.h new file mode 100644 index 0000000000..d8b7cea44f --- /dev/null +++ b/src/core/support/load_file.h @@ -0,0 +1,63 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CORE_SUPPORT_FILE_H +#define GRPC_INTERNAL_CORE_SUPPORT_FILE_H + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* File utility functions */ + +/* Loads the content of a file into a slice. add_null_terminator will add + a NULL terminator if non-zero. The success parameter, if not NULL, + will be set to 1 in case of success and 0 in case of failure. */ +gpr_slice gpr_load_file(const char *filename, int add_null_terminator, + int *success); + +/* Creates a temporary file from a prefix. + If tmp_filename is not NULL, *tmp_filename is assigned the name of the + created file and it is the responsibility of the caller to gpr_free it + unless an error occurs in which case it will be set to NULL. */ +FILE *gpr_tmpfile(const char *prefix, char **tmp_filename); + +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_INTERNAL_CORE_SUPPORT_FILE_H */ diff --git a/src/core/support/tmpfile.h b/src/core/support/tmpfile.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/core/support/tmpfile_posix.c b/src/core/support/tmpfile_posix.c new file mode 100644 index 0000000000..70ecfc1b33 --- /dev/null +++ b/src/core/support/tmpfile_posix.c @@ -0,0 +1,85 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +#ifdef GPR_POSIX_FILE + +#include "src/core/support/tmpfile.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "src/core/support/string.h" + +FILE *gpr_tmpfile(const char *prefix, char **tmp_filename) { + FILE *result = NULL; + char *template; + int fd; + + if (tmp_filename != NULL) *tmp_filename = NULL; + + gpr_asprintf(&template, "/tmp/%s_XXXXXX", prefix); + GPR_ASSERT(template != NULL); + + fd = mkstemp(template); + if (fd == -1) { + gpr_log(GPR_ERROR, "mkstemp failed for template %s with error %s.", + template, strerror(errno)); + goto end; + } + result = fdopen(fd, "w+"); + if (result == NULL) { + gpr_log(GPR_ERROR, "Could not open file %s from fd %d (error = %s).", + template, fd, strerror(errno)); + unlink(template); + close(fd); + goto end; + } + +end: + if (result != NULL && tmp_filename != NULL) { + *tmp_filename = template; + } else { + gpr_free(template); + } + return result; +} + +#endif /* GPR_POSIX_FILE */ diff --git a/src/core/support/tmpfile_win32.c b/src/core/support/tmpfile_win32.c new file mode 100644 index 0000000000..834e2684b2 --- /dev/null +++ b/src/core/support/tmpfile_win32.c @@ -0,0 +1,84 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +#ifdef GPR_WIN32 + +#include +#include +#include +#include + +#include +#include +#include + +#include "src/core/support/string_win32.h" +#include "src/core/support/tmpfile.h" + +FILE *gpr_tmpfile(const char *prefix, char **tmp_filename_out) { + FILE *result = NULL; + LPTSTR template_string = NULL; + TCHAR tmp_path[MAX_PATH]; + TCHAR tmp_filename[MAX_PATH]; + DWORD status; + UINT success; + + if (tmp_filename_out != NULL) *tmp_filename_out = NULL; + + /* Convert our prefix to TCHAR. */ + template_string = gpr_char_to_tchar(prefix); + GPR_ASSERT(template_string); + + /* Get the path to the best temporary folder available. */ + status = GetTempPath(MAX_PATH, tmp_path); + if (status == 0 || status > MAX_PATH) goto end; + + /* Generate a unique filename with our template + temporary path. */ + success = GetTempFileName(tmp_path, template_string, 0, tmp_filename); + if (!success) goto end; + + /* Open a file there. */ + if (_tfopen_s(&result, tmp_filename, TEXT("wb+")) != 0) goto end; + +end: + if (result && tmp_filename_out) { + *tmp_filename_out = gpr_tchar_to_char(tmp_filename); + } + + gpr_free(template_string); + return result; +} + +#endif /* GPR_WIN32 */ diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template index 04802772af..cf424edd0b 100644 --- a/templates/tools/run_tests/sources_and_headers.json.template +++ b/templates/tools/run_tests/sources_and_headers.json.template @@ -3,34 +3,41 @@ <%! import json import os - + def proto_headers(src): - out = [] - for f in src: - name, ext = os.path.splitext(f) - if ext == '.proto': - out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) - return out - + out = [] + for f in src: + name, ext = os.path.splitext(f) + if ext == '.proto': + out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) + return out + def no_protos(src): - out = [] - for f in src: - if os.path.splitext(f)[1] != '.proto': - out.append(f) - return out + out = [] + for f in src: + if os.path.splitext(f)[1] != '.proto': + out.append(f) + return out + + def all_targets(targets, libs): + for tgt in targets: + yield ('target', tgt) + for tgt in libs: + yield ('lib', tgt) %> - + ${json.dumps([{"name": tgt.name, + "type": typ, "language": tgt.language, + "third_party": tgt.boringssl or tgt.zlib, "src": sorted( - no_protos(tgt.src) + - tgt.get('public_headers', []) + + no_protos(tgt.src) + + tgt.get('public_headers', []) + tgt.get('headers', [])), "headers": sorted( - tgt.get('public_headers', []) + - tgt.get('headers', []) + + tgt.get('public_headers', []) + + tgt.get('headers', []) + proto_headers(tgt.src)), "deps": sorted(tgt.get('deps', []))} - for tgt in (targets + libs) - if not tgt.boringssl and not tgt.zlib], + for typ, tgt in all_targets(targets, libs)], sort_keys=True, indent=2)} diff --git a/test/core/bad_ssl/gen_build_yaml.py b/test/core/bad_ssl/gen_build_yaml.py index cc097a8fdf..e2a3febe5d 100755 --- a/test/core/bad_ssl/gen_build_yaml.py +++ b/test/core/bad_ssl/gen_build_yaml.py @@ -52,8 +52,8 @@ def main(): 'name': 'bad_ssl_test_server', 'build': 'private', 'language': 'c', - 'src': ['test/core/bad_ssl/server.c'], - 'headers': ['test/core/bad_ssl/server.h'], + 'src': ['test/core/bad_ssl/server_common.c'], + 'headers': ['test/core/bad_ssl/server_common.h'], 'vs_proj_dir': 'test', 'platforms': ['linux', 'posix', 'mac'], 'deps': [ diff --git a/test/core/bad_ssl/server.c b/test/core/bad_ssl/server.c deleted file mode 100644 index 6113d364c9..0000000000 --- a/test/core/bad_ssl/server.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include -#include - -#include "test/core/bad_ssl/server.h" -#include "test/core/util/test_config.h" - -/* Common server implementation details for all servers in servers/. - * There's nothing *wrong* with these servers per-se, but they are - * configured to cause some failure case in the SSL connection path. - */ - -static int got_sigint = 0; - -static void sigint_handler(int x) { got_sigint = 1; } - -const char *bad_ssl_addr(int argc, char **argv) { - gpr_cmdline *cl; - char *addr = NULL; - cl = gpr_cmdline_create("test server"); - gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr); - gpr_cmdline_parse(cl, argc, argv); - gpr_cmdline_destroy(cl); - GPR_ASSERT(addr); - return addr; -} - -void bad_ssl_run(grpc_server *server) { - int shutdown_started = 0; - int shutdown_finished = 0; - grpc_event ev; - grpc_call_error error; - grpc_call *s = NULL; - grpc_call_details call_details; - grpc_metadata_array request_metadata_recv; - grpc_completion_queue *cq = grpc_completion_queue_create(NULL); - - grpc_call_details_init(&call_details); - grpc_metadata_array_init(&request_metadata_recv); - - grpc_server_register_completion_queue(server, cq, NULL); - grpc_server_start(server); - - error = grpc_server_request_call(server, &s, &call_details, - &request_metadata_recv, cq, cq, (void *)1); - GPR_ASSERT(GRPC_CALL_OK == error); - - signal(SIGINT, sigint_handler); - while (!shutdown_finished) { - if (got_sigint && !shutdown_started) { - gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - grpc_server_shutdown_and_notify(server, cq, NULL); - GPR_ASSERT(grpc_completion_queue_pluck( - cq, NULL, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) - .type == GRPC_OP_COMPLETE); - grpc_completion_queue_shutdown(cq); - shutdown_started = 1; - } - ev = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), - NULL); - switch (ev.type) { - case GRPC_OP_COMPLETE: - GPR_ASSERT(ev.tag == (void *)1); - GPR_ASSERT(ev.success == 0); - break; - case GRPC_QUEUE_SHUTDOWN: - GPR_ASSERT(shutdown_started); - shutdown_finished = 1; - break; - case GRPC_QUEUE_TIMEOUT: - break; - } - } - - GPR_ASSERT(s == NULL); - grpc_call_details_destroy(&call_details); - grpc_metadata_array_destroy(&request_metadata_recv); -} diff --git a/test/core/bad_ssl/server.h b/test/core/bad_ssl/server.h deleted file mode 100644 index 8ec7755503..0000000000 --- a/test/core/bad_ssl/server.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_TEST_CORE_BAD_SSL_SERVER_H -#define GRPC_TEST_CORE_BAD_SSL_SERVER_H - -#include - -const char *bad_ssl_addr(int argc, char **argv); -void bad_ssl_run(grpc_server *server); - -#endif /* GRPC_TEST_CORE_BAD_SSL_SERVER_H */ diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c new file mode 100644 index 0000000000..14b1892c2e --- /dev/null +++ b/test/core/bad_ssl/server_common.c @@ -0,0 +1,113 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include + +#include "test/core/bad_ssl/server_common.h" +#include "test/core/util/test_config.h" + +/* Common server implementation details for all servers in servers/. + * There's nothing *wrong* with these servers per-se, but they are + * configured to cause some failure case in the SSL connection path. + */ + +static int got_sigint = 0; + +static void sigint_handler(int x) { got_sigint = 1; } + +const char *bad_ssl_addr(int argc, char **argv) { + gpr_cmdline *cl; + char *addr = NULL; + cl = gpr_cmdline_create("test server"); + gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr); + gpr_cmdline_parse(cl, argc, argv); + gpr_cmdline_destroy(cl); + GPR_ASSERT(addr); + return addr; +} + +void bad_ssl_run(grpc_server *server) { + int shutdown_started = 0; + int shutdown_finished = 0; + grpc_event ev; + grpc_call_error error; + grpc_call *s = NULL; + grpc_call_details call_details; + grpc_metadata_array request_metadata_recv; + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); + + grpc_call_details_init(&call_details); + grpc_metadata_array_init(&request_metadata_recv); + + grpc_server_register_completion_queue(server, cq, NULL); + grpc_server_start(server); + + error = grpc_server_request_call(server, &s, &call_details, + &request_metadata_recv, cq, cq, (void *)1); + GPR_ASSERT(GRPC_CALL_OK == error); + + signal(SIGINT, sigint_handler); + while (!shutdown_finished) { + if (got_sigint && !shutdown_started) { + gpr_log(GPR_INFO, "Shutting down due to SIGINT"); + grpc_server_shutdown_and_notify(server, cq, NULL); + GPR_ASSERT(grpc_completion_queue_pluck( + cq, NULL, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + .type == GRPC_OP_COMPLETE); + grpc_completion_queue_shutdown(cq); + shutdown_started = 1; + } + ev = grpc_completion_queue_next( + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), + NULL); + switch (ev.type) { + case GRPC_OP_COMPLETE: + GPR_ASSERT(ev.tag == (void *)1); + GPR_ASSERT(ev.success == 0); + break; + case GRPC_QUEUE_SHUTDOWN: + GPR_ASSERT(shutdown_started); + shutdown_finished = 1; + break; + case GRPC_QUEUE_TIMEOUT: + break; + } + } + + GPR_ASSERT(s == NULL); + grpc_call_details_destroy(&call_details); + grpc_metadata_array_destroy(&request_metadata_recv); +} diff --git a/test/core/bad_ssl/server_common.h b/test/core/bad_ssl/server_common.h new file mode 100644 index 0000000000..8ec7755503 --- /dev/null +++ b/test/core/bad_ssl/server_common.h @@ -0,0 +1,42 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_TEST_CORE_BAD_SSL_SERVER_H +#define GRPC_TEST_CORE_BAD_SSL_SERVER_H + +#include + +const char *bad_ssl_addr(int argc, char **argv); +void bad_ssl_run(grpc_server *server); + +#endif /* GRPC_TEST_CORE_BAD_SSL_SERVER_H */ diff --git a/test/core/bad_ssl/servers/alpn.c b/test/core/bad_ssl/servers/alpn.c index 7d70690e52..dd0eb793d4 100644 --- a/test/core/bad_ssl/servers/alpn.c +++ b/test/core/bad_ssl/servers/alpn.c @@ -39,7 +39,7 @@ #include #include "src/core/transport/chttp2/alpn.h" -#include "test/core/bad_ssl/server.h" +#include "test/core/bad_ssl/server_common.h" #include "test/core/end2end/data/ssl_test_data.h" /* This test starts a server that is configured to advertise (via alpn and npn) diff --git a/test/core/bad_ssl/servers/cert.c b/test/core/bad_ssl/servers/cert.c index d67a6ca1d4..d262ce16d8 100644 --- a/test/core/bad_ssl/servers/cert.c +++ b/test/core/bad_ssl/servers/cert.c @@ -38,9 +38,9 @@ #include #include -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" -#include "test/core/bad_ssl/server.h" +#include "test/core/bad_ssl/server_common.h" #include "test/core/end2end/data/ssl_test_data.h" /* This server will present an untrusted cert to the connecting client, diff --git a/test/core/census/log_test.c b/test/core/census/log_test.c deleted file mode 100644 index b68ca11504..0000000000 --- a/test/core/census/log_test.c +++ /dev/null @@ -1,589 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "src/core/census/log.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "test/core/util/test_config.h" - -// Change this to non-zero if you want more output. -#define VERBOSE 0 - -// Log size to use for all tests. -#define LOG_SIZE_IN_MB 1 -#define LOG_SIZE_IN_BYTES (LOG_SIZE_IN_MB << 20) - -// Fills in 'record' of size 'size'. Each byte in record is filled in with the -// same value. The value is extracted from 'record' pointer. -static void write_record(char* record, size_t size) { - char data = (char)((uintptr_t)record % 255); - memset(record, data, size); -} - -// Reads fixed size records. Returns the number of records read in -// 'num_records'. -static void read_records(size_t record_size, const char* buffer, - size_t buffer_size, int* num_records) { - GPR_ASSERT(buffer_size >= record_size); - GPR_ASSERT(buffer_size % record_size == 0); - *num_records = (int)(buffer_size / record_size); - for (int i = 0; i < *num_records; ++i) { - const char* record = buffer + (record_size * (size_t)i); - char data = (char)((uintptr_t)record % 255); - for (size_t j = 0; j < record_size; ++j) { - GPR_ASSERT(data == record[j]); - } - } -} - -// Tries to write the specified number of records. Stops when the log gets -// full. Returns the number of records written. Spins for random -// number of times, up to 'max_spin_count', between writes. -static int write_records_to_log(int writer_id, size_t record_size, - int num_records, int max_spin_count) { - int counter = 0; - for (int i = 0; i < num_records; ++i) { - int spin_count = max_spin_count ? rand() % max_spin_count : 0; - if (VERBOSE && (counter++ == num_records / 10)) { - printf(" Writer %d: %d out of %d written\n", writer_id, i, num_records); - counter = 0; - } - char* record = (char*)(census_log_start_write(record_size)); - if (record == NULL) { - return i; - } - write_record(record, record_size); - census_log_end_write(record, record_size); - for (int j = 0; j < spin_count; ++j) { - GPR_ASSERT(j >= 0); - } - } - return num_records; -} - -// Performs a single read iteration. Returns the number of records read. -static int perform_read_iteration(size_t record_size) { - const void* read_buffer = NULL; - size_t bytes_available; - int records_read = 0; - census_log_init_reader(); - while ((read_buffer = census_log_read_next(&bytes_available))) { - int num_records = 0; - read_records(record_size, (const char*)read_buffer, bytes_available, - &num_records); - records_read += num_records; - } - return records_read; -} - -// Asserts that the log is empty. -static void assert_log_empty(void) { - census_log_init_reader(); - size_t bytes_available; - GPR_ASSERT(census_log_read_next(&bytes_available) == NULL); -} - -// Fills the log and verifies data. If 'no fragmentation' is true, records -// are sized such that CENSUS_LOG_2_MAX_RECORD_SIZE is a multiple of record -// size. If not a circular log, verifies that the number of records written -// match the number of records read. -static void fill_log(size_t log_size, int no_fragmentation, int circular_log) { - size_t size; - if (no_fragmentation) { - int log2size = rand() % (CENSUS_LOG_2_MAX_RECORD_SIZE + 1); - size = ((size_t)1 << log2size); - } else { - while (1) { - size = 1 + ((size_t)rand() % CENSUS_LOG_MAX_RECORD_SIZE); - if (CENSUS_LOG_MAX_RECORD_SIZE % size) { - break; - } - } - } - int records_written = - write_records_to_log(0 /* writer id */, size, - (int)((log_size / size) * 2), 0 /* spin count */); - int records_read = perform_read_iteration(size); - if (!circular_log) { - GPR_ASSERT(records_written == records_read); - } - assert_log_empty(); -} - -// Structure to pass args to writer_thread -typedef struct writer_thread_args { - // Index of this thread in the writers vector. - int index; - // Record size. - size_t record_size; - // Number of records to write. - int num_records; - // Used to signal when writer is complete - gpr_cv* done; - gpr_mu* mu; - int* count; -} writer_thread_args; - -// Writes the given number of records of random size (up to kMaxRecordSize) and -// random data to the specified log. -static void writer_thread(void* arg) { - writer_thread_args* args = (writer_thread_args*)arg; - // Maximum number of times to spin between writes. - static const int MAX_SPIN_COUNT = 50; - int records_written = 0; - if (VERBOSE) { - printf(" Writer %d starting\n", args->index); - } - while (records_written < args->num_records) { - records_written += write_records_to_log(args->index, args->record_size, - args->num_records - records_written, - MAX_SPIN_COUNT); - if (records_written < args->num_records) { - // Ran out of log space. Sleep for a bit and let the reader catch up. - // This should never happen for circular logs. - if (VERBOSE) { - printf( - " Writer %d stalled due to out-of-space: %d out of %d " - "written\n", - args->index, records_written, args->num_records); - } - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)); - } - } - // Done. Decrement count and signal. - gpr_mu_lock(args->mu); - (*args->count)--; - gpr_cv_signal(args->done); - if (VERBOSE) { - printf(" Writer %d done\n", args->index); - } - gpr_mu_unlock(args->mu); -} - -// struct to pass args to reader_thread -typedef struct reader_thread_args { - // Record size. - size_t record_size; - // Interval between read iterations. - int read_iteration_interval_in_msec; - // Total number of records. - int total_records; - // Signalled when reader should stop. - gpr_cv stop; - int stop_flag; - // Used to signal when reader has finished - gpr_cv* done; - gpr_mu* mu; - int running; -} reader_thread_args; - -// Reads and verifies the specified number of records. Reader can also be -// stopped via gpr_cv_signal(&args->stop). Sleeps for 'read_interval_in_msec' -// between read iterations. -static void reader_thread(void* arg) { - reader_thread_args* args = (reader_thread_args*)arg; - if (VERBOSE) { - printf(" Reader starting\n"); - } - gpr_timespec interval = gpr_time_from_micros( - args->read_iteration_interval_in_msec * 1000, GPR_TIMESPAN); - gpr_mu_lock(args->mu); - int records_read = 0; - int num_iterations = 0; - int counter = 0; - while (!args->stop_flag && records_read < args->total_records) { - gpr_cv_wait(&args->stop, args->mu, interval); - if (!args->stop_flag) { - records_read += perform_read_iteration(args->record_size); - GPR_ASSERT(records_read <= args->total_records); - if (VERBOSE && (counter++ == 100000)) { - printf(" Reader: %d out of %d read\n", records_read, - args->total_records); - counter = 0; - } - ++num_iterations; - } - } - // Done - args->running = 0; - gpr_cv_signal(args->done); - if (VERBOSE) { - printf(" Reader: records: %d, iterations: %d\n", records_read, - num_iterations); - } - gpr_mu_unlock(args->mu); -} - -// Creates NUM_WRITERS writers where each writer writes NUM_RECORDS_PER_WRITER -// records. Also, starts a reader that iterates over and reads blocks every -// READ_ITERATION_INTERVAL_IN_MSEC. -// Number of writers. -#define NUM_WRITERS 5 -static void multiple_writers_single_reader(int circular_log) { - // Sleep interval between read iterations. - static const int READ_ITERATION_INTERVAL_IN_MSEC = 10; - // Maximum record size. - static const size_t MAX_RECORD_SIZE = 20; - // Number of records written by each writer. This is sized such that we - // will write through the entire log ~10 times. - const int NUM_RECORDS_PER_WRITER = - (int)((10 * census_log_remaining_space()) / (MAX_RECORD_SIZE / 2)) / - NUM_WRITERS; - size_t record_size = ((size_t)rand() % MAX_RECORD_SIZE) + 1; - // Create and start writers. - writer_thread_args writers[NUM_WRITERS]; - int writers_count = NUM_WRITERS; - gpr_cv writers_done; - gpr_mu writers_mu; // protects writers_done and writers_count - gpr_cv_init(&writers_done); - gpr_mu_init(&writers_mu); - gpr_thd_id id; - for (int i = 0; i < NUM_WRITERS; ++i) { - writers[i].index = i; - writers[i].record_size = record_size; - writers[i].num_records = NUM_RECORDS_PER_WRITER; - writers[i].done = &writers_done; - writers[i].count = &writers_count; - writers[i].mu = &writers_mu; - gpr_thd_new(&id, &writer_thread, &writers[i], NULL); - } - // Start reader. - gpr_cv reader_done; - gpr_mu reader_mu; // protects reader_done and reader.running - reader_thread_args reader; - reader.record_size = record_size; - reader.read_iteration_interval_in_msec = READ_ITERATION_INTERVAL_IN_MSEC; - reader.total_records = NUM_WRITERS * NUM_RECORDS_PER_WRITER; - reader.stop_flag = 0; - gpr_cv_init(&reader.stop); - gpr_cv_init(&reader_done); - reader.done = &reader_done; - gpr_mu_init(&reader_mu); - reader.mu = &reader_mu; - reader.running = 1; - gpr_thd_new(&id, &reader_thread, &reader, NULL); - // Wait for writers to finish. - gpr_mu_lock(&writers_mu); - while (writers_count != 0) { - gpr_cv_wait(&writers_done, &writers_mu, gpr_inf_future(GPR_CLOCK_REALTIME)); - } - gpr_mu_unlock(&writers_mu); - gpr_mu_destroy(&writers_mu); - gpr_cv_destroy(&writers_done); - gpr_mu_lock(&reader_mu); - if (circular_log) { - // Stop reader. - reader.stop_flag = 1; - gpr_cv_signal(&reader.stop); - } - // wait for reader to finish - while (reader.running) { - gpr_cv_wait(&reader_done, &reader_mu, gpr_inf_future(GPR_CLOCK_REALTIME)); - } - if (circular_log) { - // Assert that there were no out-of-space errors. - GPR_ASSERT(0 == census_log_out_of_space_count()); - } - gpr_mu_unlock(&reader_mu); - gpr_mu_destroy(&reader_mu); - gpr_cv_destroy(&reader_done); - if (VERBOSE) { - printf(" Reader: finished\n"); - } -} - -static void setup_test(int circular_log) { - census_log_initialize(LOG_SIZE_IN_MB, circular_log); - GPR_ASSERT(census_log_remaining_space() == LOG_SIZE_IN_BYTES); -} - -// Attempts to create a record of invalid size (size > -// CENSUS_LOG_MAX_RECORD_SIZE). -void test_invalid_record_size(void) { - static const size_t INVALID_SIZE = CENSUS_LOG_MAX_RECORD_SIZE + 1; - static const size_t VALID_SIZE = 1; - printf("Starting test: invalid record size\n"); - setup_test(0); - void* record = census_log_start_write(INVALID_SIZE); - GPR_ASSERT(record == NULL); - // Now try writing a valid record. - record = census_log_start_write(VALID_SIZE); - GPR_ASSERT(record != NULL); - census_log_end_write(record, VALID_SIZE); - // Verifies that available space went down by one block. In theory, this - // check can fail if the thread is context switched to a new CPU during the - // start_write execution (multiple blocks get allocated), but this has not - // been observed in practice. - GPR_ASSERT(LOG_SIZE_IN_BYTES - CENSUS_LOG_MAX_RECORD_SIZE == - census_log_remaining_space()); - census_log_shutdown(); -} - -// Tests end_write() with a different size than what was specified in -// start_write(). -void test_end_write_with_different_size(void) { - static const size_t START_WRITE_SIZE = 10; - static const size_t END_WRITE_SIZE = 7; - printf("Starting test: end write with different size\n"); - setup_test(0); - void* record_written = census_log_start_write(START_WRITE_SIZE); - GPR_ASSERT(record_written != NULL); - census_log_end_write(record_written, END_WRITE_SIZE); - census_log_init_reader(); - size_t bytes_available; - const void* record_read = census_log_read_next(&bytes_available); - GPR_ASSERT(record_written == record_read); - GPR_ASSERT(END_WRITE_SIZE == bytes_available); - assert_log_empty(); - census_log_shutdown(); -} - -// Verifies that pending records are not available via read_next(). -void test_read_pending_record(void) { - static const size_t PR_RECORD_SIZE = 1024; - printf("Starting test: read pending record\n"); - setup_test(0); - // Start a write. - void* record_written = census_log_start_write(PR_RECORD_SIZE); - GPR_ASSERT(record_written != NULL); - // As write is pending, read should fail. - census_log_init_reader(); - size_t bytes_available; - const void* record_read = census_log_read_next(&bytes_available); - GPR_ASSERT(record_read == NULL); - // A read followed by end_write() should succeed. - census_log_end_write(record_written, PR_RECORD_SIZE); - census_log_init_reader(); - record_read = census_log_read_next(&bytes_available); - GPR_ASSERT(record_written == record_read); - GPR_ASSERT(PR_RECORD_SIZE == bytes_available); - assert_log_empty(); - census_log_shutdown(); -} - -// Tries reading beyond pending write. -void test_read_beyond_pending_record(void) { - printf("Starting test: read beyond pending record\n"); - setup_test(0); - // Start a write. - const size_t incomplete_record_size = 10; - void* incomplete_record = census_log_start_write(incomplete_record_size); - GPR_ASSERT(incomplete_record != NULL); - const size_t complete_record_size = 20; - void* complete_record = census_log_start_write(complete_record_size); - GPR_ASSERT(complete_record != NULL); - GPR_ASSERT(complete_record != incomplete_record); - census_log_end_write(complete_record, complete_record_size); - // Now iterate over blocks to read completed records. - census_log_init_reader(); - size_t bytes_available; - const void* record_read = census_log_read_next(&bytes_available); - GPR_ASSERT(complete_record == record_read); - GPR_ASSERT(complete_record_size == bytes_available); - // Complete first record. - census_log_end_write(incomplete_record, incomplete_record_size); - // Have read past the incomplete record, so read_next() should return NULL. - // NB: this test also assumes our thread did not get switched to a different - // CPU between the two start_write calls - record_read = census_log_read_next(&bytes_available); - GPR_ASSERT(record_read == NULL); - // Reset reader to get the newly completed record. - census_log_init_reader(); - record_read = census_log_read_next(&bytes_available); - GPR_ASSERT(incomplete_record == record_read); - GPR_ASSERT(incomplete_record_size == bytes_available); - assert_log_empty(); - census_log_shutdown(); -} - -// Tests scenario where block being read is detached from a core and put on the -// dirty list. -void test_detached_while_reading(void) { - printf("Starting test: detached while reading\n"); - setup_test(0); - // Start a write. - static const size_t DWR_RECORD_SIZE = 10; - void* record_written = census_log_start_write(DWR_RECORD_SIZE); - GPR_ASSERT(record_written != NULL); - census_log_end_write(record_written, DWR_RECORD_SIZE); - // Read this record. - census_log_init_reader(); - size_t bytes_available; - const void* record_read = census_log_read_next(&bytes_available); - GPR_ASSERT(record_read != NULL); - GPR_ASSERT(DWR_RECORD_SIZE == bytes_available); - // Now fill the log. This will move the block being read from core-local - // array to the dirty list. - while ((record_written = census_log_start_write(DWR_RECORD_SIZE))) { - census_log_end_write(record_written, DWR_RECORD_SIZE); - } - - // In this iteration, read_next() should only traverse blocks in the - // core-local array. Therefore, we expect at most gpr_cpu_num_cores() more - // blocks. As log is full, if read_next() is traversing the dirty list, we - // will get more than gpr_cpu_num_cores() blocks. - int block_read = 0; - while ((record_read = census_log_read_next(&bytes_available))) { - ++block_read; - GPR_ASSERT(block_read <= (int)gpr_cpu_num_cores()); - } - census_log_shutdown(); -} - -// Fills non-circular log with records sized such that size is a multiple of -// CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). -void test_fill_log_no_fragmentation(void) { - printf("Starting test: fill log no fragmentation\n"); - const int circular = 0; - setup_test(circular); - fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular); - census_log_shutdown(); -} - -// Fills circular log with records sized such that size is a multiple of -// CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). -void test_fill_circular_log_no_fragmentation(void) { - printf("Starting test: fill circular log no fragmentation\n"); - const int circular = 1; - setup_test(circular); - fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular); - census_log_shutdown(); -} - -// Fills non-circular log with records that may straddle end of a block. -void test_fill_log_with_straddling_records(void) { - printf("Starting test: fill log with straddling records\n"); - const int circular = 0; - setup_test(circular); - fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular); - census_log_shutdown(); -} - -// Fills circular log with records that may straddle end of a block. -void test_fill_circular_log_with_straddling_records(void) { - printf("Starting test: fill circular log with straddling records\n"); - const int circular = 1; - setup_test(circular); - fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular); - census_log_shutdown(); -} - -// Tests scenario where multiple writers and a single reader are using a log -// that is configured to discard old records. -void test_multiple_writers_circular_log(void) { - printf("Starting test: multiple writers circular log\n"); - const int circular = 1; - setup_test(circular); - multiple_writers_single_reader(circular); - census_log_shutdown(); -} - -// Tests scenario where multiple writers and a single reader are using a log -// that is configured to discard old records. -void test_multiple_writers(void) { - printf("Starting test: multiple writers\n"); - const int circular = 0; - setup_test(circular); - multiple_writers_single_reader(circular); - census_log_shutdown(); -} - -// Repeat the straddling records and multiple writers tests with a small log. -void test_small_log(void) { - printf("Starting test: small log\n"); - const int circular = 0; - census_log_initialize(0, circular); - size_t log_size = census_log_remaining_space(); - GPR_ASSERT(log_size > 0); - fill_log(log_size, 0, circular); - census_log_shutdown(); - census_log_initialize(0, circular); - multiple_writers_single_reader(circular); - census_log_shutdown(); -} - -void test_performance(void) { - for (size_t write_size = 1; write_size < CENSUS_LOG_MAX_RECORD_SIZE; - write_size *= 2) { - setup_test(0); - gpr_timespec start_time = gpr_now(GPR_CLOCK_REALTIME); - int nrecords = 0; - while (1) { - void* record = census_log_start_write(write_size); - if (record == NULL) { - break; - } - census_log_end_write(record, write_size); - nrecords++; - } - gpr_timespec write_time = - gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start_time); - double write_time_micro = - (double)write_time.tv_sec * 1000000 + (double)write_time.tv_nsec / 1000; - census_log_shutdown(); - printf( - "Wrote %d %d byte records in %.3g microseconds: %g records/us " - "(%g ns/record), %g gigabytes/s\n", - nrecords, (int)write_size, write_time_micro, - nrecords / write_time_micro, 1000 * write_time_micro / nrecords, - (double)((int)write_size * nrecords) / write_time_micro / 1000); - } -} - -int main(int argc, char** argv) { - grpc_test_init(argc, argv); - gpr_time_init(); - srand((unsigned)gpr_now(GPR_CLOCK_REALTIME).tv_nsec); - test_invalid_record_size(); - test_end_write_with_different_size(); - test_read_pending_record(); - test_read_beyond_pending_record(); - test_detached_while_reading(); - test_fill_log_no_fragmentation(); - test_fill_circular_log_no_fragmentation(); - test_fill_log_with_straddling_records(); - test_fill_circular_log_with_straddling_records(); - test_small_log(); - test_multiple_writers(); - test_multiple_writers_circular_log(); - test_performance(); - return 0; -} diff --git a/test/core/census/mlog_test.c b/test/core/census/mlog_test.c new file mode 100644 index 0000000000..5b6c5946ab --- /dev/null +++ b/test/core/census/mlog_test.c @@ -0,0 +1,589 @@ +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/census/mlog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test/core/util/test_config.h" + +// Change this to non-zero if you want more output. +#define VERBOSE 0 + +// Log size to use for all tests. +#define LOG_SIZE_IN_MB 1 +#define LOG_SIZE_IN_BYTES (LOG_SIZE_IN_MB << 20) + +// Fills in 'record' of size 'size'. Each byte in record is filled in with the +// same value. The value is extracted from 'record' pointer. +static void write_record(char* record, size_t size) { + char data = (char)((uintptr_t)record % 255); + memset(record, data, size); +} + +// Reads fixed size records. Returns the number of records read in +// 'num_records'. +static void read_records(size_t record_size, const char* buffer, + size_t buffer_size, int* num_records) { + GPR_ASSERT(buffer_size >= record_size); + GPR_ASSERT(buffer_size % record_size == 0); + *num_records = (int)(buffer_size / record_size); + for (int i = 0; i < *num_records; ++i) { + const char* record = buffer + (record_size * (size_t)i); + char data = (char)((uintptr_t)record % 255); + for (size_t j = 0; j < record_size; ++j) { + GPR_ASSERT(data == record[j]); + } + } +} + +// Tries to write the specified number of records. Stops when the log gets +// full. Returns the number of records written. Spins for random +// number of times, up to 'max_spin_count', between writes. +static int write_records_to_log(int writer_id, size_t record_size, + int num_records, int max_spin_count) { + int counter = 0; + for (int i = 0; i < num_records; ++i) { + int spin_count = max_spin_count ? rand() % max_spin_count : 0; + if (VERBOSE && (counter++ == num_records / 10)) { + printf(" Writer %d: %d out of %d written\n", writer_id, i, num_records); + counter = 0; + } + char* record = (char*)(census_log_start_write(record_size)); + if (record == NULL) { + return i; + } + write_record(record, record_size); + census_log_end_write(record, record_size); + for (int j = 0; j < spin_count; ++j) { + GPR_ASSERT(j >= 0); + } + } + return num_records; +} + +// Performs a single read iteration. Returns the number of records read. +static int perform_read_iteration(size_t record_size) { + const void* read_buffer = NULL; + size_t bytes_available; + int records_read = 0; + census_log_init_reader(); + while ((read_buffer = census_log_read_next(&bytes_available))) { + int num_records = 0; + read_records(record_size, (const char*)read_buffer, bytes_available, + &num_records); + records_read += num_records; + } + return records_read; +} + +// Asserts that the log is empty. +static void assert_log_empty(void) { + census_log_init_reader(); + size_t bytes_available; + GPR_ASSERT(census_log_read_next(&bytes_available) == NULL); +} + +// Fills the log and verifies data. If 'no fragmentation' is true, records +// are sized such that CENSUS_LOG_2_MAX_RECORD_SIZE is a multiple of record +// size. If not a circular log, verifies that the number of records written +// match the number of records read. +static void fill_log(size_t log_size, int no_fragmentation, int circular_log) { + size_t size; + if (no_fragmentation) { + int log2size = rand() % (CENSUS_LOG_2_MAX_RECORD_SIZE + 1); + size = ((size_t)1 << log2size); + } else { + while (1) { + size = 1 + ((size_t)rand() % CENSUS_LOG_MAX_RECORD_SIZE); + if (CENSUS_LOG_MAX_RECORD_SIZE % size) { + break; + } + } + } + int records_written = + write_records_to_log(0 /* writer id */, size, + (int)((log_size / size) * 2), 0 /* spin count */); + int records_read = perform_read_iteration(size); + if (!circular_log) { + GPR_ASSERT(records_written == records_read); + } + assert_log_empty(); +} + +// Structure to pass args to writer_thread +typedef struct writer_thread_args { + // Index of this thread in the writers vector. + int index; + // Record size. + size_t record_size; + // Number of records to write. + int num_records; + // Used to signal when writer is complete + gpr_cv* done; + gpr_mu* mu; + int* count; +} writer_thread_args; + +// Writes the given number of records of random size (up to kMaxRecordSize) and +// random data to the specified log. +static void writer_thread(void* arg) { + writer_thread_args* args = (writer_thread_args*)arg; + // Maximum number of times to spin between writes. + static const int MAX_SPIN_COUNT = 50; + int records_written = 0; + if (VERBOSE) { + printf(" Writer %d starting\n", args->index); + } + while (records_written < args->num_records) { + records_written += write_records_to_log(args->index, args->record_size, + args->num_records - records_written, + MAX_SPIN_COUNT); + if (records_written < args->num_records) { + // Ran out of log space. Sleep for a bit and let the reader catch up. + // This should never happen for circular logs. + if (VERBOSE) { + printf( + " Writer %d stalled due to out-of-space: %d out of %d " + "written\n", + args->index, records_written, args->num_records); + } + gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)); + } + } + // Done. Decrement count and signal. + gpr_mu_lock(args->mu); + (*args->count)--; + gpr_cv_signal(args->done); + if (VERBOSE) { + printf(" Writer %d done\n", args->index); + } + gpr_mu_unlock(args->mu); +} + +// struct to pass args to reader_thread +typedef struct reader_thread_args { + // Record size. + size_t record_size; + // Interval between read iterations. + int read_iteration_interval_in_msec; + // Total number of records. + int total_records; + // Signalled when reader should stop. + gpr_cv stop; + int stop_flag; + // Used to signal when reader has finished + gpr_cv* done; + gpr_mu* mu; + int running; +} reader_thread_args; + +// Reads and verifies the specified number of records. Reader can also be +// stopped via gpr_cv_signal(&args->stop). Sleeps for 'read_interval_in_msec' +// between read iterations. +static void reader_thread(void* arg) { + reader_thread_args* args = (reader_thread_args*)arg; + if (VERBOSE) { + printf(" Reader starting\n"); + } + gpr_timespec interval = gpr_time_from_micros( + args->read_iteration_interval_in_msec * 1000, GPR_TIMESPAN); + gpr_mu_lock(args->mu); + int records_read = 0; + int num_iterations = 0; + int counter = 0; + while (!args->stop_flag && records_read < args->total_records) { + gpr_cv_wait(&args->stop, args->mu, interval); + if (!args->stop_flag) { + records_read += perform_read_iteration(args->record_size); + GPR_ASSERT(records_read <= args->total_records); + if (VERBOSE && (counter++ == 100000)) { + printf(" Reader: %d out of %d read\n", records_read, + args->total_records); + counter = 0; + } + ++num_iterations; + } + } + // Done + args->running = 0; + gpr_cv_signal(args->done); + if (VERBOSE) { + printf(" Reader: records: %d, iterations: %d\n", records_read, + num_iterations); + } + gpr_mu_unlock(args->mu); +} + +// Creates NUM_WRITERS writers where each writer writes NUM_RECORDS_PER_WRITER +// records. Also, starts a reader that iterates over and reads blocks every +// READ_ITERATION_INTERVAL_IN_MSEC. +// Number of writers. +#define NUM_WRITERS 5 +static void multiple_writers_single_reader(int circular_log) { + // Sleep interval between read iterations. + static const int READ_ITERATION_INTERVAL_IN_MSEC = 10; + // Maximum record size. + static const size_t MAX_RECORD_SIZE = 20; + // Number of records written by each writer. This is sized such that we + // will write through the entire log ~10 times. + const int NUM_RECORDS_PER_WRITER = + (int)((10 * census_log_remaining_space()) / (MAX_RECORD_SIZE / 2)) / + NUM_WRITERS; + size_t record_size = ((size_t)rand() % MAX_RECORD_SIZE) + 1; + // Create and start writers. + writer_thread_args writers[NUM_WRITERS]; + int writers_count = NUM_WRITERS; + gpr_cv writers_done; + gpr_mu writers_mu; // protects writers_done and writers_count + gpr_cv_init(&writers_done); + gpr_mu_init(&writers_mu); + gpr_thd_id id; + for (int i = 0; i < NUM_WRITERS; ++i) { + writers[i].index = i; + writers[i].record_size = record_size; + writers[i].num_records = NUM_RECORDS_PER_WRITER; + writers[i].done = &writers_done; + writers[i].count = &writers_count; + writers[i].mu = &writers_mu; + gpr_thd_new(&id, &writer_thread, &writers[i], NULL); + } + // Start reader. + gpr_cv reader_done; + gpr_mu reader_mu; // protects reader_done and reader.running + reader_thread_args reader; + reader.record_size = record_size; + reader.read_iteration_interval_in_msec = READ_ITERATION_INTERVAL_IN_MSEC; + reader.total_records = NUM_WRITERS * NUM_RECORDS_PER_WRITER; + reader.stop_flag = 0; + gpr_cv_init(&reader.stop); + gpr_cv_init(&reader_done); + reader.done = &reader_done; + gpr_mu_init(&reader_mu); + reader.mu = &reader_mu; + reader.running = 1; + gpr_thd_new(&id, &reader_thread, &reader, NULL); + // Wait for writers to finish. + gpr_mu_lock(&writers_mu); + while (writers_count != 0) { + gpr_cv_wait(&writers_done, &writers_mu, gpr_inf_future(GPR_CLOCK_REALTIME)); + } + gpr_mu_unlock(&writers_mu); + gpr_mu_destroy(&writers_mu); + gpr_cv_destroy(&writers_done); + gpr_mu_lock(&reader_mu); + if (circular_log) { + // Stop reader. + reader.stop_flag = 1; + gpr_cv_signal(&reader.stop); + } + // wait for reader to finish + while (reader.running) { + gpr_cv_wait(&reader_done, &reader_mu, gpr_inf_future(GPR_CLOCK_REALTIME)); + } + if (circular_log) { + // Assert that there were no out-of-space errors. + GPR_ASSERT(0 == census_log_out_of_space_count()); + } + gpr_mu_unlock(&reader_mu); + gpr_mu_destroy(&reader_mu); + gpr_cv_destroy(&reader_done); + if (VERBOSE) { + printf(" Reader: finished\n"); + } +} + +static void setup_test(int circular_log) { + census_log_initialize(LOG_SIZE_IN_MB, circular_log); + GPR_ASSERT(census_log_remaining_space() == LOG_SIZE_IN_BYTES); +} + +// Attempts to create a record of invalid size (size > +// CENSUS_LOG_MAX_RECORD_SIZE). +void test_invalid_record_size(void) { + static const size_t INVALID_SIZE = CENSUS_LOG_MAX_RECORD_SIZE + 1; + static const size_t VALID_SIZE = 1; + printf("Starting test: invalid record size\n"); + setup_test(0); + void* record = census_log_start_write(INVALID_SIZE); + GPR_ASSERT(record == NULL); + // Now try writing a valid record. + record = census_log_start_write(VALID_SIZE); + GPR_ASSERT(record != NULL); + census_log_end_write(record, VALID_SIZE); + // Verifies that available space went down by one block. In theory, this + // check can fail if the thread is context switched to a new CPU during the + // start_write execution (multiple blocks get allocated), but this has not + // been observed in practice. + GPR_ASSERT(LOG_SIZE_IN_BYTES - CENSUS_LOG_MAX_RECORD_SIZE == + census_log_remaining_space()); + census_log_shutdown(); +} + +// Tests end_write() with a different size than what was specified in +// start_write(). +void test_end_write_with_different_size(void) { + static const size_t START_WRITE_SIZE = 10; + static const size_t END_WRITE_SIZE = 7; + printf("Starting test: end write with different size\n"); + setup_test(0); + void* record_written = census_log_start_write(START_WRITE_SIZE); + GPR_ASSERT(record_written != NULL); + census_log_end_write(record_written, END_WRITE_SIZE); + census_log_init_reader(); + size_t bytes_available; + const void* record_read = census_log_read_next(&bytes_available); + GPR_ASSERT(record_written == record_read); + GPR_ASSERT(END_WRITE_SIZE == bytes_available); + assert_log_empty(); + census_log_shutdown(); +} + +// Verifies that pending records are not available via read_next(). +void test_read_pending_record(void) { + static const size_t PR_RECORD_SIZE = 1024; + printf("Starting test: read pending record\n"); + setup_test(0); + // Start a write. + void* record_written = census_log_start_write(PR_RECORD_SIZE); + GPR_ASSERT(record_written != NULL); + // As write is pending, read should fail. + census_log_init_reader(); + size_t bytes_available; + const void* record_read = census_log_read_next(&bytes_available); + GPR_ASSERT(record_read == NULL); + // A read followed by end_write() should succeed. + census_log_end_write(record_written, PR_RECORD_SIZE); + census_log_init_reader(); + record_read = census_log_read_next(&bytes_available); + GPR_ASSERT(record_written == record_read); + GPR_ASSERT(PR_RECORD_SIZE == bytes_available); + assert_log_empty(); + census_log_shutdown(); +} + +// Tries reading beyond pending write. +void test_read_beyond_pending_record(void) { + printf("Starting test: read beyond pending record\n"); + setup_test(0); + // Start a write. + const size_t incomplete_record_size = 10; + void* incomplete_record = census_log_start_write(incomplete_record_size); + GPR_ASSERT(incomplete_record != NULL); + const size_t complete_record_size = 20; + void* complete_record = census_log_start_write(complete_record_size); + GPR_ASSERT(complete_record != NULL); + GPR_ASSERT(complete_record != incomplete_record); + census_log_end_write(complete_record, complete_record_size); + // Now iterate over blocks to read completed records. + census_log_init_reader(); + size_t bytes_available; + const void* record_read = census_log_read_next(&bytes_available); + GPR_ASSERT(complete_record == record_read); + GPR_ASSERT(complete_record_size == bytes_available); + // Complete first record. + census_log_end_write(incomplete_record, incomplete_record_size); + // Have read past the incomplete record, so read_next() should return NULL. + // NB: this test also assumes our thread did not get switched to a different + // CPU between the two start_write calls + record_read = census_log_read_next(&bytes_available); + GPR_ASSERT(record_read == NULL); + // Reset reader to get the newly completed record. + census_log_init_reader(); + record_read = census_log_read_next(&bytes_available); + GPR_ASSERT(incomplete_record == record_read); + GPR_ASSERT(incomplete_record_size == bytes_available); + assert_log_empty(); + census_log_shutdown(); +} + +// Tests scenario where block being read is detached from a core and put on the +// dirty list. +void test_detached_while_reading(void) { + printf("Starting test: detached while reading\n"); + setup_test(0); + // Start a write. + static const size_t DWR_RECORD_SIZE = 10; + void* record_written = census_log_start_write(DWR_RECORD_SIZE); + GPR_ASSERT(record_written != NULL); + census_log_end_write(record_written, DWR_RECORD_SIZE); + // Read this record. + census_log_init_reader(); + size_t bytes_available; + const void* record_read = census_log_read_next(&bytes_available); + GPR_ASSERT(record_read != NULL); + GPR_ASSERT(DWR_RECORD_SIZE == bytes_available); + // Now fill the log. This will move the block being read from core-local + // array to the dirty list. + while ((record_written = census_log_start_write(DWR_RECORD_SIZE))) { + census_log_end_write(record_written, DWR_RECORD_SIZE); + } + + // In this iteration, read_next() should only traverse blocks in the + // core-local array. Therefore, we expect at most gpr_cpu_num_cores() more + // blocks. As log is full, if read_next() is traversing the dirty list, we + // will get more than gpr_cpu_num_cores() blocks. + int block_read = 0; + while ((record_read = census_log_read_next(&bytes_available))) { + ++block_read; + GPR_ASSERT(block_read <= (int)gpr_cpu_num_cores()); + } + census_log_shutdown(); +} + +// Fills non-circular log with records sized such that size is a multiple of +// CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). +void test_fill_log_no_fragmentation(void) { + printf("Starting test: fill log no fragmentation\n"); + const int circular = 0; + setup_test(circular); + fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular); + census_log_shutdown(); +} + +// Fills circular log with records sized such that size is a multiple of +// CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). +void test_fill_circular_log_no_fragmentation(void) { + printf("Starting test: fill circular log no fragmentation\n"); + const int circular = 1; + setup_test(circular); + fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular); + census_log_shutdown(); +} + +// Fills non-circular log with records that may straddle end of a block. +void test_fill_log_with_straddling_records(void) { + printf("Starting test: fill log with straddling records\n"); + const int circular = 0; + setup_test(circular); + fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular); + census_log_shutdown(); +} + +// Fills circular log with records that may straddle end of a block. +void test_fill_circular_log_with_straddling_records(void) { + printf("Starting test: fill circular log with straddling records\n"); + const int circular = 1; + setup_test(circular); + fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular); + census_log_shutdown(); +} + +// Tests scenario where multiple writers and a single reader are using a log +// that is configured to discard old records. +void test_multiple_writers_circular_log(void) { + printf("Starting test: multiple writers circular log\n"); + const int circular = 1; + setup_test(circular); + multiple_writers_single_reader(circular); + census_log_shutdown(); +} + +// Tests scenario where multiple writers and a single reader are using a log +// that is configured to discard old records. +void test_multiple_writers(void) { + printf("Starting test: multiple writers\n"); + const int circular = 0; + setup_test(circular); + multiple_writers_single_reader(circular); + census_log_shutdown(); +} + +// Repeat the straddling records and multiple writers tests with a small log. +void test_small_log(void) { + printf("Starting test: small log\n"); + const int circular = 0; + census_log_initialize(0, circular); + size_t log_size = census_log_remaining_space(); + GPR_ASSERT(log_size > 0); + fill_log(log_size, 0, circular); + census_log_shutdown(); + census_log_initialize(0, circular); + multiple_writers_single_reader(circular); + census_log_shutdown(); +} + +void test_performance(void) { + for (size_t write_size = 1; write_size < CENSUS_LOG_MAX_RECORD_SIZE; + write_size *= 2) { + setup_test(0); + gpr_timespec start_time = gpr_now(GPR_CLOCK_REALTIME); + int nrecords = 0; + while (1) { + void* record = census_log_start_write(write_size); + if (record == NULL) { + break; + } + census_log_end_write(record, write_size); + nrecords++; + } + gpr_timespec write_time = + gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start_time); + double write_time_micro = + (double)write_time.tv_sec * 1000000 + (double)write_time.tv_nsec / 1000; + census_log_shutdown(); + printf( + "Wrote %d %d byte records in %.3g microseconds: %g records/us " + "(%g ns/record), %g gigabytes/s\n", + nrecords, (int)write_size, write_time_micro, + nrecords / write_time_micro, 1000 * write_time_micro / nrecords, + (double)((int)write_size * nrecords) / write_time_micro / 1000); + } +} + +int main(int argc, char** argv) { + grpc_test_init(argc, argv); + gpr_time_init(); + srand((unsigned)gpr_now(GPR_CLOCK_REALTIME).tv_nsec); + test_invalid_record_size(); + test_end_write_with_different_size(); + test_read_pending_record(); + test_read_beyond_pending_record(); + test_detached_while_reading(); + test_fill_log_no_fragmentation(); + test_fill_circular_log_no_fragmentation(); + test_fill_log_with_straddling_records(); + test_fill_circular_log_with_straddling_records(); + test_small_log(); + test_multiple_writers(); + test_multiple_writers_circular_log(); + test_performance(); + return 0; +} diff --git a/test/core/end2end/fixtures/h2_ssl+poll.c b/test/core/end2end/fixtures/h2_ssl+poll.c index 614654ed52..0d489d62e2 100644 --- a/test/core/end2end/fixtures/h2_ssl+poll.c +++ b/test/core/end2end/fixtures/h2_ssl+poll.c @@ -36,17 +36,18 @@ #include #include +#include +#include +#include + #include "src/core/channel/channel_args.h" #include "src/core/security/credentials.h" #include "src/core/support/env.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include "src/core/support/string.h" -#include -#include -#include -#include "test/core/util/test_config.h" -#include "test/core/util/port.h" #include "test/core/end2end/data/ssl_test_data.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" typedef struct fullstack_secure_fixture_data { char *localaddr; diff --git a/test/core/end2end/fixtures/h2_ssl.c b/test/core/end2end/fixtures/h2_ssl.c index 5c63dfb6aa..187399cad1 100644 --- a/test/core/end2end/fixtures/h2_ssl.c +++ b/test/core/end2end/fixtures/h2_ssl.c @@ -36,17 +36,18 @@ #include #include +#include +#include +#include + #include "src/core/channel/channel_args.h" #include "src/core/security/credentials.h" #include "src/core/support/env.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include "src/core/support/string.h" -#include -#include -#include -#include "test/core/util/test_config.h" -#include "test/core/util/port.h" #include "test/core/end2end/data/ssl_test_data.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" typedef struct fullstack_secure_fixture_data { char *localaddr; diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c index a93bd83a1f..dc758061f8 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.c @@ -36,18 +36,19 @@ #include #include +#include +#include +#include + #include "src/core/channel/channel_args.h" #include "src/core/security/credentials.h" #include "src/core/support/env.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include "src/core/support/string.h" -#include -#include -#include #include "test/core/end2end/data/ssl_test_data.h" #include "test/core/end2end/fixtures/proxy.h" -#include "test/core/util/test_config.h" #include "test/core/util/port.h" +#include "test/core/util/test_config.h" typedef struct fullstack_secure_fixture_data { grpc_end2end_proxy *proxy; diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index f24dbe72cf..4dfafcea24 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -94,9 +94,8 @@ END2END_TESTS = { 'cancel_before_invoke': default_test_options._replace(cpu_cost=LOWCPU), 'cancel_in_a_vacuum': default_test_options._replace(cpu_cost=LOWCPU), 'cancel_with_status': default_test_options._replace(cpu_cost=LOWCPU), - 'channel_connectivity': connectivity_test_options._replace(proxyable=False, cpu_cost=LOWCPU), - 'channel_ping': connectivity_test_options._replace(proxyable=False), 'compressed_payload': default_test_options._replace(proxyable=False, cpu_cost=LOWCPU), + 'connectivity': connectivity_test_options._replace(proxyable=False, cpu_cost=LOWCPU), 'default_host': default_test_options._replace(needs_fullstack=True, needs_dns=True), 'disappearing_server': connectivity_test_options, @@ -109,11 +108,11 @@ END2END_TESTS = { 'large_metadata': default_test_options, 'max_concurrent_streams': default_test_options._replace(proxyable=False), 'max_message_length': default_test_options._replace(cpu_cost=LOWCPU), - 'metadata': default_test_options, 'negative_deadline': default_test_options, 'no_op': default_test_options, 'payload': default_test_options._replace(cpu_cost=LOWCPU), 'ping_pong_streaming': default_test_options, + 'ping': connectivity_test_options._replace(proxyable=False), 'registered_call': default_test_options, 'request_with_flags': default_test_options._replace(proxyable=False), 'request_with_payload': default_test_options, @@ -121,6 +120,7 @@ END2END_TESTS = { 'shutdown_finishes_calls': default_test_options, 'shutdown_finishes_tags': default_test_options, 'simple_delayed_request': connectivity_test_options._replace(cpu_cost=LOWCPU), + 'simple_metadata': default_test_options, 'simple_request': default_test_options, 'trailing_metadata': default_test_options, } diff --git a/test/core/end2end/tests/channel_connectivity.c b/test/core/end2end/tests/channel_connectivity.c deleted file mode 100644 index 0e21e65557..0000000000 --- a/test/core/end2end/tests/channel_connectivity.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "test/core/end2end/end2end_tests.h" - -#include -#include -#include -#include - -#include "test/core/end2end/cq_verifier.h" - -static void *tag(intptr_t t) { return (void *)t; } - -typedef struct { - gpr_event started; - grpc_channel *channel; - grpc_completion_queue *cq; -} child_events; - -static void child_thread(void *arg) { - child_events *ce = arg; - grpc_event ev; - gpr_event_set(&ce->started, (void *)1); - gpr_log(GPR_DEBUG, "verifying"); - ev = grpc_completion_queue_next(ce->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), - NULL); - GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); - GPR_ASSERT(ev.tag == tag(1)); - GPR_ASSERT(ev.success == 0); -} - -static void test_connectivity(grpc_end2end_test_config config) { - grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); - grpc_connectivity_state state; - cq_verifier *cqv = cq_verifier_create(f.cq); - child_events ce; - gpr_thd_options thdopt = gpr_thd_options_default(); - gpr_thd_id thdid; - - config.init_client(&f, NULL); - - ce.channel = f.client; - ce.cq = f.cq; - gpr_event_init(&ce.started); - gpr_thd_options_set_joinable(&thdopt); - GPR_ASSERT(gpr_thd_new(&thdid, child_thread, &ce, &thdopt)); - - gpr_event_wait(&ce.started, gpr_inf_future(GPR_CLOCK_MONOTONIC)); - - /* channels should start life in IDLE, and stay there */ - GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == - GRPC_CHANNEL_IDLE); - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(100)); - GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == - GRPC_CHANNEL_IDLE); - - /* start watching for a change */ - gpr_log(GPR_DEBUG, "watching"); - grpc_channel_watch_connectivity_state( - f.client, GRPC_CHANNEL_IDLE, gpr_now(GPR_CLOCK_MONOTONIC), f.cq, tag(1)); - - /* eventually the child thread completion should trigger */ - gpr_thd_join(thdid); - - /* check that we're still in idle, and start connecting */ - GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) == - GRPC_CHANNEL_IDLE); - /* start watching for a change */ - grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), - f.cq, tag(2)); - - /* and now the watch should trigger */ - cq_expect_completion(cqv, tag(2), 1); - cq_verify(cqv); - state = grpc_channel_check_connectivity_state(f.client, 0); - GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || - state == GRPC_CHANNEL_CONNECTING); - - /* quickly followed by a transition to TRANSIENT_FAILURE */ - grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_CONNECTING, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), - f.cq, tag(3)); - cq_expect_completion(cqv, tag(3), 1); - cq_verify(cqv); - state = grpc_channel_check_connectivity_state(f.client, 0); - GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || - state == GRPC_CHANNEL_CONNECTING); - - gpr_log(GPR_DEBUG, "*** STARTING SERVER ***"); - - /* now let's bring up a server to connect to */ - config.init_server(&f, NULL); - - gpr_log(GPR_DEBUG, "*** STARTED SERVER ***"); - - /* we'll go through some set of transitions (some might be missed), until - READY is reached */ - while (state != GRPC_CHANNEL_READY) { - grpc_channel_watch_connectivity_state( - f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(4)); - cq_expect_completion(cqv, tag(4), 1); - cq_verify(cqv); - state = grpc_channel_check_connectivity_state(f.client, 0); - GPR_ASSERT(state == GRPC_CHANNEL_READY || - state == GRPC_CHANNEL_CONNECTING || - state == GRPC_CHANNEL_TRANSIENT_FAILURE); - } - - /* bring down the server again */ - /* we should go immediately to TRANSIENT_FAILURE */ - gpr_log(GPR_DEBUG, "*** SHUTTING DOWN SERVER ***"); - - grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_READY, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), - f.cq, tag(5)); - - grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); - - cq_expect_completion(cqv, tag(5), 1); - cq_expect_completion(cqv, tag(0xdead), 1); - cq_verify(cqv); - state = grpc_channel_check_connectivity_state(f.client, 0); - GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || - state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_IDLE); - - /* cleanup server */ - grpc_server_destroy(f.server); - - gpr_log(GPR_DEBUG, "*** SHUTDOWN SERVER ***"); - - grpc_channel_destroy(f.client); - grpc_completion_queue_shutdown(f.cq); - grpc_completion_queue_destroy(f.cq); - config.tear_down_data(&f); - - cq_verifier_destroy(cqv); -} - -void channel_connectivity(grpc_end2end_test_config config) { - GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); - test_connectivity(config); -} diff --git a/test/core/end2end/tests/channel_ping.c b/test/core/end2end/tests/channel_ping.c deleted file mode 100644 index 73fab206fb..0000000000 --- a/test/core/end2end/tests/channel_ping.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "test/core/end2end/end2end_tests.h" - -#include -#include -#include -#include - -#include "test/core/end2end/cq_verifier.h" - -static void *tag(intptr_t t) { return (void *)t; } - -static void test_ping(grpc_end2end_test_config config) { - grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); - grpc_connectivity_state state = GRPC_CHANNEL_IDLE; - int i; - - config.init_client(&f, NULL); - config.init_server(&f, NULL); - - grpc_channel_ping(f.client, f.cq, tag(0), NULL); - cq_expect_completion(cqv, tag(0), 0); - - /* check that we're still in idle, and start connecting */ - GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) == - GRPC_CHANNEL_IDLE); - /* we'll go through some set of transitions (some might be missed), until - READY is reached */ - while (state != GRPC_CHANNEL_READY) { - grpc_channel_watch_connectivity_state( - f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(99)); - cq_expect_completion(cqv, tag(99), 1); - cq_verify(cqv); - state = grpc_channel_check_connectivity_state(f.client, 0); - GPR_ASSERT(state == GRPC_CHANNEL_READY || - state == GRPC_CHANNEL_CONNECTING || - state == GRPC_CHANNEL_TRANSIENT_FAILURE); - } - - for (i = 1; i <= 5; i++) { - grpc_channel_ping(f.client, f.cq, tag(i), NULL); - cq_expect_completion(cqv, tag(i), 1); - cq_verify(cqv); - } - - grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); - cq_expect_completion(cqv, tag(0xdead), 1); - cq_verify(cqv); - - /* cleanup server */ - grpc_server_destroy(f.server); - - grpc_channel_destroy(f.client); - grpc_completion_queue_shutdown(f.cq); - grpc_completion_queue_destroy(f.cq); - config.tear_down_data(&f); - - cq_verifier_destroy(cqv); -} - -void channel_ping(grpc_end2end_test_config config) { - GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); - test_ping(config); -} diff --git a/test/core/end2end/tests/connectivity.c b/test/core/end2end/tests/connectivity.c new file mode 100644 index 0000000000..0e21e65557 --- /dev/null +++ b/test/core/end2end/tests/connectivity.c @@ -0,0 +1,174 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include +#include +#include +#include + +#include "test/core/end2end/cq_verifier.h" + +static void *tag(intptr_t t) { return (void *)t; } + +typedef struct { + gpr_event started; + grpc_channel *channel; + grpc_completion_queue *cq; +} child_events; + +static void child_thread(void *arg) { + child_events *ce = arg; + grpc_event ev; + gpr_event_set(&ce->started, (void *)1); + gpr_log(GPR_DEBUG, "verifying"); + ev = grpc_completion_queue_next(ce->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), + NULL); + GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); + GPR_ASSERT(ev.tag == tag(1)); + GPR_ASSERT(ev.success == 0); +} + +static void test_connectivity(grpc_end2end_test_config config) { + grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); + grpc_connectivity_state state; + cq_verifier *cqv = cq_verifier_create(f.cq); + child_events ce; + gpr_thd_options thdopt = gpr_thd_options_default(); + gpr_thd_id thdid; + + config.init_client(&f, NULL); + + ce.channel = f.client; + ce.cq = f.cq; + gpr_event_init(&ce.started); + gpr_thd_options_set_joinable(&thdopt); + GPR_ASSERT(gpr_thd_new(&thdid, child_thread, &ce, &thdopt)); + + gpr_event_wait(&ce.started, gpr_inf_future(GPR_CLOCK_MONOTONIC)); + + /* channels should start life in IDLE, and stay there */ + GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == + GRPC_CHANNEL_IDLE); + gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(100)); + GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == + GRPC_CHANNEL_IDLE); + + /* start watching for a change */ + gpr_log(GPR_DEBUG, "watching"); + grpc_channel_watch_connectivity_state( + f.client, GRPC_CHANNEL_IDLE, gpr_now(GPR_CLOCK_MONOTONIC), f.cq, tag(1)); + + /* eventually the child thread completion should trigger */ + gpr_thd_join(thdid); + + /* check that we're still in idle, and start connecting */ + GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) == + GRPC_CHANNEL_IDLE); + /* start watching for a change */ + grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE, + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + f.cq, tag(2)); + + /* and now the watch should trigger */ + cq_expect_completion(cqv, tag(2), 1); + cq_verify(cqv); + state = grpc_channel_check_connectivity_state(f.client, 0); + GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || + state == GRPC_CHANNEL_CONNECTING); + + /* quickly followed by a transition to TRANSIENT_FAILURE */ + grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_CONNECTING, + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + f.cq, tag(3)); + cq_expect_completion(cqv, tag(3), 1); + cq_verify(cqv); + state = grpc_channel_check_connectivity_state(f.client, 0); + GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || + state == GRPC_CHANNEL_CONNECTING); + + gpr_log(GPR_DEBUG, "*** STARTING SERVER ***"); + + /* now let's bring up a server to connect to */ + config.init_server(&f, NULL); + + gpr_log(GPR_DEBUG, "*** STARTED SERVER ***"); + + /* we'll go through some set of transitions (some might be missed), until + READY is reached */ + while (state != GRPC_CHANNEL_READY) { + grpc_channel_watch_connectivity_state( + f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(4)); + cq_expect_completion(cqv, tag(4), 1); + cq_verify(cqv); + state = grpc_channel_check_connectivity_state(f.client, 0); + GPR_ASSERT(state == GRPC_CHANNEL_READY || + state == GRPC_CHANNEL_CONNECTING || + state == GRPC_CHANNEL_TRANSIENT_FAILURE); + } + + /* bring down the server again */ + /* we should go immediately to TRANSIENT_FAILURE */ + gpr_log(GPR_DEBUG, "*** SHUTTING DOWN SERVER ***"); + + grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_READY, + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + f.cq, tag(5)); + + grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); + + cq_expect_completion(cqv, tag(5), 1); + cq_expect_completion(cqv, tag(0xdead), 1); + cq_verify(cqv); + state = grpc_channel_check_connectivity_state(f.client, 0); + GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || + state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_IDLE); + + /* cleanup server */ + grpc_server_destroy(f.server); + + gpr_log(GPR_DEBUG, "*** SHUTDOWN SERVER ***"); + + grpc_channel_destroy(f.client); + grpc_completion_queue_shutdown(f.cq); + grpc_completion_queue_destroy(f.cq); + config.tear_down_data(&f); + + cq_verifier_destroy(cqv); +} + +void channel_connectivity(grpc_end2end_test_config config) { + GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); + test_connectivity(config); +} diff --git a/test/core/end2end/tests/metadata.c b/test/core/end2end/tests/metadata.c deleted file mode 100644 index 5e92091eb7..0000000000 --- a/test/core/end2end/tests/metadata.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "test/core/end2end/end2end_tests.h" - -#include -#include - -#include -#include -#include -#include -#include -#include "test/core/end2end/cq_verifier.h" - -enum { TIMEOUT = 200000 }; - -static void *tag(intptr_t t) { return (void *)t; } - -static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { - grpc_end2end_test_fixture f; - gpr_log(GPR_INFO, "%s/%s", test_name, config.name); - f = config.create_fixture(client_args, server_args); - config.init_server(&f, server_args); - config.init_client(&f, client_args); - return f; -} - -static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); -} - -static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } - -static void drain_cq(grpc_completion_queue *cq) { - grpc_event ev; - do { - ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); - } while (ev.type != GRPC_QUEUE_SHUTDOWN); -} - -static void shutdown_server(grpc_end2end_test_fixture *f) { - if (!f->server) return; - grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), - NULL).type == GRPC_OP_COMPLETE); - grpc_server_destroy(f->server); - f->server = NULL; -} - -static void shutdown_client(grpc_end2end_test_fixture *f) { - if (!f->client) return; - grpc_channel_destroy(f->client); - f->client = NULL; -} - -static void end_test(grpc_end2end_test_fixture *f) { - shutdown_server(f); - shutdown_client(f); - - grpc_completion_queue_shutdown(f->cq); - drain_cq(f->cq); - grpc_completion_queue_destroy(f->cq); -} - -/* Request/response with metadata and payload.*/ -static void test_request_response_with_metadata_and_payload( - grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; - gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world"); - gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = - grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = - grpc_raw_byte_buffer_create(&response_payload_slice, 1); - gpr_timespec deadline = five_seconds_time(); - grpc_metadata meta_c[2] = { - {"key1", "val1", 4, 0, {{NULL, NULL, NULL, NULL}}}, - {"key2", "val2", 4, 0, {{NULL, NULL, NULL, NULL}}}}; - grpc_metadata meta_s[2] = { - {"key3", "val3", 4, 0, {{NULL, NULL, NULL, NULL}}}, - {"key4", "val4", 4, 0, {{NULL, NULL, NULL, NULL}}}}; - grpc_end2end_test_fixture f = begin_test( - config, "test_request_response_with_metadata_and_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); - grpc_op ops[6]; - grpc_op *op; - grpc_metadata_array initial_metadata_recv; - grpc_metadata_array trailing_metadata_recv; - grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; - grpc_call_details call_details; - grpc_status_code status; - grpc_call_error error; - char *details = NULL; - size_t details_capacity = 0; - int was_cancelled = 2; - - c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - "/foo", "foo.test.google.fr", deadline, NULL); - GPR_ASSERT(c); - - grpc_metadata_array_init(&initial_metadata_recv); - grpc_metadata_array_init(&trailing_metadata_recv); - grpc_metadata_array_init(&request_metadata_recv); - grpc_call_details_init(&call_details); - - op = ops; - op->op = GRPC_OP_SEND_INITIAL_METADATA; - op->data.send_initial_metadata.count = 2; - op->data.send_initial_metadata.metadata = meta_c; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = request_payload; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_RECV_INITIAL_METADATA; - op->data.recv_initial_metadata = &initial_metadata_recv; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &response_payload_recv; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; - op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; - op->data.recv_status_on_client.status = &status; - op->data.recv_status_on_client.status_details = &details; - op->data.recv_status_on_client.status_details_capacity = &details_capacity; - op->flags = 0; - op->reserved = NULL; - op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL); - GPR_ASSERT(GRPC_CALL_OK == error); - - error = - grpc_server_request_call(f.server, &s, &call_details, - &request_metadata_recv, f.cq, f.cq, tag(101)); - GPR_ASSERT(GRPC_CALL_OK == error); - cq_expect_completion(cqv, tag(101), 1); - cq_verify(cqv); - - op = ops; - op->op = GRPC_OP_SEND_INITIAL_METADATA; - op->data.send_initial_metadata.count = 2; - op->data.send_initial_metadata.metadata = meta_s; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message = &request_payload_recv; - op->flags = 0; - op->reserved = NULL; - op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); - GPR_ASSERT(GRPC_CALL_OK == error); - - cq_expect_completion(cqv, tag(102), 1); - cq_verify(cqv); - - op = ops; - op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; - op->data.recv_close_on_server.cancelled = &was_cancelled; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_SEND_MESSAGE; - op->data.send_message = response_payload; - op->flags = 0; - op->reserved = NULL; - op++; - op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; - op->data.send_status_from_server.trailing_metadata_count = 0; - op->data.send_status_from_server.status = GRPC_STATUS_OK; - op->data.send_status_from_server.status_details = "xyz"; - op->flags = 0; - op->reserved = NULL; - op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); - GPR_ASSERT(GRPC_CALL_OK == error); - - cq_expect_completion(cqv, tag(103), 1); - cq_expect_completion(cqv, tag(1), 1); - cq_verify(cqv); - - GPR_ASSERT(status == GRPC_STATUS_OK); - GPR_ASSERT(0 == strcmp(details, "xyz")); - GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); - GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr")); - GPR_ASSERT(was_cancelled == 0); - GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world")); - GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you")); - GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1")); - GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2")); - GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3")); - GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4")); - - gpr_free(details); - grpc_metadata_array_destroy(&initial_metadata_recv); - grpc_metadata_array_destroy(&trailing_metadata_recv); - grpc_metadata_array_destroy(&request_metadata_recv); - grpc_call_details_destroy(&call_details); - - grpc_call_destroy(c); - grpc_call_destroy(s); - - cq_verifier_destroy(cqv); - - grpc_byte_buffer_destroy(request_payload); - grpc_byte_buffer_destroy(response_payload); - grpc_byte_buffer_destroy(request_payload_recv); - grpc_byte_buffer_destroy(response_payload_recv); - - end_test(&f); - config.tear_down_data(&f); -} - -void metadata(grpc_end2end_test_config config) { - test_request_response_with_metadata_and_payload(config); -} diff --git a/test/core/end2end/tests/ping.c b/test/core/end2end/tests/ping.c new file mode 100644 index 0000000000..73fab206fb --- /dev/null +++ b/test/core/end2end/tests/ping.c @@ -0,0 +1,97 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include +#include +#include +#include + +#include "test/core/end2end/cq_verifier.h" + +static void *tag(intptr_t t) { return (void *)t; } + +static void test_ping(grpc_end2end_test_config config) { + grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); + cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_connectivity_state state = GRPC_CHANNEL_IDLE; + int i; + + config.init_client(&f, NULL); + config.init_server(&f, NULL); + + grpc_channel_ping(f.client, f.cq, tag(0), NULL); + cq_expect_completion(cqv, tag(0), 0); + + /* check that we're still in idle, and start connecting */ + GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) == + GRPC_CHANNEL_IDLE); + /* we'll go through some set of transitions (some might be missed), until + READY is reached */ + while (state != GRPC_CHANNEL_READY) { + grpc_channel_watch_connectivity_state( + f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(99)); + cq_expect_completion(cqv, tag(99), 1); + cq_verify(cqv); + state = grpc_channel_check_connectivity_state(f.client, 0); + GPR_ASSERT(state == GRPC_CHANNEL_READY || + state == GRPC_CHANNEL_CONNECTING || + state == GRPC_CHANNEL_TRANSIENT_FAILURE); + } + + for (i = 1; i <= 5; i++) { + grpc_channel_ping(f.client, f.cq, tag(i), NULL); + cq_expect_completion(cqv, tag(i), 1); + cq_verify(cqv); + } + + grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); + cq_expect_completion(cqv, tag(0xdead), 1); + cq_verify(cqv); + + /* cleanup server */ + grpc_server_destroy(f.server); + + grpc_channel_destroy(f.client); + grpc_completion_queue_shutdown(f.cq); + grpc_completion_queue_destroy(f.cq); + config.tear_down_data(&f); + + cq_verifier_destroy(cqv); +} + +void channel_ping(grpc_end2end_test_config config) { + GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); + test_ping(config); +} diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c new file mode 100644 index 0000000000..5e92091eb7 --- /dev/null +++ b/test/core/end2end/tests/simple_metadata.c @@ -0,0 +1,265 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include +#include + +#include +#include +#include +#include +#include +#include "test/core/end2end/cq_verifier.h" + +enum { TIMEOUT = 200000 }; + +static void *tag(intptr_t t) { return (void *)t; } + +static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, + const char *test_name, + grpc_channel_args *client_args, + grpc_channel_args *server_args) { + grpc_end2end_test_fixture f; + gpr_log(GPR_INFO, "%s/%s", test_name, config.name); + f = config.create_fixture(client_args, server_args); + config.init_server(&f, server_args); + config.init_client(&f, client_args); + return f; +} + +static gpr_timespec n_seconds_time(int n) { + return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); +} + +static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } + +static void drain_cq(grpc_completion_queue *cq) { + grpc_event ev; + do { + ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL); + } while (ev.type != GRPC_QUEUE_SHUTDOWN); +} + +static void shutdown_server(grpc_end2end_test_fixture *f) { + if (!f->server) return; + grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); + GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000), + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + NULL).type == GRPC_OP_COMPLETE); + grpc_server_destroy(f->server); + f->server = NULL; +} + +static void shutdown_client(grpc_end2end_test_fixture *f) { + if (!f->client) return; + grpc_channel_destroy(f->client); + f->client = NULL; +} + +static void end_test(grpc_end2end_test_fixture *f) { + shutdown_server(f); + shutdown_client(f); + + grpc_completion_queue_shutdown(f->cq); + drain_cq(f->cq); + grpc_completion_queue_destroy(f->cq); +} + +/* Request/response with metadata and payload.*/ +static void test_request_response_with_metadata_and_payload( + grpc_end2end_test_config config) { + grpc_call *c; + grpc_call *s; + gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world"); + gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you"); + grpc_byte_buffer *request_payload = + grpc_raw_byte_buffer_create(&request_payload_slice, 1); + grpc_byte_buffer *response_payload = + grpc_raw_byte_buffer_create(&response_payload_slice, 1); + gpr_timespec deadline = five_seconds_time(); + grpc_metadata meta_c[2] = { + {"key1", "val1", 4, 0, {{NULL, NULL, NULL, NULL}}}, + {"key2", "val2", 4, 0, {{NULL, NULL, NULL, NULL}}}}; + grpc_metadata meta_s[2] = { + {"key3", "val3", 4, 0, {{NULL, NULL, NULL, NULL}}}, + {"key4", "val4", 4, 0, {{NULL, NULL, NULL, NULL}}}}; + grpc_end2end_test_fixture f = begin_test( + config, "test_request_response_with_metadata_and_payload", NULL, NULL); + cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_op ops[6]; + grpc_op *op; + grpc_metadata_array initial_metadata_recv; + grpc_metadata_array trailing_metadata_recv; + grpc_metadata_array request_metadata_recv; + grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer *response_payload_recv = NULL; + grpc_call_details call_details; + grpc_status_code status; + grpc_call_error error; + char *details = NULL; + size_t details_capacity = 0; + int was_cancelled = 2; + + c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, + "/foo", "foo.test.google.fr", deadline, NULL); + GPR_ASSERT(c); + + grpc_metadata_array_init(&initial_metadata_recv); + grpc_metadata_array_init(&trailing_metadata_recv); + grpc_metadata_array_init(&request_metadata_recv); + grpc_call_details_init(&call_details); + + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 2; + op->data.send_initial_metadata.metadata = meta_c; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message = request_payload; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_INITIAL_METADATA; + op->data.recv_initial_metadata = &initial_metadata_recv; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &response_payload_recv; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; + op->data.recv_status_on_client.status = &status; + op->data.recv_status_on_client.status_details = &details; + op->data.recv_status_on_client.status_details_capacity = &details_capacity; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + error = + grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); + cq_expect_completion(cqv, tag(101), 1); + cq_verify(cqv); + + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 2; + op->data.send_initial_metadata.metadata = meta_s; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &request_payload_recv; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + cq_expect_completion(cqv, tag(102), 1); + cq_verify(cqv); + + op = ops; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message = response_payload; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; + op->data.send_status_from_server.trailing_metadata_count = 0; + op->data.send_status_from_server.status = GRPC_STATUS_OK; + op->data.send_status_from_server.status_details = "xyz"; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + cq_expect_completion(cqv, tag(103), 1); + cq_expect_completion(cqv, tag(1), 1); + cq_verify(cqv); + + GPR_ASSERT(status == GRPC_STATUS_OK); + GPR_ASSERT(0 == strcmp(details, "xyz")); + GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); + GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr")); + GPR_ASSERT(was_cancelled == 0); + GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world")); + GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you")); + GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1")); + GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2")); + GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3")); + GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4")); + + gpr_free(details); + grpc_metadata_array_destroy(&initial_metadata_recv); + grpc_metadata_array_destroy(&trailing_metadata_recv); + grpc_metadata_array_destroy(&request_metadata_recv); + grpc_call_details_destroy(&call_details); + + grpc_call_destroy(c); + grpc_call_destroy(s); + + cq_verifier_destroy(cqv); + + grpc_byte_buffer_destroy(request_payload); + grpc_byte_buffer_destroy(response_payload); + grpc_byte_buffer_destroy(request_payload_recv); + grpc_byte_buffer_destroy(response_payload_recv); + + end_test(&f); + config.tear_down_data(&f); +} + +void metadata(grpc_end2end_test_config config) { + test_request_response_with_metadata_and_payload(config); +} diff --git a/test/core/security/b64_test.c b/test/core/security/b64_test.c new file mode 100644 index 0000000000..a45a189457 --- /dev/null +++ b/test/core/security/b64_test.c @@ -0,0 +1,224 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/security/b64.h" + +#include + +#include +#include +#include +#include "test/core/util/test_config.h" + +static int buffers_are_equal(const unsigned char *buf1, + const unsigned char *buf2, size_t size) { + size_t i; + for (i = 0; i < size; i++) { + if (buf1[i] != buf2[i]) { + gpr_log(GPR_ERROR, "buf1 and buf2 differ: buf1[%d] = %x vs buf2[%d] = %x", + (int)i, buf1[i], (int)i, buf2[i]); + return 0; + } + } + return 1; +} + +static void test_simple_encode_decode_b64(int url_safe, int multiline) { + const char *hello = "hello"; + char *hello_b64 = + grpc_base64_encode(hello, strlen(hello), url_safe, multiline); + gpr_slice hello_slice = grpc_base64_decode(hello_b64, url_safe); + GPR_ASSERT(GPR_SLICE_LENGTH(hello_slice) == strlen(hello)); + GPR_ASSERT(strncmp((const char *)GPR_SLICE_START_PTR(hello_slice), hello, + GPR_SLICE_LENGTH(hello_slice)) == 0); + + gpr_slice_unref(hello_slice); + gpr_free(hello_b64); +} + +static void test_full_range_encode_decode_b64(int url_safe, int multiline) { + unsigned char orig[256]; + size_t i; + char *b64; + gpr_slice orig_decoded; + for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i; + + /* Try all the different paddings. */ + for (i = 0; i < 3; i++) { + b64 = grpc_base64_encode(orig, sizeof(orig) - i, url_safe, multiline); + orig_decoded = grpc_base64_decode(b64, url_safe); + GPR_ASSERT(GPR_SLICE_LENGTH(orig_decoded) == (sizeof(orig) - i)); + GPR_ASSERT(buffers_are_equal(orig, GPR_SLICE_START_PTR(orig_decoded), + sizeof(orig) - i)); + gpr_slice_unref(orig_decoded); + gpr_free(b64); + } +} + +static void test_simple_encode_decode_b64_no_multiline(void) { + test_simple_encode_decode_b64(0, 0); +} + +static void test_simple_encode_decode_b64_multiline(void) { + test_simple_encode_decode_b64(0, 1); +} + +static void test_simple_encode_decode_b64_urlsafe_no_multiline(void) { + test_simple_encode_decode_b64(1, 0); +} + +static void test_simple_encode_decode_b64_urlsafe_multiline(void) { + test_simple_encode_decode_b64(1, 1); +} + +static void test_full_range_encode_decode_b64_no_multiline(void) { + test_full_range_encode_decode_b64(0, 0); +} + +static void test_full_range_encode_decode_b64_multiline(void) { + test_full_range_encode_decode_b64(0, 1); +} + +static void test_full_range_encode_decode_b64_urlsafe_no_multiline(void) { + test_full_range_encode_decode_b64(1, 0); +} + +static void test_full_range_encode_decode_b64_urlsafe_multiline(void) { + test_full_range_encode_decode_b64(1, 1); +} + +static void test_url_safe_unsafe_mismtach_failure(void) { + unsigned char orig[256]; + size_t i; + char *b64; + gpr_slice orig_decoded; + int url_safe = 1; + for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i; + + b64 = grpc_base64_encode(orig, sizeof(orig), url_safe, 0); + orig_decoded = grpc_base64_decode(b64, !url_safe); + GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded)); + gpr_free(b64); + gpr_slice_unref(orig_decoded); + + b64 = grpc_base64_encode(orig, sizeof(orig), !url_safe, 0); + orig_decoded = grpc_base64_decode(b64, url_safe); + GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded)); + gpr_free(b64); + gpr_slice_unref(orig_decoded); +} + +static void test_rfc4648_test_vectors(void) { + char *b64; + + b64 = grpc_base64_encode("", 0, 0, 0); + GPR_ASSERT(strcmp("", b64) == 0); + gpr_free(b64); + + b64 = grpc_base64_encode("f", 1, 0, 0); + GPR_ASSERT(strcmp("Zg==", b64) == 0); + gpr_free(b64); + + b64 = grpc_base64_encode("fo", 2, 0, 0); + GPR_ASSERT(strcmp("Zm8=", b64) == 0); + gpr_free(b64); + + b64 = grpc_base64_encode("foo", 3, 0, 0); + GPR_ASSERT(strcmp("Zm9v", b64) == 0); + gpr_free(b64); + + b64 = grpc_base64_encode("foob", 4, 0, 0); + GPR_ASSERT(strcmp("Zm9vYg==", b64) == 0); + gpr_free(b64); + + b64 = grpc_base64_encode("fooba", 5, 0, 0); + GPR_ASSERT(strcmp("Zm9vYmE=", b64) == 0); + gpr_free(b64); + + b64 = grpc_base64_encode("foobar", 6, 0, 0); + GPR_ASSERT(strcmp("Zm9vYmFy", b64) == 0); + gpr_free(b64); +} + +static void test_unpadded_decode(void) { + gpr_slice decoded; + + decoded = grpc_base64_decode("Zm9vYmFy", 0); + GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); + GPR_ASSERT(gpr_slice_str_cmp(decoded, "foobar") == 0); + gpr_slice_unref(decoded); + + decoded = grpc_base64_decode("Zm9vYmE", 0); + GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); + GPR_ASSERT(gpr_slice_str_cmp(decoded, "fooba") == 0); + gpr_slice_unref(decoded); + + decoded = grpc_base64_decode("Zm9vYg", 0); + GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); + GPR_ASSERT(gpr_slice_str_cmp(decoded, "foob") == 0); + gpr_slice_unref(decoded); + + decoded = grpc_base64_decode("Zm9v", 0); + GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); + GPR_ASSERT(gpr_slice_str_cmp(decoded, "foo") == 0); + gpr_slice_unref(decoded); + + decoded = grpc_base64_decode("Zm8", 0); + GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); + GPR_ASSERT(gpr_slice_str_cmp(decoded, "fo") == 0); + gpr_slice_unref(decoded); + + decoded = grpc_base64_decode("Zg", 0); + GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); + GPR_ASSERT(gpr_slice_str_cmp(decoded, "f") == 0); + gpr_slice_unref(decoded); + + decoded = grpc_base64_decode("", 0); + GPR_ASSERT(GPR_SLICE_IS_EMPTY(decoded)); +} + +int main(int argc, char **argv) { + grpc_test_init(argc, argv); + test_simple_encode_decode_b64_no_multiline(); + test_simple_encode_decode_b64_multiline(); + test_simple_encode_decode_b64_urlsafe_no_multiline(); + test_simple_encode_decode_b64_urlsafe_multiline(); + test_full_range_encode_decode_b64_no_multiline(); + test_full_range_encode_decode_b64_multiline(); + test_full_range_encode_decode_b64_urlsafe_no_multiline(); + test_full_range_encode_decode_b64_urlsafe_multiline(); + test_url_safe_unsafe_mismtach_failure(); + test_rfc4648_test_vectors(); + test_unpadded_decode(); + return 0; +} diff --git a/test/core/security/base64_test.c b/test/core/security/base64_test.c deleted file mode 100644 index e656d4c947..0000000000 --- a/test/core/security/base64_test.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "src/core/security/base64.h" - -#include - -#include -#include -#include -#include "test/core/util/test_config.h" - -static int buffers_are_equal(const unsigned char *buf1, - const unsigned char *buf2, size_t size) { - size_t i; - for (i = 0; i < size; i++) { - if (buf1[i] != buf2[i]) { - gpr_log(GPR_ERROR, "buf1 and buf2 differ: buf1[%d] = %x vs buf2[%d] = %x", - (int)i, buf1[i], (int)i, buf2[i]); - return 0; - } - } - return 1; -} - -static void test_simple_encode_decode_b64(int url_safe, int multiline) { - const char *hello = "hello"; - char *hello_b64 = - grpc_base64_encode(hello, strlen(hello), url_safe, multiline); - gpr_slice hello_slice = grpc_base64_decode(hello_b64, url_safe); - GPR_ASSERT(GPR_SLICE_LENGTH(hello_slice) == strlen(hello)); - GPR_ASSERT(strncmp((const char *)GPR_SLICE_START_PTR(hello_slice), hello, - GPR_SLICE_LENGTH(hello_slice)) == 0); - - gpr_slice_unref(hello_slice); - gpr_free(hello_b64); -} - -static void test_full_range_encode_decode_b64(int url_safe, int multiline) { - unsigned char orig[256]; - size_t i; - char *b64; - gpr_slice orig_decoded; - for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i; - - /* Try all the different paddings. */ - for (i = 0; i < 3; i++) { - b64 = grpc_base64_encode(orig, sizeof(orig) - i, url_safe, multiline); - orig_decoded = grpc_base64_decode(b64, url_safe); - GPR_ASSERT(GPR_SLICE_LENGTH(orig_decoded) == (sizeof(orig) - i)); - GPR_ASSERT(buffers_are_equal(orig, GPR_SLICE_START_PTR(orig_decoded), - sizeof(orig) - i)); - gpr_slice_unref(orig_decoded); - gpr_free(b64); - } -} - -static void test_simple_encode_decode_b64_no_multiline(void) { - test_simple_encode_decode_b64(0, 0); -} - -static void test_simple_encode_decode_b64_multiline(void) { - test_simple_encode_decode_b64(0, 1); -} - -static void test_simple_encode_decode_b64_urlsafe_no_multiline(void) { - test_simple_encode_decode_b64(1, 0); -} - -static void test_simple_encode_decode_b64_urlsafe_multiline(void) { - test_simple_encode_decode_b64(1, 1); -} - -static void test_full_range_encode_decode_b64_no_multiline(void) { - test_full_range_encode_decode_b64(0, 0); -} - -static void test_full_range_encode_decode_b64_multiline(void) { - test_full_range_encode_decode_b64(0, 1); -} - -static void test_full_range_encode_decode_b64_urlsafe_no_multiline(void) { - test_full_range_encode_decode_b64(1, 0); -} - -static void test_full_range_encode_decode_b64_urlsafe_multiline(void) { - test_full_range_encode_decode_b64(1, 1); -} - -static void test_url_safe_unsafe_mismtach_failure(void) { - unsigned char orig[256]; - size_t i; - char *b64; - gpr_slice orig_decoded; - int url_safe = 1; - for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i; - - b64 = grpc_base64_encode(orig, sizeof(orig), url_safe, 0); - orig_decoded = grpc_base64_decode(b64, !url_safe); - GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded)); - gpr_free(b64); - gpr_slice_unref(orig_decoded); - - b64 = grpc_base64_encode(orig, sizeof(orig), !url_safe, 0); - orig_decoded = grpc_base64_decode(b64, url_safe); - GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded)); - gpr_free(b64); - gpr_slice_unref(orig_decoded); -} - -static void test_rfc4648_test_vectors(void) { - char *b64; - - b64 = grpc_base64_encode("", 0, 0, 0); - GPR_ASSERT(strcmp("", b64) == 0); - gpr_free(b64); - - b64 = grpc_base64_encode("f", 1, 0, 0); - GPR_ASSERT(strcmp("Zg==", b64) == 0); - gpr_free(b64); - - b64 = grpc_base64_encode("fo", 2, 0, 0); - GPR_ASSERT(strcmp("Zm8=", b64) == 0); - gpr_free(b64); - - b64 = grpc_base64_encode("foo", 3, 0, 0); - GPR_ASSERT(strcmp("Zm9v", b64) == 0); - gpr_free(b64); - - b64 = grpc_base64_encode("foob", 4, 0, 0); - GPR_ASSERT(strcmp("Zm9vYg==", b64) == 0); - gpr_free(b64); - - b64 = grpc_base64_encode("fooba", 5, 0, 0); - GPR_ASSERT(strcmp("Zm9vYmE=", b64) == 0); - gpr_free(b64); - - b64 = grpc_base64_encode("foobar", 6, 0, 0); - GPR_ASSERT(strcmp("Zm9vYmFy", b64) == 0); - gpr_free(b64); -} - -static void test_unpadded_decode(void) { - gpr_slice decoded; - - decoded = grpc_base64_decode("Zm9vYmFy", 0); - GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); - GPR_ASSERT(gpr_slice_str_cmp(decoded, "foobar") == 0); - gpr_slice_unref(decoded); - - decoded = grpc_base64_decode("Zm9vYmE", 0); - GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); - GPR_ASSERT(gpr_slice_str_cmp(decoded, "fooba") == 0); - gpr_slice_unref(decoded); - - decoded = grpc_base64_decode("Zm9vYg", 0); - GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); - GPR_ASSERT(gpr_slice_str_cmp(decoded, "foob") == 0); - gpr_slice_unref(decoded); - - decoded = grpc_base64_decode("Zm9v", 0); - GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); - GPR_ASSERT(gpr_slice_str_cmp(decoded, "foo") == 0); - gpr_slice_unref(decoded); - - decoded = grpc_base64_decode("Zm8", 0); - GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); - GPR_ASSERT(gpr_slice_str_cmp(decoded, "fo") == 0); - gpr_slice_unref(decoded); - - decoded = grpc_base64_decode("Zg", 0); - GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded)); - GPR_ASSERT(gpr_slice_str_cmp(decoded, "f") == 0); - gpr_slice_unref(decoded); - - decoded = grpc_base64_decode("", 0); - GPR_ASSERT(GPR_SLICE_IS_EMPTY(decoded)); -} - -int main(int argc, char **argv) { - grpc_test_init(argc, argv); - test_simple_encode_decode_b64_no_multiline(); - test_simple_encode_decode_b64_multiline(); - test_simple_encode_decode_b64_urlsafe_no_multiline(); - test_simple_encode_decode_b64_urlsafe_multiline(); - test_full_range_encode_decode_b64_no_multiline(); - test_full_range_encode_decode_b64_multiline(); - test_full_range_encode_decode_b64_urlsafe_no_multiline(); - test_full_range_encode_decode_b64_urlsafe_multiline(); - test_url_safe_unsafe_mismtach_failure(); - test_rfc4648_test_vectors(); - test_unpadded_decode(); - return 0; -} diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c index 237dc9aa3e..4c0cf436ee 100644 --- a/test/core/security/create_jwt.c +++ b/test/core/security/create_jwt.c @@ -36,7 +36,7 @@ #include "src/core/security/credentials.h" #include "src/core/security/json_token.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include #include diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index 8a210bb3c3..2c3d4cd0d6 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -32,25 +32,24 @@ */ #include + #include "src/core/security/credentials.h" +#include #include #include -#include "src/core/httpcli/httpcli.h" -#include "src/core/security/json_token.h" -#include "src/core/support/env.h" -#include "src/core/support/file.h" -#include "src/core/support/string.h" - -#include "test/core/util/test_config.h" - #include #include #include #include -#include +#include "src/core/httpcli/httpcli.h" +#include "src/core/security/json_token.h" +#include "src/core/support/env.h" +#include "src/core/support/load_file.h" +#include "src/core/support/string.h" +#include "test/core/util/test_config.h" /* -- Mock channel credentials. -- */ diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c index ee1178cbdd..a9e1720a28 100644 --- a/test/core/security/fetch_oauth2.c +++ b/test/core/security/fetch_oauth2.c @@ -43,7 +43,7 @@ #include #include "src/core/security/credentials.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include "test/core/security/oauth2_utils.h" static grpc_call_credentials *create_refresh_token_creds( diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c index 7c01a9ce5c..4d80c16fb9 100644 --- a/test/core/security/json_token_test.c +++ b/test/core/security/json_token_test.c @@ -33,16 +33,17 @@ #include "src/core/security/json_token.h" +#include #include -#include "src/core/security/base64.h" #include #include #include #include -#include "test/core/util/test_config.h" + #include "src/core/json/json.h" -#include +#include "src/core/security/b64.h" +#include "test/core/util/test_config.h" /* This JSON key was generated with the GCE console and revoked immediately. The identifiers have been changed as well. diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c index f396398cef..f6ec9e12ef 100644 --- a/test/core/security/jwt_verifier_test.c +++ b/test/core/security/jwt_verifier_test.c @@ -36,7 +36,7 @@ #include #include "src/core/httpcli/httpcli.h" -#include "src/core/security/base64.h" +#include "src/core/security/b64.h" #include "src/core/security/json_token.h" #include "test/core/util/test_config.h" diff --git a/test/core/security/security_connector_test.c b/test/core/security/security_connector_test.c index ee5435f01d..edb45b6680 100644 --- a/test/core/security/security_connector_test.c +++ b/test/core/security/security_connector_test.c @@ -34,22 +34,21 @@ #include #include +#include +#include +#include +#include +#include + #include "src/core/security/security_connector.h" #include "src/core/security/security_context.h" #include "src/core/support/env.h" -#include "src/core/support/file.h" +#include "src/core/support/load_file.h" #include "src/core/support/string.h" #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security.h" #include "test/core/util/test_config.h" -#include - -#include -#include -#include -#include - static int check_transport_security_type(const grpc_auth_context *ctx) { grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name( ctx, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME); diff --git a/test/core/support/file_test.c b/test/core/support/file_test.c deleted file mode 100644 index 330b2173ef..0000000000 --- a/test/core/support/file_test.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include - -#include -#include -#include - -#include "src/core/support/file.h" -#include "src/core/support/string.h" -#include "test/core/util/test_config.h" - -#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x) - -static const char prefix[] = "file_test"; - -static void test_load_empty_file(void) { - FILE *tmp = NULL; - gpr_slice slice; - gpr_slice slice_with_null_term; - int success; - char *tmp_name; - - LOG_TEST_NAME("test_load_empty_file"); - - tmp = gpr_tmpfile(prefix, &tmp_name); - GPR_ASSERT(tmp_name != NULL); - GPR_ASSERT(tmp != NULL); - fclose(tmp); - - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 1); - GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0); - - slice_with_null_term = gpr_load_file(tmp_name, 1, &success); - GPR_ASSERT(success == 1); - GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == 1); - GPR_ASSERT(GPR_SLICE_START_PTR(slice_with_null_term)[0] == 0); - - remove(tmp_name); - gpr_free(tmp_name); - gpr_slice_unref(slice); - gpr_slice_unref(slice_with_null_term); -} - -static void test_load_failure(void) { - FILE *tmp = NULL; - gpr_slice slice; - int success; - char *tmp_name; - - LOG_TEST_NAME("test_load_failure"); - - tmp = gpr_tmpfile(prefix, &tmp_name); - GPR_ASSERT(tmp_name != NULL); - GPR_ASSERT(tmp != NULL); - fclose(tmp); - remove(tmp_name); - - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 0); - GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0); - gpr_free(tmp_name); - gpr_slice_unref(slice); -} - -static void test_load_small_file(void) { - FILE *tmp = NULL; - gpr_slice slice; - gpr_slice slice_with_null_term; - int success; - char *tmp_name; - const char *blah = "blah"; - - LOG_TEST_NAME("test_load_small_file"); - - tmp = gpr_tmpfile(prefix, &tmp_name); - GPR_ASSERT(tmp_name != NULL); - GPR_ASSERT(tmp != NULL); - GPR_ASSERT(fwrite(blah, 1, strlen(blah), tmp) == strlen(blah)); - fclose(tmp); - - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 1); - GPR_ASSERT(GPR_SLICE_LENGTH(slice) == strlen(blah)); - GPR_ASSERT(!memcmp(GPR_SLICE_START_PTR(slice), blah, strlen(blah))); - - slice_with_null_term = gpr_load_file(tmp_name, 1, &success); - GPR_ASSERT(success == 1); - GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == (strlen(blah) + 1)); - GPR_ASSERT(strcmp((const char *)GPR_SLICE_START_PTR(slice_with_null_term), - blah) == 0); - - remove(tmp_name); - gpr_free(tmp_name); - gpr_slice_unref(slice); - gpr_slice_unref(slice_with_null_term); -} - -static void test_load_big_file(void) { - FILE *tmp = NULL; - gpr_slice slice; - int success; - char *tmp_name; - unsigned char buffer[124631]; - unsigned char *current; - size_t i; - - LOG_TEST_NAME("test_load_big_file"); - - for (i = 0; i < sizeof(buffer); i++) { - buffer[i] = 42; - } - - tmp = gpr_tmpfile(prefix, &tmp_name); - GPR_ASSERT(tmp != NULL); - GPR_ASSERT(tmp_name != NULL); - GPR_ASSERT(fwrite(buffer, 1, sizeof(buffer), tmp) == sizeof(buffer)); - fclose(tmp); - - slice = gpr_load_file(tmp_name, 0, &success); - GPR_ASSERT(success == 1); - GPR_ASSERT(GPR_SLICE_LENGTH(slice) == sizeof(buffer)); - current = GPR_SLICE_START_PTR(slice); - for (i = 0; i < sizeof(buffer); i++) { - GPR_ASSERT(current[i] == 42); - } - - remove(tmp_name); - gpr_free(tmp_name); - gpr_slice_unref(slice); -} - -int main(int argc, char **argv) { - grpc_test_init(argc, argv); - test_load_empty_file(); - test_load_failure(); - test_load_small_file(); - test_load_big_file(); - return 0; -} diff --git a/test/core/support/load_file_test.c b/test/core/support/load_file_test.c new file mode 100644 index 0000000000..59d6ba8912 --- /dev/null +++ b/test/core/support/load_file_test.c @@ -0,0 +1,173 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include +#include +#include + +#include "src/core/support/load_file.h" +#include "src/core/support/string.h" +#include "test/core/util/test_config.h" + +#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x) + +static const char prefix[] = "file_test"; + +static void test_load_empty_file(void) { + FILE *tmp = NULL; + gpr_slice slice; + gpr_slice slice_with_null_term; + int success; + char *tmp_name; + + LOG_TEST_NAME("test_load_empty_file"); + + tmp = gpr_tmpfile(prefix, &tmp_name); + GPR_ASSERT(tmp_name != NULL); + GPR_ASSERT(tmp != NULL); + fclose(tmp); + + slice = gpr_load_file(tmp_name, 0, &success); + GPR_ASSERT(success == 1); + GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0); + + slice_with_null_term = gpr_load_file(tmp_name, 1, &success); + GPR_ASSERT(success == 1); + GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == 1); + GPR_ASSERT(GPR_SLICE_START_PTR(slice_with_null_term)[0] == 0); + + remove(tmp_name); + gpr_free(tmp_name); + gpr_slice_unref(slice); + gpr_slice_unref(slice_with_null_term); +} + +static void test_load_failure(void) { + FILE *tmp = NULL; + gpr_slice slice; + int success; + char *tmp_name; + + LOG_TEST_NAME("test_load_failure"); + + tmp = gpr_tmpfile(prefix, &tmp_name); + GPR_ASSERT(tmp_name != NULL); + GPR_ASSERT(tmp != NULL); + fclose(tmp); + remove(tmp_name); + + slice = gpr_load_file(tmp_name, 0, &success); + GPR_ASSERT(success == 0); + GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0); + gpr_free(tmp_name); + gpr_slice_unref(slice); +} + +static void test_load_small_file(void) { + FILE *tmp = NULL; + gpr_slice slice; + gpr_slice slice_with_null_term; + int success; + char *tmp_name; + const char *blah = "blah"; + + LOG_TEST_NAME("test_load_small_file"); + + tmp = gpr_tmpfile(prefix, &tmp_name); + GPR_ASSERT(tmp_name != NULL); + GPR_ASSERT(tmp != NULL); + GPR_ASSERT(fwrite(blah, 1, strlen(blah), tmp) == strlen(blah)); + fclose(tmp); + + slice = gpr_load_file(tmp_name, 0, &success); + GPR_ASSERT(success == 1); + GPR_ASSERT(GPR_SLICE_LENGTH(slice) == strlen(blah)); + GPR_ASSERT(!memcmp(GPR_SLICE_START_PTR(slice), blah, strlen(blah))); + + slice_with_null_term = gpr_load_file(tmp_name, 1, &success); + GPR_ASSERT(success == 1); + GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == (strlen(blah) + 1)); + GPR_ASSERT(strcmp((const char *)GPR_SLICE_START_PTR(slice_with_null_term), + blah) == 0); + + remove(tmp_name); + gpr_free(tmp_name); + gpr_slice_unref(slice); + gpr_slice_unref(slice_with_null_term); +} + +static void test_load_big_file(void) { + FILE *tmp = NULL; + gpr_slice slice; + int success; + char *tmp_name; + unsigned char buffer[124631]; + unsigned char *current; + size_t i; + + LOG_TEST_NAME("test_load_big_file"); + + for (i = 0; i < sizeof(buffer); i++) { + buffer[i] = 42; + } + + tmp = gpr_tmpfile(prefix, &tmp_name); + GPR_ASSERT(tmp != NULL); + GPR_ASSERT(tmp_name != NULL); + GPR_ASSERT(fwrite(buffer, 1, sizeof(buffer), tmp) == sizeof(buffer)); + fclose(tmp); + + slice = gpr_load_file(tmp_name, 0, &success); + GPR_ASSERT(success == 1); + GPR_ASSERT(GPR_SLICE_LENGTH(slice) == sizeof(buffer)); + current = GPR_SLICE_START_PTR(slice); + for (i = 0; i < sizeof(buffer); i++) { + GPR_ASSERT(current[i] == 42); + } + + remove(tmp_name); + gpr_free(tmp_name); + gpr_slice_unref(slice); +} + +int main(int argc, char **argv) { + grpc_test_init(argc, argv); + test_load_empty_file(); + test_load_failure(); + test_load_small_file(); + test_load_big_file(); + return 0; +} diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc deleted file mode 100644 index cdca060c23..0000000000 --- a/test/cpp/interop/server.cc +++ /dev/null @@ -1,274 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "test/cpp/interop/server_helper.h" -#include "test/cpp/util/test_config.h" -#include "src/proto/grpc/testing/test.grpc.pb.h" -#include "src/proto/grpc/testing/empty.grpc.pb.h" -#include "src/proto/grpc/testing/messages.grpc.pb.h" - -DEFINE_bool(use_tls, false, "Whether to use tls."); -DEFINE_int32(port, 0, "Server port."); - -using grpc::Server; -using grpc::ServerBuilder; -using grpc::ServerContext; -using grpc::ServerCredentials; -using grpc::ServerReader; -using grpc::ServerReaderWriter; -using grpc::ServerWriter; -using grpc::SslServerCredentialsOptions; -using grpc::testing::InteropServerContextInspector; -using grpc::testing::Payload; -using grpc::testing::PayloadType; -using grpc::testing::SimpleRequest; -using grpc::testing::SimpleResponse; -using grpc::testing::StreamingInputCallRequest; -using grpc::testing::StreamingInputCallResponse; -using grpc::testing::StreamingOutputCallRequest; -using grpc::testing::StreamingOutputCallResponse; -using grpc::testing::TestService; -using grpc::Status; - -static bool got_sigint = false; -static const char* kRandomFile = "test/cpp/interop/rnd.dat"; - -bool SetPayload(PayloadType type, int size, Payload* payload) { - PayloadType response_type; - if (type == PayloadType::RANDOM) { - response_type = - rand() & 0x1 ? PayloadType::COMPRESSABLE : PayloadType::UNCOMPRESSABLE; - } else { - response_type = type; - } - payload->set_type(response_type); - switch (response_type) { - case PayloadType::COMPRESSABLE: { - std::unique_ptr body(new char[size]()); - payload->set_body(body.get(), size); - } break; - case PayloadType::UNCOMPRESSABLE: { - std::unique_ptr body(new char[size]()); - std::ifstream rnd_file(kRandomFile); - GPR_ASSERT(rnd_file.good()); - rnd_file.read(body.get(), size); - GPR_ASSERT(!rnd_file.eof()); // Requested more rnd bytes than available - payload->set_body(body.get(), size); - } break; - default: - GPR_ASSERT(false); - } - return true; -} - -template -void SetResponseCompression(ServerContext* context, - const RequestType& request) { - switch (request.response_compression()) { - case grpc::testing::NONE: - context->set_compression_algorithm(GRPC_COMPRESS_NONE); - break; - case grpc::testing::GZIP: - context->set_compression_algorithm(GRPC_COMPRESS_GZIP); - break; - case grpc::testing::DEFLATE: - context->set_compression_algorithm(GRPC_COMPRESS_DEFLATE); - break; - default: - abort(); - } -} - -class TestServiceImpl : public TestService::Service { - public: - Status EmptyCall(ServerContext* context, const grpc::testing::Empty* request, - grpc::testing::Empty* response) { - return Status::OK; - } - - Status UnaryCall(ServerContext* context, const SimpleRequest* request, - SimpleResponse* response) { - SetResponseCompression(context, *request); - if (request->response_size() > 0) { - if (!SetPayload(request->response_type(), request->response_size(), - response->mutable_payload())) { - return Status(grpc::StatusCode::INTERNAL, "Error creating payload."); - } - } - - if (request->has_response_status()) { - return Status( - static_cast(request->response_status().code()), - request->response_status().message()); - } - - return Status::OK; - } - - Status StreamingOutputCall( - ServerContext* context, const StreamingOutputCallRequest* request, - ServerWriter* writer) { - SetResponseCompression(context, *request); - StreamingOutputCallResponse response; - bool write_success = true; - for (int i = 0; write_success && i < request->response_parameters_size(); - i++) { - if (!SetPayload(request->response_type(), - request->response_parameters(i).size(), - response.mutable_payload())) { - return Status(grpc::StatusCode::INTERNAL, "Error creating payload."); - } - write_success = writer->Write(response); - } - if (write_success) { - return Status::OK; - } else { - return Status(grpc::StatusCode::INTERNAL, "Error writing response."); - } - } - - Status StreamingInputCall(ServerContext* context, - ServerReader* reader, - StreamingInputCallResponse* response) { - StreamingInputCallRequest request; - int aggregated_payload_size = 0; - while (reader->Read(&request)) { - if (request.has_payload()) { - aggregated_payload_size += request.payload().body().size(); - } - } - response->set_aggregated_payload_size(aggregated_payload_size); - return Status::OK; - } - - Status FullDuplexCall( - ServerContext* context, - ServerReaderWriter* stream) { - StreamingOutputCallRequest request; - StreamingOutputCallResponse response; - bool write_success = true; - while (write_success && stream->Read(&request)) { - SetResponseCompression(context, request); - if (request.response_parameters_size() != 0) { - response.mutable_payload()->set_type(request.payload().type()); - response.mutable_payload()->set_body( - grpc::string(request.response_parameters(0).size(), '\0')); - write_success = stream->Write(response); - } - } - if (write_success) { - return Status::OK; - } else { - return Status(grpc::StatusCode::INTERNAL, "Error writing response."); - } - } - - Status HalfDuplexCall( - ServerContext* context, - ServerReaderWriter* stream) { - std::vector requests; - StreamingOutputCallRequest request; - while (stream->Read(&request)) { - requests.push_back(request); - } - - StreamingOutputCallResponse response; - bool write_success = true; - for (unsigned int i = 0; write_success && i < requests.size(); i++) { - response.mutable_payload()->set_type(requests[i].payload().type()); - if (requests[i].response_parameters_size() == 0) { - return Status(grpc::StatusCode::INTERNAL, - "Request does not have response parameters."); - } - response.mutable_payload()->set_body( - grpc::string(requests[i].response_parameters(0).size(), '\0')); - write_success = stream->Write(response); - } - if (write_success) { - return Status::OK; - } else { - return Status(grpc::StatusCode::INTERNAL, "Error writing response."); - } - } -}; - -void RunServer() { - std::ostringstream server_address; - server_address << "0.0.0.0:" << FLAGS_port; - TestServiceImpl service; - - SimpleRequest request; - SimpleResponse response; - - ServerBuilder builder; - builder.RegisterService(&service); - std::shared_ptr creds = - grpc::testing::CreateInteropServerCredentials(); - builder.AddListeningPort(server_address.str(), creds); - std::unique_ptr server(builder.BuildAndStart()); - gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str()); - while (!got_sigint) { - sleep(5); - } -} - -static void sigint_handler(int x) { got_sigint = true; } - -int main(int argc, char** argv) { - grpc::testing::InitTest(&argc, &argv, true); - signal(SIGINT, sigint_handler); - - GPR_ASSERT(FLAGS_port != 0); - RunServer(); - - return 0; -} diff --git a/test/cpp/interop/server_main.cc b/test/cpp/interop/server_main.cc new file mode 100644 index 0000000000..cdca060c23 --- /dev/null +++ b/test/cpp/interop/server_main.cc @@ -0,0 +1,274 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "test/cpp/interop/server_helper.h" +#include "test/cpp/util/test_config.h" +#include "src/proto/grpc/testing/test.grpc.pb.h" +#include "src/proto/grpc/testing/empty.grpc.pb.h" +#include "src/proto/grpc/testing/messages.grpc.pb.h" + +DEFINE_bool(use_tls, false, "Whether to use tls."); +DEFINE_int32(port, 0, "Server port."); + +using grpc::Server; +using grpc::ServerBuilder; +using grpc::ServerContext; +using grpc::ServerCredentials; +using grpc::ServerReader; +using grpc::ServerReaderWriter; +using grpc::ServerWriter; +using grpc::SslServerCredentialsOptions; +using grpc::testing::InteropServerContextInspector; +using grpc::testing::Payload; +using grpc::testing::PayloadType; +using grpc::testing::SimpleRequest; +using grpc::testing::SimpleResponse; +using grpc::testing::StreamingInputCallRequest; +using grpc::testing::StreamingInputCallResponse; +using grpc::testing::StreamingOutputCallRequest; +using grpc::testing::StreamingOutputCallResponse; +using grpc::testing::TestService; +using grpc::Status; + +static bool got_sigint = false; +static const char* kRandomFile = "test/cpp/interop/rnd.dat"; + +bool SetPayload(PayloadType type, int size, Payload* payload) { + PayloadType response_type; + if (type == PayloadType::RANDOM) { + response_type = + rand() & 0x1 ? PayloadType::COMPRESSABLE : PayloadType::UNCOMPRESSABLE; + } else { + response_type = type; + } + payload->set_type(response_type); + switch (response_type) { + case PayloadType::COMPRESSABLE: { + std::unique_ptr body(new char[size]()); + payload->set_body(body.get(), size); + } break; + case PayloadType::UNCOMPRESSABLE: { + std::unique_ptr body(new char[size]()); + std::ifstream rnd_file(kRandomFile); + GPR_ASSERT(rnd_file.good()); + rnd_file.read(body.get(), size); + GPR_ASSERT(!rnd_file.eof()); // Requested more rnd bytes than available + payload->set_body(body.get(), size); + } break; + default: + GPR_ASSERT(false); + } + return true; +} + +template +void SetResponseCompression(ServerContext* context, + const RequestType& request) { + switch (request.response_compression()) { + case grpc::testing::NONE: + context->set_compression_algorithm(GRPC_COMPRESS_NONE); + break; + case grpc::testing::GZIP: + context->set_compression_algorithm(GRPC_COMPRESS_GZIP); + break; + case grpc::testing::DEFLATE: + context->set_compression_algorithm(GRPC_COMPRESS_DEFLATE); + break; + default: + abort(); + } +} + +class TestServiceImpl : public TestService::Service { + public: + Status EmptyCall(ServerContext* context, const grpc::testing::Empty* request, + grpc::testing::Empty* response) { + return Status::OK; + } + + Status UnaryCall(ServerContext* context, const SimpleRequest* request, + SimpleResponse* response) { + SetResponseCompression(context, *request); + if (request->response_size() > 0) { + if (!SetPayload(request->response_type(), request->response_size(), + response->mutable_payload())) { + return Status(grpc::StatusCode::INTERNAL, "Error creating payload."); + } + } + + if (request->has_response_status()) { + return Status( + static_cast(request->response_status().code()), + request->response_status().message()); + } + + return Status::OK; + } + + Status StreamingOutputCall( + ServerContext* context, const StreamingOutputCallRequest* request, + ServerWriter* writer) { + SetResponseCompression(context, *request); + StreamingOutputCallResponse response; + bool write_success = true; + for (int i = 0; write_success && i < request->response_parameters_size(); + i++) { + if (!SetPayload(request->response_type(), + request->response_parameters(i).size(), + response.mutable_payload())) { + return Status(grpc::StatusCode::INTERNAL, "Error creating payload."); + } + write_success = writer->Write(response); + } + if (write_success) { + return Status::OK; + } else { + return Status(grpc::StatusCode::INTERNAL, "Error writing response."); + } + } + + Status StreamingInputCall(ServerContext* context, + ServerReader* reader, + StreamingInputCallResponse* response) { + StreamingInputCallRequest request; + int aggregated_payload_size = 0; + while (reader->Read(&request)) { + if (request.has_payload()) { + aggregated_payload_size += request.payload().body().size(); + } + } + response->set_aggregated_payload_size(aggregated_payload_size); + return Status::OK; + } + + Status FullDuplexCall( + ServerContext* context, + ServerReaderWriter* stream) { + StreamingOutputCallRequest request; + StreamingOutputCallResponse response; + bool write_success = true; + while (write_success && stream->Read(&request)) { + SetResponseCompression(context, request); + if (request.response_parameters_size() != 0) { + response.mutable_payload()->set_type(request.payload().type()); + response.mutable_payload()->set_body( + grpc::string(request.response_parameters(0).size(), '\0')); + write_success = stream->Write(response); + } + } + if (write_success) { + return Status::OK; + } else { + return Status(grpc::StatusCode::INTERNAL, "Error writing response."); + } + } + + Status HalfDuplexCall( + ServerContext* context, + ServerReaderWriter* stream) { + std::vector requests; + StreamingOutputCallRequest request; + while (stream->Read(&request)) { + requests.push_back(request); + } + + StreamingOutputCallResponse response; + bool write_success = true; + for (unsigned int i = 0; write_success && i < requests.size(); i++) { + response.mutable_payload()->set_type(requests[i].payload().type()); + if (requests[i].response_parameters_size() == 0) { + return Status(grpc::StatusCode::INTERNAL, + "Request does not have response parameters."); + } + response.mutable_payload()->set_body( + grpc::string(requests[i].response_parameters(0).size(), '\0')); + write_success = stream->Write(response); + } + if (write_success) { + return Status::OK; + } else { + return Status(grpc::StatusCode::INTERNAL, "Error writing response."); + } + } +}; + +void RunServer() { + std::ostringstream server_address; + server_address << "0.0.0.0:" << FLAGS_port; + TestServiceImpl service; + + SimpleRequest request; + SimpleResponse response; + + ServerBuilder builder; + builder.RegisterService(&service); + std::shared_ptr creds = + grpc::testing::CreateInteropServerCredentials(); + builder.AddListeningPort(server_address.str(), creds); + std::unique_ptr server(builder.BuildAndStart()); + gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str()); + while (!got_sigint) { + sleep(5); + } +} + +static void sigint_handler(int x) { got_sigint = true; } + +int main(int argc, char** argv) { + grpc::testing::InitTest(&argc, &argv, true); + signal(SIGINT, sigint_handler); + + GPR_ASSERT(FLAGS_port != 0); + RunServer(); + + return 0; +} diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index c94a523fa1..aecbae95f9 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -46,10 +46,10 @@ #include "src/proto/grpc/testing/payloads.grpc.pb.h" #include "src/proto/grpc/testing/services.grpc.pb.h" -#include "test/cpp/qps/limit_cores.h" #include "test/cpp/qps/histogram.h" #include "test/cpp/qps/interarrival.h" -#include "test/cpp/qps/timer.h" +#include "test/cpp/qps/limit_cores.h" +#include "test/cpp/qps/usage_timer.h" #include "test/cpp/util/create_test_channel.h" namespace grpc { diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 9e8767d103..f8c1fa3b62 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -54,7 +54,7 @@ #include "src/proto/grpc/testing/services.grpc.pb.h" #include "test/cpp/qps/client.h" -#include "test/cpp/qps/timer.h" +#include "test/cpp/qps/usage_timer.h" #include "test/cpp/util/create_test_channel.h" namespace grpc { @@ -84,7 +84,8 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { std::function< std::unique_ptr>( BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&, - CompletionQueue*)> start_req, + CompletionQueue*)> + start_req, std::function on_done) : context_(), stub_(stub), @@ -141,7 +142,8 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { std::function next_issue_; std::function>( BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&, - CompletionQueue*)> start_req_; + CompletionQueue*)> + start_req_; grpc::Status status_; double start_; std::unique_ptr> @@ -164,7 +166,8 @@ class AsyncClient : public ClientImpl { AsyncClient(const ClientConfig& config, std::function next_issue, - const RequestType&)> setup_ctx, + const RequestType&)> + setup_ctx, std::function(std::shared_ptr)> create_stub) : ClientImpl(config, create_stub), @@ -277,7 +280,8 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext { std::function>( BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*, - void*)> start_req, + void*)> + start_req, std::function on_done) : context_(), stub_(stub), @@ -360,10 +364,10 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext { State next_state_; std::function callback_; std::function next_issue_; - std::function< - std::unique_ptr>( - BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*, - void*)> start_req_; + std::function>( + BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*, void*)> + start_req_; grpc::Status status_; double start_; std::unique_ptr> @@ -405,7 +409,8 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { std::function next_issue, std::function( grpc::GenericStub*, grpc::ClientContext*, - const grpc::string& method_name, CompletionQueue*, void*)> start_req, + const grpc::string& method_name, CompletionQueue*, void*)> + start_req, std::function on_done) : context_(), stub_(stub), @@ -493,7 +498,8 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { std::function next_issue_; std::function( grpc::GenericStub*, grpc::ClientContext*, const grpc::string&, - CompletionQueue*, void*)> start_req_; + CompletionQueue*, void*)> + start_req_; grpc::Status status_; double start_; std::unique_ptr stream_; diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index edfc246a25..e39768b498 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -58,7 +58,7 @@ #include "test/cpp/qps/client.h" #include "test/cpp/qps/histogram.h" #include "test/cpp/qps/interarrival.h" -#include "test/cpp/qps/timer.h" +#include "test/cpp/qps/usage_timer.h" namespace grpc { namespace testing { diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h index 94a6f8acfa..3227347e3f 100644 --- a/test/cpp/qps/server.h +++ b/test/cpp/qps/server.h @@ -43,7 +43,7 @@ #include "test/core/end2end/data/ssl_test_data.h" #include "test/core/util/port.h" #include "test/cpp/qps/limit_cores.h" -#include "test/cpp/qps/timer.h" +#include "test/cpp/qps/usage_timer.h" namespace grpc { namespace testing { diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc index 4b778820d0..b7682f5763 100644 --- a/test/cpp/qps/server_sync.cc +++ b/test/cpp/qps/server_sync.cc @@ -34,18 +34,18 @@ #include #include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include "test/cpp/qps/server.h" -#include "test/cpp/qps/timer.h" #include "src/proto/grpc/testing/services.grpc.pb.h" +#include "test/cpp/qps/server.h" +#include "test/cpp/qps/usage_timer.h" namespace grpc { namespace testing { diff --git a/test/cpp/qps/timer.cc b/test/cpp/qps/timer.cc deleted file mode 100644 index 3ec7f49f83..0000000000 --- a/test/cpp/qps/timer.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "test/cpp/qps/timer.h" - -#include -#include -#include - -Timer::Timer() : start_(Sample()) {} - -double Timer::Now() { - auto ts = gpr_now(GPR_CLOCK_REALTIME); - return ts.tv_sec + 1e-9 * ts.tv_nsec; -} - -static double time_double(struct timeval* tv) { - return tv->tv_sec + 1e-6 * tv->tv_usec; -} - -Timer::Result Timer::Sample() { - struct rusage usage; - struct timeval tv; - gettimeofday(&tv, NULL); - getrusage(RUSAGE_SELF, &usage); - - Result r; - r.wall = time_double(&tv); - r.user = time_double(&usage.ru_utime); - r.system = time_double(&usage.ru_stime); - return r; -} - -Timer::Result Timer::Mark() const { - Result s = Sample(); - Result r; - r.wall = s.wall - start_.wall; - r.user = s.user - start_.user; - r.system = s.system - start_.system; - return r; -} diff --git a/test/cpp/qps/timer.h b/test/cpp/qps/timer.h deleted file mode 100644 index d1aee1a9d1..0000000000 --- a/test/cpp/qps/timer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef TEST_QPS_TIMER_H -#define TEST_QPS_TIMER_H - -class Timer { - public: - Timer(); - - struct Result { - double wall; - double user; - double system; - }; - - Result Mark() const; - - static double Now(); - - private: - static Result Sample(); - - const Result start_; -}; - -#endif // TEST_QPS_TIMER_H diff --git a/test/cpp/qps/usage_timer.cc b/test/cpp/qps/usage_timer.cc new file mode 100644 index 0000000000..5a913d498f --- /dev/null +++ b/test/cpp/qps/usage_timer.cc @@ -0,0 +1,71 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/cpp/qps/usage_timer.h" + +#include +#include +#include + +Timer::Timer() : start_(Sample()) {} + +double Timer::Now() { + auto ts = gpr_now(GPR_CLOCK_REALTIME); + return ts.tv_sec + 1e-9 * ts.tv_nsec; +} + +static double time_double(struct timeval* tv) { + return tv->tv_sec + 1e-6 * tv->tv_usec; +} + +Timer::Result Timer::Sample() { + struct rusage usage; + struct timeval tv; + gettimeofday(&tv, NULL); + getrusage(RUSAGE_SELF, &usage); + + Result r; + r.wall = time_double(&tv); + r.user = time_double(&usage.ru_utime); + r.system = time_double(&usage.ru_stime); + return r; +} + +Timer::Result Timer::Mark() const { + Result s = Sample(); + Result r; + r.wall = s.wall - start_.wall; + r.user = s.user - start_.user; + r.system = s.system - start_.system; + return r; +} diff --git a/test/cpp/qps/usage_timer.h b/test/cpp/qps/usage_timer.h new file mode 100644 index 0000000000..704d4b02a2 --- /dev/null +++ b/test/cpp/qps/usage_timer.h @@ -0,0 +1,57 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef TEST_QPS_USAGE_TIMER_H +#define TEST_QPS_USAGE_TIMER_H + +class UsageTimer { + public: + Timer(); + + struct Result { + double wall; + double user; + double system; + }; + + Result Mark() const; + + static double Now(); + + private: + static Result Sample(); + + const Result start_; +}; + +#endif // TEST_QPS_TIMER_H diff --git a/tools/run_tests/sanity/check_sources_and_headers.py b/tools/run_tests/sanity/check_sources_and_headers.py index 3974af0032..44dc49bb06 100755 --- a/tools/run_tests/sanity/check_sources_and_headers.py +++ b/tools/run_tests/sanity/check_sources_and_headers.py @@ -59,25 +59,43 @@ def target_has_header(target, name): return True return False +def produces_object(name): + return os.path.splitext(name)[1] in ['.c', '.cc'] + +obj_producer_to_source = {'c': {}, 'c++': {}, 'csharp': {}} + errors = 0 for target in js: - for fn in target['src']: - with open(os.path.join(root, fn)) as f: - src = f.read().splitlines() - for line in src: - m = re_inc1.match(line) - if m: - if not target_has_header(target, m.group(1)): - print ( - 'target %s (%s) does not name header %s as a dependency' % ( - target['name'], fn, m.group(1))) - errors += 1 - m = re_inc2.match(line) - if m: - if not target_has_header(target, 'include/' + m.group(1)): - print ( - 'target %s (%s) does not name header %s as a dependency' % ( - target['name'], fn, m.group(1))) - errors += 1 + if not target['third_party']: + for fn in target['src']: + with open(os.path.join(root, fn)) as f: + src = f.read().splitlines() + for line in src: + m = re_inc1.match(line) + if m: + if not target_has_header(target, m.group(1)): + print ( + 'target %s (%s) does not name header %s as a dependency' % ( + target['name'], fn, m.group(1))) + errors += 1 + m = re_inc2.match(line) + if m: + if not target_has_header(target, 'include/' + m.group(1)): + print ( + 'target %s (%s) does not name header %s as a dependency' % ( + target['name'], fn, m.group(1))) + errors += 1 + if target['type'] == 'lib': + for fn in target['src']: + language = target['language'] + if produces_object(fn): + obj_base = os.path.splitext(os.path.basename(fn))[0] + if obj_base in obj_producer_to_source[language]: + if obj_producer_to_source[language][obj_base] != fn: + print ( + 'target %s (%s) produces an aliased object file with %s' % ( + target['name'], fn, obj_producer_to_source[language][obj_base])) + else: + obj_producer_to_source[language][obj_base] = fn assert errors == 0 diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 3cdd7b453c..a1bdd5e6e9 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -13,7 +13,9 @@ "name": "alarm_test", "src": [ "test/core/surface/alarm_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -27,7 +29,9 @@ "name": "algorithm_test", "src": [ "test/core/compression/algorithm_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -39,7 +43,9 @@ "name": "alloc_test", "src": [ "test/core/support/alloc_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -53,7 +59,9 @@ "name": "alpn_test", "src": [ "test/core/transport/chttp2/alpn_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -65,7 +73,9 @@ "name": "bin_encoder_test", "src": [ "test/core/transport/chttp2/bin_encoder_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -79,21 +89,9 @@ "name": "census_context_test", "src": [ "test/core/census/context_test.c" - ] - }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" ], - "headers": [], - "language": "c", - "name": "census_log_test", - "src": [ - "test/core/census/log_test.c" - ] + "third_party": false, + "type": "target" }, { "deps": [ @@ -107,7 +105,9 @@ "name": "channel_create_test", "src": [ "test/core/surface/channel_create_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -121,7 +121,9 @@ "name": "chttp2_hpack_encoder_test", "src": [ "test/core/transport/chttp2/hpack_encoder_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -135,7 +137,9 @@ "name": "chttp2_status_conversion_test", "src": [ "test/core/transport/chttp2/status_conversion_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -149,7 +153,9 @@ "name": "chttp2_stream_map_test", "src": [ "test/core/transport/chttp2/stream_map_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -163,7 +169,9 @@ "name": "chttp2_varint_test", "src": [ "test/core/transport/chttp2/varint_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -177,7 +185,9 @@ "name": "compression_test", "src": [ "test/core/compression/compression_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -191,7 +201,9 @@ "name": "dns_resolver_test", "src": [ "test/core/client_config/resolvers/dns_resolver_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -205,7 +217,9 @@ "name": "dualstack_socket_test", "src": [ "test/core/end2end/dualstack_socket_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -219,7 +233,9 @@ "name": "endpoint_pair_test", "src": [ "test/core/iomgr/endpoint_pair_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -233,7 +249,9 @@ "name": "fd_conservation_posix_test", "src": [ "test/core/iomgr/fd_conservation_posix_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -247,7 +265,9 @@ "name": "fd_posix_test", "src": [ "test/core/iomgr/fd_posix_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -261,7 +281,9 @@ "name": "fling_client", "src": [ "test/core/fling/client.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -275,7 +297,9 @@ "name": "fling_server", "src": [ "test/core/fling/server.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -289,7 +313,9 @@ "name": "fling_stream_test", "src": [ "test/core/fling/fling_stream_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -303,7 +329,9 @@ "name": "fling_test", "src": [ "test/core/fling/fling_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -315,7 +343,9 @@ "name": "gen_hpack_tables", "src": [ "tools/codegen/core/gen_hpack_tables.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [], @@ -324,7 +354,9 @@ "name": "gen_legal_metadata_characters", "src": [ "tools/codegen/core/gen_legal_metadata_characters.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -336,7 +368,9 @@ "name": "gpr_avl_test", "src": [ "test/core/support/avl_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -348,7 +382,9 @@ "name": "gpr_cmdline_test", "src": [ "test/core/support/cmdline_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -360,7 +396,9 @@ "name": "gpr_cpu_test", "src": [ "test/core/support/cpu_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -372,7 +410,9 @@ "name": "gpr_env_test", "src": [ "test/core/support/env_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -381,10 +421,12 @@ ], "headers": [], "language": "c", - "name": "gpr_file_test", + "name": "gpr_histogram_test", "src": [ - "test/core/support/file_test.c" - ] + "test/core/support/histogram_test.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -393,10 +435,12 @@ ], "headers": [], "language": "c", - "name": "gpr_histogram_test", + "name": "gpr_host_port_test", "src": [ - "test/core/support/histogram_test.c" - ] + "test/core/support/host_port_test.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -405,10 +449,12 @@ ], "headers": [], "language": "c", - "name": "gpr_host_port_test", + "name": "gpr_load_file_test", "src": [ - "test/core/support/host_port_test.c" - ] + "test/core/support/load_file_test.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -420,7 +466,9 @@ "name": "gpr_log_test", "src": [ "test/core/support/log_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -432,7 +480,9 @@ "name": "gpr_slice_buffer_test", "src": [ "test/core/support/slice_buffer_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -444,7 +494,9 @@ "name": "gpr_slice_test", "src": [ "test/core/support/slice_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -456,7 +508,9 @@ "name": "gpr_stack_lockfree_test", "src": [ "test/core/support/stack_lockfree_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -468,7 +522,9 @@ "name": "gpr_string_test", "src": [ "test/core/support/string_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -480,7 +536,9 @@ "name": "gpr_sync_test", "src": [ "test/core/support/sync_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -492,7 +550,9 @@ "name": "gpr_thd_test", "src": [ "test/core/support/thd_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -504,7 +564,9 @@ "name": "gpr_time_test", "src": [ "test/core/support/time_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -516,7 +578,9 @@ "name": "gpr_tls_test", "src": [ "test/core/support/tls_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -528,7 +592,9 @@ "name": "gpr_useful_test", "src": [ "test/core/support/useful_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -542,7 +608,9 @@ "name": "grpc_auth_context_test", "src": [ "test/core/security/auth_context_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -553,10 +621,12 @@ ], "headers": [], "language": "c", - "name": "grpc_base64_test", + "name": "grpc_b64_test", "src": [ - "test/core/security/base64_test.c" - ] + "test/core/security/b64_test.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -570,7 +640,9 @@ "name": "grpc_byte_buffer_reader_test", "src": [ "test/core/surface/byte_buffer_reader_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -584,7 +656,9 @@ "name": "grpc_channel_args_test", "src": [ "test/core/channel/channel_args_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -598,7 +672,9 @@ "name": "grpc_channel_stack_test", "src": [ "test/core/channel/channel_stack_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -612,7 +688,9 @@ "name": "grpc_completion_queue_test", "src": [ "test/core/surface/completion_queue_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -626,7 +704,9 @@ "name": "grpc_create_jwt", "src": [ "test/core/security/create_jwt.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -640,7 +720,9 @@ "name": "grpc_credentials_test", "src": [ "test/core/security/credentials_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -654,7 +736,9 @@ "name": "grpc_fetch_oauth2", "src": [ "test/core/security/fetch_oauth2.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -668,7 +752,9 @@ "name": "grpc_invalid_channel_args_test", "src": [ "test/core/surface/invalid_channel_args_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -682,7 +768,9 @@ "name": "grpc_json_token_test", "src": [ "test/core/security/json_token_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -696,7 +784,9 @@ "name": "grpc_jwt_verifier_test", "src": [ "test/core/security/jwt_verifier_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -710,7 +800,9 @@ "name": "grpc_print_google_default_creds_token", "src": [ "test/core/security/print_google_default_creds_token.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -724,7 +816,9 @@ "name": "grpc_security_connector_test", "src": [ "test/core/security/security_connector_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -738,7 +832,9 @@ "name": "grpc_verify_jwt", "src": [ "test/core/security/verify_jwt.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -752,7 +848,9 @@ "name": "hpack_parser_test", "src": [ "test/core/transport/chttp2/hpack_parser_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -766,7 +864,9 @@ "name": "hpack_table_test", "src": [ "test/core/transport/chttp2/hpack_table_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -780,7 +880,9 @@ "name": "httpcli_format_request_test", "src": [ "test/core/httpcli/format_request_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -794,7 +896,9 @@ "name": "httpcli_parser_test", "src": [ "test/core/httpcli/parser_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -808,7 +912,9 @@ "name": "httpcli_test", "src": [ "test/core/httpcli/httpcli_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -822,7 +928,9 @@ "name": "httpscli_test", "src": [ "test/core/httpcli/httpscli_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -836,7 +944,9 @@ "name": "init_test", "src": [ "test/core/surface/init_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -850,7 +960,9 @@ "name": "invalid_call_argument_test", "src": [ "test/core/end2end/invalid_call_argument_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -862,7 +974,9 @@ "name": "json_rewrite", "src": [ "test/core/json/json_rewrite.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -876,7 +990,9 @@ "name": "json_rewrite_test", "src": [ "test/core/json/json_rewrite_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -890,7 +1006,9 @@ "name": "json_stream_error_test", "src": [ "test/core/json/json_stream_error_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -904,7 +1022,9 @@ "name": "json_test", "src": [ "test/core/json/json_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -918,7 +1038,9 @@ "name": "lame_client_test", "src": [ "test/core/surface/lame_client_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -932,7 +1054,9 @@ "name": "lb_policies_test", "src": [ "test/core/client_config/lb_policies_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -946,7 +1070,9 @@ "name": "low_level_ping_pong_benchmark", "src": [ "test/core/network_benchmarks/low_level_ping_pong.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -960,7 +1086,25 @@ "name": "message_compress_test", "src": [ "test/core/compression/message_compress_test.c" - ] + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "mlog_test", + "src": [ + "test/core/census/mlog_test.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -974,7 +1118,9 @@ "name": "multiple_server_queues_test", "src": [ "test/core/end2end/multiple_server_queues_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -986,7 +1132,9 @@ "name": "murmur_hash_test", "src": [ "test/core/support/murmur_hash_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1000,7 +1148,9 @@ "name": "no_server_test", "src": [ "test/core/end2end/no_server_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1014,7 +1164,9 @@ "name": "resolve_address_test", "src": [ "test/core/iomgr/resolve_address_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1028,7 +1180,9 @@ "name": "secure_channel_create_test", "src": [ "test/core/surface/secure_channel_create_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1042,7 +1196,9 @@ "name": "secure_endpoint_test", "src": [ "test/core/security/secure_endpoint_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1056,7 +1212,9 @@ "name": "server_chttp2_test", "src": [ "test/core/surface/server_chttp2_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1070,7 +1228,9 @@ "name": "server_test", "src": [ "test/core/surface/server_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1085,7 +1245,9 @@ "name": "set_initial_connect_string_test", "src": [ "test/core/client_config/set_initial_connect_string_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1099,7 +1261,9 @@ "name": "sockaddr_resolver_test", "src": [ "test/core/client_config/resolvers/sockaddr_resolver_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1113,7 +1277,9 @@ "name": "sockaddr_utils_test", "src": [ "test/core/iomgr/sockaddr_utils_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1127,7 +1293,9 @@ "name": "socket_utils_test", "src": [ "test/core/iomgr/socket_utils_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1141,7 +1309,9 @@ "name": "tcp_client_posix_test", "src": [ "test/core/iomgr/tcp_client_posix_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1155,7 +1325,9 @@ "name": "tcp_posix_test", "src": [ "test/core/iomgr/tcp_posix_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1169,7 +1341,9 @@ "name": "tcp_server_posix_test", "src": [ "test/core/iomgr/tcp_server_posix_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1183,7 +1357,9 @@ "name": "time_averaged_stats_test", "src": [ "test/core/iomgr/time_averaged_stats_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1197,7 +1373,9 @@ "name": "timeout_encoding_test", "src": [ "test/core/transport/chttp2/timeout_encoding_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1211,7 +1389,9 @@ "name": "timer_heap_test", "src": [ "test/core/iomgr/timer_heap_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1225,7 +1405,9 @@ "name": "timer_list_test", "src": [ "test/core/iomgr/timer_list_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1239,7 +1421,9 @@ "name": "timers_test", "src": [ "test/core/profiling/timers_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1253,7 +1437,9 @@ "name": "transport_connectivity_state_test", "src": [ "test/core/transport/connectivity_state_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1267,7 +1453,9 @@ "name": "transport_metadata_test", "src": [ "test/core/transport/metadata_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1281,7 +1469,9 @@ "name": "transport_security_test", "src": [ "test/core/tsi/transport_security_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1295,7 +1485,9 @@ "name": "udp_server_test", "src": [ "test/core/iomgr/udp_server_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1309,7 +1501,9 @@ "name": "uri_parser_test", "src": [ "test/core/client_config/uri_parser_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1323,7 +1517,9 @@ "name": "workqueue_test", "src": [ "test/core/iomgr/workqueue_test.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1339,7 +1535,9 @@ "name": "alarm_cpp_test", "src": [ "test/cpp/common/alarm_cpp_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1355,7 +1553,9 @@ "name": "async_end2end_test", "src": [ "test/cpp/end2end/async_end2end_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1372,7 +1572,9 @@ "name": "async_streaming_ping_pong_test", "src": [ "test/cpp/qps/async_streaming_ping_pong_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1389,7 +1591,9 @@ "name": "async_unary_ping_pong_test", "src": [ "test/cpp/qps/async_unary_ping_pong_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1405,7 +1609,9 @@ "name": "auth_property_iterator_test", "src": [ "test/cpp/common/auth_property_iterator_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1418,7 +1624,9 @@ "name": "channel_arguments_test", "src": [ "test/cpp/common/channel_arguments_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1434,7 +1642,9 @@ "name": "cli_call_test", "src": [ "test/cpp/util/cli_call_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1450,7 +1660,9 @@ "name": "client_crash_test", "src": [ "test/cpp/end2end/client_crash_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1466,7 +1678,9 @@ "name": "client_crash_test_server", "src": [ "test/cpp/end2end/client_crash_test_server.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1479,7 +1693,9 @@ "name": "credentials_test", "src": [ "test/cpp/client/credentials_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1494,7 +1710,9 @@ "name": "cxx_byte_buffer_test", "src": [ "test/cpp/util/byte_buffer_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1509,7 +1727,9 @@ "name": "cxx_slice_test", "src": [ "test/cpp/util/slice_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1520,7 +1740,9 @@ "name": "cxx_string_ref_test", "src": [ "test/cpp/util/string_ref_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1535,7 +1757,9 @@ "name": "cxx_time_test", "src": [ "test/cpp/util/time_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1551,7 +1775,9 @@ "name": "end2end_test", "src": [ "test/cpp/end2end/end2end_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1568,7 +1794,9 @@ "name": "generic_async_streaming_ping_pong_test", "src": [ "test/cpp/qps/generic_async_streaming_ping_pong_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1584,7 +1812,9 @@ "name": "generic_end2end_test", "src": [ "test/cpp/end2end/generic_end2end_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1601,7 +1831,9 @@ "name": "grpc_cli", "src": [ "test/cpp/util/grpc_cli.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1612,7 +1844,9 @@ "name": "grpc_cpp_plugin", "src": [ "src/compiler/cpp_plugin.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1623,7 +1857,9 @@ "name": "grpc_csharp_plugin", "src": [ "src/compiler/csharp_plugin.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1634,7 +1870,9 @@ "name": "grpc_objective_c_plugin", "src": [ "src/compiler/objective_c_plugin.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1645,7 +1883,9 @@ "name": "grpc_python_plugin", "src": [ "src/compiler/python_plugin.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1656,7 +1896,9 @@ "name": "grpc_ruby_plugin", "src": [ "src/compiler/ruby_plugin.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1672,7 +1914,9 @@ "name": "hybrid_end2end_test", "src": [ "test/cpp/end2end/hybrid_end2end_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1689,7 +1933,9 @@ "headers": [], "language": "c++", "name": "interop_client", - "src": [] + "src": [], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1706,7 +1952,9 @@ "headers": [], "language": "c++", "name": "interop_server", - "src": [] + "src": [], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1720,7 +1968,9 @@ "name": "interop_test", "src": [ "test/cpp/interop/interop_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1739,7 +1989,9 @@ "src": [ "test/cpp/interop/metrics_client.cc", "test/cpp/util/metrics_server.h" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1755,7 +2007,9 @@ "name": "mock_test", "src": [ "test/cpp/end2end/mock_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1773,7 +2027,9 @@ "name": "qps_driver", "src": [ "test/cpp/qps/qps_driver.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1790,7 +2046,9 @@ "name": "qps_interarrival_test", "src": [ "test/cpp/qps/qps_interarrival_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1808,7 +2066,9 @@ "name": "qps_openloop_test", "src": [ "test/cpp/qps/qps_openloop_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1826,7 +2086,9 @@ "name": "qps_test", "src": [ "test/cpp/qps/qps_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1849,7 +2111,9 @@ "test/cpp/qps/client.h", "test/cpp/qps/server.h", "test/cpp/qps/worker.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1873,7 +2137,9 @@ "name": "reconnect_interop_client", "src": [ "test/cpp/interop/reconnect_interop_client.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1899,7 +2165,9 @@ "name": "reconnect_interop_server", "src": [ "test/cpp/interop/reconnect_interop_server.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1915,7 +2183,9 @@ "name": "secure_auth_context_test", "src": [ "test/cpp/common/secure_auth_context_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1932,7 +2202,9 @@ "name": "secure_sync_unary_ping_pong_test", "src": [ "test/cpp/qps/secure_sync_unary_ping_pong_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1948,7 +2220,9 @@ "name": "server_crash_test", "src": [ "test/cpp/end2end/server_crash_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1964,7 +2238,9 @@ "name": "server_crash_test_client", "src": [ "test/cpp/end2end/server_crash_test_client.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1980,7 +2256,9 @@ "name": "shutdown_test", "src": [ "test/cpp/end2end/shutdown_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -1995,7 +2273,9 @@ "name": "status_test", "src": [ "test/cpp/util/status_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -2011,7 +2291,9 @@ "name": "streaming_throughput_test", "src": [ "test/cpp/end2end/streaming_throughput_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -2048,7 +2330,9 @@ "test/cpp/interop/stress_test.cc", "test/cpp/util/metrics_server.cc", "test/cpp/util/metrics_server.h" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -2065,7 +2349,9 @@ "name": "sync_streaming_ping_pong_test", "src": [ "test/cpp/qps/sync_streaming_ping_pong_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -2082,7 +2368,9 @@ "name": "sync_unary_ping_pong_test", "src": [ "test/cpp/qps/sync_unary_ping_pong_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -2098,7 +2386,9 @@ "name": "thread_stress_test", "src": [ "test/cpp/end2end/thread_stress_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -2118,7 +2408,9 @@ "name": "zookeeper_test", "src": [ "test/cpp/end2end/zookeeper_test.cc" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ @@ -2130,522 +2422,481 @@ "name": "public_headers_must_be_c89", "src": [ "test/core/surface/public_headers_must_be_c89.c" - ] + ], + "third_party": false, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_aes_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "badreq_bad_client_test", - "src": [ - "test/core/bad_client/tests/badreq.c" - ] + "language": "c++", + "name": "boringssl_aes_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_base64_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "connection_prefix_bad_client_test", - "src": [ - "test/core/bad_client/tests/connection_prefix.c" - ] + "language": "c++", + "name": "boringssl_base64_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_bio_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "headers_bad_client_test", - "src": [ - "test/core/bad_client/tests/headers.c" - ] + "language": "c++", + "name": "boringssl_bio_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_bn_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "initial_settings_frame_bad_client_test", - "src": [ - "test/core/bad_client/tests/initial_settings_frame.c" - ] + "language": "c++", + "name": "boringssl_bn_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_bytestring_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "server_registered_method_bad_client_test", - "src": [ - "test/core/bad_client/tests/server_registered_method.c" - ] + "language": "c++", + "name": "boringssl_bytestring_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_aead_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "simple_request_bad_client_test", - "src": [ - "test/core/bad_client/tests/simple_request.c" - ] + "language": "c++", + "name": "boringssl_aead_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_cipher_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "unknown_frame_bad_client_test", - "src": [ - "test/core/bad_client/tests/unknown_frame.c" - ] + "language": "c++", + "name": "boringssl_cipher_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_client_test", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_cmac_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "window_overflow_bad_client_test", - "src": [ - "test/core/bad_client/tests/window_overflow.c" - ] + "language": "c++", + "name": "boringssl_cmac_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_ssl_test_server", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_constant_time_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "bad_ssl_alpn_server", - "src": [ - "test/core/bad_ssl/servers/alpn.c" - ] + "language": "c++", + "name": "boringssl_constant_time_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "bad_ssl_test_server", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_ed25519_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "bad_ssl_cert_server", - "src": [ - "test/core/bad_ssl/servers/cert.c" - ] + "language": "c++", + "name": "boringssl_ed25519_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_test_util", + "boringssl_x25519_test_lib" ], "headers": [], - "language": "c", - "name": "bad_ssl_alpn_test", - "src": [ - "test/core/bad_ssl/bad_ssl_test.c" - ] + "language": "c++", + "name": "boringssl_x25519_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_dh_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "bad_ssl_cert_test", - "src": [ - "test/core/bad_ssl/bad_ssl_test.c" - ] + "language": "c++", + "name": "boringssl_dh_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_digest_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_census_test", - "src": [ - "test/core/end2end/fixtures/h2_census.c" - ] + "language": "c++", + "name": "boringssl_digest_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_dsa_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_compress_test", - "src": [ - "test/core/end2end/fixtures/h2_compress.c" - ] + "language": "c++", + "name": "boringssl_dsa_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_ec_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_fakesec_test", - "src": [ - "test/core/end2end/fixtures/h2_fakesec.c" - ] + "language": "c++", + "name": "boringssl_ec_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_example_mul_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_full_test", - "src": [ - "test/core/end2end/fixtures/h2_full.c" - ] + "language": "c++", + "name": "boringssl_example_mul", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_ecdsa_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_full+pipe_test", - "src": [ - "test/core/end2end/fixtures/h2_full+pipe.c" - ] + "language": "c++", + "name": "boringssl_ecdsa_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_err_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_full+poll_test", - "src": [ - "test/core/end2end/fixtures/h2_full+poll.c" - ] + "language": "c++", + "name": "boringssl_err_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_evp_extra_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_full+poll+pipe_test", - "src": [ - "test/core/end2end/fixtures/h2_full+poll+pipe.c" - ] + "language": "c++", + "name": "boringssl_evp_extra_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_evp_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_oauth2_test", - "src": [ - "test/core/end2end/fixtures/h2_oauth2.c" - ] + "language": "c++", + "name": "boringssl_evp_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_pbkdf_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_proxy_test", - "src": [ - "test/core/end2end/fixtures/h2_proxy.c" - ] + "language": "c++", + "name": "boringssl_pbkdf_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_hkdf_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_sockpair_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair.c" - ] + "language": "c++", + "name": "boringssl_hkdf_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_hmac_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_sockpair+trace_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair+trace.c" - ] + "language": "c++", + "name": "boringssl_hmac_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_lhash_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_sockpair_1byte_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair_1byte.c" - ] + "language": "c++", + "name": "boringssl_lhash_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_gcm_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_ssl_test", - "src": [ - "test/core/end2end/fixtures/h2_ssl.c" - ] + "language": "c++", + "name": "boringssl_gcm_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_pkcs12_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_ssl+poll_test", - "src": [ - "test/core/end2end/fixtures/h2_ssl+poll.c" - ] + "language": "c++", + "name": "boringssl_pkcs12_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_pkcs8_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_ssl_proxy_test", - "src": [ - "test/core/end2end/fixtures/h2_ssl_proxy.c" - ] + "language": "c++", + "name": "boringssl_pkcs8_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_poly1305_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_uchannel_test", - "src": [ - "test/core/end2end/fixtures/h2_uchannel.c" - ] + "language": "c++", + "name": "boringssl_poly1305_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_refcount_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_uds_test", - "src": [ - "test/core/end2end/fixtures/h2_uds.c" - ] + "language": "c++", + "name": "boringssl_refcount_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_certs", - "end2end_tests", - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" + "boringssl", + "boringssl_rsa_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_uds+poll_test", - "src": [ - "test/core/end2end/fixtures/h2_uds+poll.c" - ] + "language": "c++", + "name": "boringssl_rsa_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_test_util", + "boringssl_thread_test_lib" ], "headers": [], - "language": "c", - "name": "h2_census_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_census.c" - ] + "language": "c++", + "name": "boringssl_thread_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_pkcs7_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_compress_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_compress.c" - ] + "language": "c++", + "name": "boringssl_pkcs7_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", - "gpr", - "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "boringssl", + "boringssl_tab_test_lib", + "boringssl_test_util" ], "headers": [], - "language": "c", - "name": "h2_full_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_full.c" - ] + "language": "c++", + "name": "boringssl_tab_test", + "src": [], + "third_party": true, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "boringssl", + "boringssl_test_util", + "boringssl_v3name_test_lib" + ], + "headers": [], + "language": "c++", + "name": "boringssl_v3name_test", + "src": [], + "third_party": true, + "type": "target" + }, + { + "deps": [ + "boringssl", + "boringssl_pqueue_test_lib", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_pqueue_test", + "src": [], + "third_party": true, + "type": "target" + }, + { + "deps": [ + "boringssl", + "boringssl_ssl_test_lib", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_ssl_test", + "src": [], + "third_party": true, + "type": "target" + }, + { + "deps": [ + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2653,14 +2904,16 @@ ], "headers": [], "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "badreq_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_full+pipe.c" - ] + "test/core/bad_client/tests/badreq.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2668,14 +2921,16 @@ ], "headers": [], "language": "c", - "name": "h2_full+poll_nosec_test", + "name": "connection_prefix_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_full+poll.c" - ] + "test/core/bad_client/tests/connection_prefix.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2683,14 +2938,16 @@ ], "headers": [], "language": "c", - "name": "h2_full+poll+pipe_nosec_test", + "name": "headers_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_full+poll+pipe.c" - ] + "test/core/bad_client/tests/headers.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2698,14 +2955,16 @@ ], "headers": [], "language": "c", - "name": "h2_proxy_nosec_test", + "name": "initial_settings_frame_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_proxy.c" - ] + "test/core/bad_client/tests/initial_settings_frame.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2713,14 +2972,16 @@ ], "headers": [], "language": "c", - "name": "h2_sockpair_nosec_test", + "name": "server_registered_method_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_sockpair.c" - ] + "test/core/bad_client/tests/server_registered_method.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2728,14 +2989,16 @@ ], "headers": [], "language": "c", - "name": "h2_sockpair+trace_nosec_test", + "name": "simple_request_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_sockpair+trace.c" - ] + "test/core/bad_client/tests/simple_request.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2743,14 +3006,16 @@ ], "headers": [], "language": "c", - "name": "h2_sockpair_1byte_nosec_test", + "name": "unknown_frame_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_sockpair_1byte.c" - ] + "test/core/bad_client/tests/unknown_frame.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_client_test", "gpr", "gpr_test_util", "grpc_test_util_unsecure", @@ -2758,897 +3023,1494 @@ ], "headers": [], "language": "c", - "name": "h2_uchannel_nosec_test", + "name": "window_overflow_bad_client_test", "src": [ - "test/core/end2end/fixtures/h2_uchannel.c" - ] + "test/core/bad_client/tests/window_overflow.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_ssl_test_server", "gpr", "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "grpc", + "grpc_test_util" ], "headers": [], "language": "c", - "name": "h2_uds_nosec_test", + "name": "bad_ssl_alpn_server", "src": [ - "test/core/end2end/fixtures/h2_uds.c" - ] + "test/core/bad_ssl/servers/alpn.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "end2end_nosec_tests", + "bad_ssl_test_server", "gpr", "gpr_test_util", - "grpc_test_util_unsecure", - "grpc_unsecure" + "grpc", + "grpc_test_util" ], "headers": [], "language": "c", - "name": "h2_uds+poll_nosec_test", + "name": "bad_ssl_cert_server", "src": [ - "test/core/end2end/fixtures/h2_uds+poll.c" - ] + "test/core/bad_ssl/servers/cert.c" + ], + "third_party": false, + "type": "target" }, { - "deps": [], - "headers": [ - "include/grpc/impl/codegen/alloc.h", - "include/grpc/impl/codegen/atm.h", - "include/grpc/impl/codegen/atm_gcc_atomic.h", - "include/grpc/impl/codegen/atm_gcc_sync.h", - "include/grpc/impl/codegen/atm_win32.h", - "include/grpc/impl/codegen/log.h", - "include/grpc/impl/codegen/port_platform.h", - "include/grpc/impl/codegen/slice.h", - "include/grpc/impl/codegen/slice_buffer.h", - "include/grpc/impl/codegen/sync.h", - "include/grpc/impl/codegen/sync_generic.h", - "include/grpc/impl/codegen/sync_posix.h", - "include/grpc/impl/codegen/sync_win32.h", - "include/grpc/impl/codegen/time.h", - "include/grpc/support/alloc.h", - "include/grpc/support/atm.h", - "include/grpc/support/atm_gcc_atomic.h", - "include/grpc/support/atm_gcc_sync.h", - "include/grpc/support/atm_win32.h", - "include/grpc/support/avl.h", - "include/grpc/support/cmdline.h", - "include/grpc/support/cpu.h", - "include/grpc/support/histogram.h", - "include/grpc/support/host_port.h", - "include/grpc/support/log.h", - "include/grpc/support/log_win32.h", - "include/grpc/support/port_platform.h", - "include/grpc/support/slice.h", - "include/grpc/support/slice_buffer.h", - "include/grpc/support/string_util.h", - "include/grpc/support/subprocess.h", - "include/grpc/support/sync.h", - "include/grpc/support/sync_generic.h", - "include/grpc/support/sync_posix.h", - "include/grpc/support/sync_win32.h", - "include/grpc/support/thd.h", - "include/grpc/support/time.h", - "include/grpc/support/tls.h", - "include/grpc/support/tls_gcc.h", - "include/grpc/support/tls_msvc.h", - "include/grpc/support/tls_pthread.h", - "include/grpc/support/useful.h", - "src/core/profiling/timers.h", - "src/core/support/block_annotate.h", - "src/core/support/env.h", - "src/core/support/file.h", - "src/core/support/murmur_hash.h", - "src/core/support/stack_lockfree.h", - "src/core/support/string.h", - "src/core/support/string_win32.h", - "src/core/support/thd_internal.h", - "src/core/support/time_precise.h" + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], + "headers": [], "language": "c", - "name": "gpr", + "name": "bad_ssl_alpn_test", "src": [ - "include/grpc/impl/codegen/alloc.h", - "include/grpc/impl/codegen/atm.h", - "include/grpc/impl/codegen/atm_gcc_atomic.h", - "include/grpc/impl/codegen/atm_gcc_sync.h", - "include/grpc/impl/codegen/atm_win32.h", - "include/grpc/impl/codegen/log.h", - "include/grpc/impl/codegen/port_platform.h", - "include/grpc/impl/codegen/slice.h", - "include/grpc/impl/codegen/slice_buffer.h", - "include/grpc/impl/codegen/sync.h", - "include/grpc/impl/codegen/sync_generic.h", - "include/grpc/impl/codegen/sync_posix.h", - "include/grpc/impl/codegen/sync_win32.h", - "include/grpc/impl/codegen/time.h", - "include/grpc/support/alloc.h", - "include/grpc/support/atm.h", - "include/grpc/support/atm_gcc_atomic.h", - "include/grpc/support/atm_gcc_sync.h", - "include/grpc/support/atm_win32.h", - "include/grpc/support/avl.h", - "include/grpc/support/cmdline.h", - "include/grpc/support/cpu.h", - "include/grpc/support/histogram.h", - "include/grpc/support/host_port.h", - "include/grpc/support/log.h", - "include/grpc/support/log_win32.h", - "include/grpc/support/port_platform.h", - "include/grpc/support/slice.h", - "include/grpc/support/slice_buffer.h", - "include/grpc/support/string_util.h", - "include/grpc/support/subprocess.h", - "include/grpc/support/sync.h", - "include/grpc/support/sync_generic.h", - "include/grpc/support/sync_posix.h", - "include/grpc/support/sync_win32.h", - "include/grpc/support/thd.h", - "include/grpc/support/time.h", - "include/grpc/support/tls.h", - "include/grpc/support/tls_gcc.h", - "include/grpc/support/tls_msvc.h", - "include/grpc/support/tls_pthread.h", - "include/grpc/support/useful.h", - "src/core/profiling/basic_timers.c", - "src/core/profiling/stap_timers.c", - "src/core/profiling/timers.h", - "src/core/support/alloc.c", - "src/core/support/avl.c", - "src/core/support/block_annotate.h", - "src/core/support/cmdline.c", - "src/core/support/cpu_iphone.c", - "src/core/support/cpu_linux.c", - "src/core/support/cpu_posix.c", - "src/core/support/cpu_windows.c", - "src/core/support/env.h", - "src/core/support/env_linux.c", - "src/core/support/env_posix.c", - "src/core/support/env_win32.c", - "src/core/support/file.c", - "src/core/support/file.h", - "src/core/support/file_posix.c", - "src/core/support/file_win32.c", - "src/core/support/histogram.c", - "src/core/support/host_port.c", - "src/core/support/log.c", - "src/core/support/log_android.c", - "src/core/support/log_linux.c", - "src/core/support/log_posix.c", - "src/core/support/log_win32.c", - "src/core/support/murmur_hash.c", - "src/core/support/murmur_hash.h", - "src/core/support/slice.c", - "src/core/support/slice_buffer.c", - "src/core/support/stack_lockfree.c", - "src/core/support/stack_lockfree.h", - "src/core/support/string.c", - "src/core/support/string.h", - "src/core/support/string_posix.c", - "src/core/support/string_win32.c", - "src/core/support/string_win32.h", - "src/core/support/subprocess_posix.c", - "src/core/support/subprocess_windows.c", - "src/core/support/sync.c", - "src/core/support/sync_posix.c", - "src/core/support/sync_win32.c", - "src/core/support/thd.c", - "src/core/support/thd_internal.h", - "src/core/support/thd_posix.c", - "src/core/support/thd_win32.c", - "src/core/support/time.c", - "src/core/support/time_posix.c", - "src/core/support/time_precise.c", - "src/core/support/time_precise.h", - "src/core/support/time_win32.c", - "src/core/support/tls_pthread.c", - "src/core/support/wrap_memcpy.c" - ] + "test/core/bad_ssl/bad_ssl_test.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "gpr" + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], - "headers": [ - "test/core/util/test_config.h" + "headers": [], + "language": "c", + "name": "bad_ssl_cert_test", + "src": [ + "test/core/bad_ssl/bad_ssl_test.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], + "headers": [], "language": "c", - "name": "gpr_test_util", + "name": "h2_census_test", "src": [ - "test/core/util/test_config.c", - "test/core/util/test_config.h" - ] + "test/core/end2end/fixtures/h2_census.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "gpr" + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], - "headers": [ - "include/grpc/byte_buffer.h", - "include/grpc/byte_buffer_reader.h", - "include/grpc/census.h", - "include/grpc/compression.h", - "include/grpc/grpc.h", - "include/grpc/grpc_security.h", - "include/grpc/impl/codegen/byte_buffer.h", - "include/grpc/impl/codegen/compression_types.h", - "include/grpc/impl/codegen/connectivity_state.h", - "include/grpc/impl/codegen/grpc_types.h", - "include/grpc/impl/codegen/propagation_bits.h", - "include/grpc/impl/codegen/status.h", - "include/grpc/status.h", - "src/core/census/aggregation.h", - "src/core/census/grpc_filter.h", - "src/core/census/log.h", - "src/core/census/rpc_metric_id.h", - "src/core/channel/channel_args.h", - "src/core/channel/channel_stack.h", - "src/core/channel/client_channel.h", - "src/core/channel/client_uchannel.h", - "src/core/channel/compress_filter.h", - "src/core/channel/connected_channel.h", - "src/core/channel/context.h", - "src/core/channel/http_client_filter.h", - "src/core/channel/http_server_filter.h", - "src/core/channel/subchannel_call_holder.h", - "src/core/client_config/client_config.h", - "src/core/client_config/connector.h", - "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/pick_first.h", - "src/core/client_config/lb_policies/round_robin.h", - "src/core/client_config/lb_policy.h", - "src/core/client_config/lb_policy_factory.h", - "src/core/client_config/lb_policy_registry.h", - "src/core/client_config/resolver.h", - "src/core/client_config/resolver_factory.h", - "src/core/client_config/resolver_registry.h", - "src/core/client_config/resolvers/dns_resolver.h", - "src/core/client_config/resolvers/sockaddr_resolver.h", - "src/core/client_config/subchannel.h", - "src/core/client_config/subchannel_factory.h", - "src/core/client_config/subchannel_index.h", - "src/core/client_config/uri_parser.h", - "src/core/compression/algorithm_metadata.h", - "src/core/compression/message_compress.h", - "src/core/debug/trace.h", - "src/core/httpcli/format_request.h", - "src/core/httpcli/httpcli.h", - "src/core/httpcli/parser.h", - "src/core/iomgr/closure.h", - "src/core/iomgr/endpoint.h", - "src/core/iomgr/endpoint_pair.h", - "src/core/iomgr/exec_ctx.h", - "src/core/iomgr/executor.h", - "src/core/iomgr/fd_posix.h", - "src/core/iomgr/iocp_windows.h", - "src/core/iomgr/iomgr.h", - "src/core/iomgr/iomgr_internal.h", - "src/core/iomgr/iomgr_posix.h", - "src/core/iomgr/pollset.h", - "src/core/iomgr/pollset_posix.h", - "src/core/iomgr/pollset_set.h", - "src/core/iomgr/pollset_set_posix.h", - "src/core/iomgr/pollset_set_windows.h", - "src/core/iomgr/pollset_windows.h", - "src/core/iomgr/resolve_address.h", - "src/core/iomgr/sockaddr.h", - "src/core/iomgr/sockaddr_posix.h", - "src/core/iomgr/sockaddr_utils.h", - "src/core/iomgr/sockaddr_win32.h", - "src/core/iomgr/socket_utils_posix.h", - "src/core/iomgr/socket_windows.h", - "src/core/iomgr/tcp_client.h", - "src/core/iomgr/tcp_posix.h", - "src/core/iomgr/tcp_server.h", - "src/core/iomgr/tcp_windows.h", - "src/core/iomgr/time_averaged_stats.h", - "src/core/iomgr/timer.h", - "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", - "src/core/iomgr/udp_server.h", - "src/core/iomgr/wakeup_fd_pipe.h", - "src/core/iomgr/wakeup_fd_posix.h", - "src/core/iomgr/workqueue.h", - "src/core/iomgr/workqueue_posix.h", - "src/core/iomgr/workqueue_windows.h", - "src/core/json/json.h", - "src/core/json/json_common.h", - "src/core/json/json_reader.h", - "src/core/json/json_writer.h", - "src/core/security/auth_filters.h", - "src/core/security/base64.h", - "src/core/security/credentials.h", - "src/core/security/handshake.h", - "src/core/security/json_token.h", - "src/core/security/jwt_verifier.h", - "src/core/security/secure_endpoint.h", - "src/core/security/security_connector.h", - "src/core/security/security_context.h", - "src/core/statistics/census_interface.h", - "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.h", - "src/core/surface/call.h", - "src/core/surface/call_test_only.h", - "src/core/surface/channel.h", - "src/core/surface/completion_queue.h", - "src/core/surface/event_string.h", - "src/core/surface/init.h", - "src/core/surface/server.h", - "src/core/surface/surface_trace.h", - "src/core/transport/byte_stream.h", - "src/core/transport/chttp2/alpn.h", - "src/core/transport/chttp2/bin_encoder.h", - "src/core/transport/chttp2/frame.h", - "src/core/transport/chttp2/frame_data.h", - "src/core/transport/chttp2/frame_goaway.h", - "src/core/transport/chttp2/frame_ping.h", - "src/core/transport/chttp2/frame_rst_stream.h", - "src/core/transport/chttp2/frame_settings.h", - "src/core/transport/chttp2/frame_window_update.h", - "src/core/transport/chttp2/hpack_encoder.h", - "src/core/transport/chttp2/hpack_parser.h", - "src/core/transport/chttp2/hpack_table.h", - "src/core/transport/chttp2/http2_errors.h", - "src/core/transport/chttp2/huffsyms.h", - "src/core/transport/chttp2/incoming_metadata.h", - "src/core/transport/chttp2/internal.h", - "src/core/transport/chttp2/status_conversion.h", - "src/core/transport/chttp2/stream_map.h", - "src/core/transport/chttp2/timeout_encoding.h", - "src/core/transport/chttp2/varint.h", - "src/core/transport/chttp2_transport.h", - "src/core/transport/connectivity_state.h", - "src/core/transport/metadata.h", - "src/core/transport/metadata_batch.h", - "src/core/transport/static_metadata.h", - "src/core/transport/transport.h", - "src/core/transport/transport_impl.h", - "src/core/tsi/fake_transport_security.h", - "src/core/tsi/ssl_transport_security.h", - "src/core/tsi/ssl_types.h", - "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h" + "headers": [], + "language": "c", + "name": "h2_compress_test", + "src": [ + "test/core/end2end/fixtures/h2_compress.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], + "headers": [], "language": "c", - "name": "grpc", + "name": "h2_fakesec_test", "src": [ - "include/grpc/byte_buffer.h", - "include/grpc/byte_buffer_reader.h", - "include/grpc/census.h", - "include/grpc/compression.h", - "include/grpc/grpc.h", - "include/grpc/grpc_security.h", - "include/grpc/impl/codegen/byte_buffer.h", - "include/grpc/impl/codegen/compression_types.h", - "include/grpc/impl/codegen/connectivity_state.h", - "include/grpc/impl/codegen/grpc_types.h", - "include/grpc/impl/codegen/propagation_bits.h", - "include/grpc/impl/codegen/status.h", - "include/grpc/status.h", - "src/core/census/aggregation.h", - "src/core/census/context.c", - "src/core/census/grpc_context.c", - "src/core/census/grpc_filter.c", - "src/core/census/grpc_filter.h", - "src/core/census/initialize.c", - "src/core/census/log.c", - "src/core/census/log.h", - "src/core/census/operation.c", - "src/core/census/placeholders.c", - "src/core/census/rpc_metric_id.h", - "src/core/census/tracing.c", - "src/core/channel/channel_args.c", - "src/core/channel/channel_args.h", - "src/core/channel/channel_stack.c", - "src/core/channel/channel_stack.h", - "src/core/channel/client_channel.c", - "src/core/channel/client_channel.h", - "src/core/channel/client_uchannel.c", - "src/core/channel/client_uchannel.h", - "src/core/channel/compress_filter.c", - "src/core/channel/compress_filter.h", - "src/core/channel/connected_channel.c", - "src/core/channel/connected_channel.h", - "src/core/channel/context.h", - "src/core/channel/http_client_filter.c", - "src/core/channel/http_client_filter.h", - "src/core/channel/http_server_filter.c", - "src/core/channel/http_server_filter.h", - "src/core/channel/subchannel_call_holder.c", - "src/core/channel/subchannel_call_holder.h", - "src/core/client_config/client_config.c", - "src/core/client_config/client_config.h", - "src/core/client_config/connector.c", - "src/core/client_config/connector.h", - "src/core/client_config/default_initial_connect_string.c", - "src/core/client_config/initial_connect_string.c", - "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/pick_first.c", - "src/core/client_config/lb_policies/pick_first.h", - "src/core/client_config/lb_policies/round_robin.c", - "src/core/client_config/lb_policies/round_robin.h", - "src/core/client_config/lb_policy.c", - "src/core/client_config/lb_policy.h", - "src/core/client_config/lb_policy_factory.c", - "src/core/client_config/lb_policy_factory.h", - "src/core/client_config/lb_policy_registry.c", - "src/core/client_config/lb_policy_registry.h", - "src/core/client_config/resolver.c", - "src/core/client_config/resolver.h", - "src/core/client_config/resolver_factory.c", - "src/core/client_config/resolver_factory.h", - "src/core/client_config/resolver_registry.c", - "src/core/client_config/resolver_registry.h", - "src/core/client_config/resolvers/dns_resolver.c", - "src/core/client_config/resolvers/dns_resolver.h", - "src/core/client_config/resolvers/sockaddr_resolver.c", - "src/core/client_config/resolvers/sockaddr_resolver.h", - "src/core/client_config/subchannel.c", - "src/core/client_config/subchannel.h", - "src/core/client_config/subchannel_factory.c", - "src/core/client_config/subchannel_factory.h", - "src/core/client_config/subchannel_index.c", - "src/core/client_config/subchannel_index.h", - "src/core/client_config/uri_parser.c", - "src/core/client_config/uri_parser.h", - "src/core/compression/algorithm.c", - "src/core/compression/algorithm_metadata.h", - "src/core/compression/message_compress.c", - "src/core/compression/message_compress.h", - "src/core/debug/trace.c", - "src/core/debug/trace.h", - "src/core/httpcli/format_request.c", - "src/core/httpcli/format_request.h", - "src/core/httpcli/httpcli.c", - "src/core/httpcli/httpcli.h", - "src/core/httpcli/httpcli_security_connector.c", - "src/core/httpcli/parser.c", - "src/core/httpcli/parser.h", - "src/core/iomgr/closure.c", - "src/core/iomgr/closure.h", - "src/core/iomgr/endpoint.c", - "src/core/iomgr/endpoint.h", - "src/core/iomgr/endpoint_pair.h", - "src/core/iomgr/endpoint_pair_posix.c", - "src/core/iomgr/endpoint_pair_windows.c", - "src/core/iomgr/exec_ctx.c", - "src/core/iomgr/exec_ctx.h", - "src/core/iomgr/executor.c", - "src/core/iomgr/executor.h", - "src/core/iomgr/fd_posix.c", - "src/core/iomgr/fd_posix.h", - "src/core/iomgr/iocp_windows.c", - "src/core/iomgr/iocp_windows.h", - "src/core/iomgr/iomgr.c", - "src/core/iomgr/iomgr.h", - "src/core/iomgr/iomgr_internal.h", - "src/core/iomgr/iomgr_posix.c", - "src/core/iomgr/iomgr_posix.h", - "src/core/iomgr/iomgr_windows.c", - "src/core/iomgr/pollset.h", - "src/core/iomgr/pollset_multipoller_with_epoll.c", - "src/core/iomgr/pollset_multipoller_with_poll_posix.c", - "src/core/iomgr/pollset_posix.c", - "src/core/iomgr/pollset_posix.h", - "src/core/iomgr/pollset_set.h", - "src/core/iomgr/pollset_set_posix.c", - "src/core/iomgr/pollset_set_posix.h", - "src/core/iomgr/pollset_set_windows.c", - "src/core/iomgr/pollset_set_windows.h", - "src/core/iomgr/pollset_windows.c", - "src/core/iomgr/pollset_windows.h", - "src/core/iomgr/resolve_address.h", - "src/core/iomgr/resolve_address_posix.c", - "src/core/iomgr/resolve_address_windows.c", - "src/core/iomgr/sockaddr.h", - "src/core/iomgr/sockaddr_posix.h", - "src/core/iomgr/sockaddr_utils.c", - "src/core/iomgr/sockaddr_utils.h", - "src/core/iomgr/sockaddr_win32.h", - "src/core/iomgr/socket_utils_common_posix.c", - "src/core/iomgr/socket_utils_linux.c", - "src/core/iomgr/socket_utils_posix.c", - "src/core/iomgr/socket_utils_posix.h", - "src/core/iomgr/socket_windows.c", - "src/core/iomgr/socket_windows.h", - "src/core/iomgr/tcp_client.h", - "src/core/iomgr/tcp_client_posix.c", - "src/core/iomgr/tcp_client_windows.c", - "src/core/iomgr/tcp_posix.c", - "src/core/iomgr/tcp_posix.h", - "src/core/iomgr/tcp_server.h", - "src/core/iomgr/tcp_server_posix.c", - "src/core/iomgr/tcp_server_windows.c", - "src/core/iomgr/tcp_windows.c", - "src/core/iomgr/tcp_windows.h", - "src/core/iomgr/time_averaged_stats.c", - "src/core/iomgr/time_averaged_stats.h", - "src/core/iomgr/timer.c", - "src/core/iomgr/timer.h", - "src/core/iomgr/timer_heap.c", - "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", - "src/core/iomgr/udp_server.c", - "src/core/iomgr/udp_server.h", - "src/core/iomgr/wakeup_fd_eventfd.c", - "src/core/iomgr/wakeup_fd_nospecial.c", - "src/core/iomgr/wakeup_fd_pipe.c", - "src/core/iomgr/wakeup_fd_pipe.h", - "src/core/iomgr/wakeup_fd_posix.c", - "src/core/iomgr/wakeup_fd_posix.h", - "src/core/iomgr/workqueue.h", - "src/core/iomgr/workqueue_posix.c", - "src/core/iomgr/workqueue_posix.h", - "src/core/iomgr/workqueue_windows.c", - "src/core/iomgr/workqueue_windows.h", - "src/core/json/json.c", - "src/core/json/json.h", - "src/core/json/json_common.h", - "src/core/json/json_reader.c", - "src/core/json/json_reader.h", - "src/core/json/json_string.c", - "src/core/json/json_writer.c", - "src/core/json/json_writer.h", - "src/core/security/auth_filters.h", - "src/core/security/base64.c", - "src/core/security/base64.h", - "src/core/security/client_auth_filter.c", - "src/core/security/credentials.c", - "src/core/security/credentials.h", - "src/core/security/credentials_metadata.c", - "src/core/security/credentials_posix.c", - "src/core/security/credentials_win32.c", - "src/core/security/google_default_credentials.c", - "src/core/security/handshake.c", - "src/core/security/handshake.h", - "src/core/security/json_token.c", - "src/core/security/json_token.h", - "src/core/security/jwt_verifier.c", - "src/core/security/jwt_verifier.h", - "src/core/security/secure_endpoint.c", - "src/core/security/secure_endpoint.h", - "src/core/security/security_connector.c", - "src/core/security/security_connector.h", - "src/core/security/security_context.c", - "src/core/security/security_context.h", - "src/core/security/server_auth_filter.c", - "src/core/security/server_secure_chttp2.c", - "src/core/statistics/census_interface.h", - "src/core/statistics/census_rpc_stats.h", - "src/core/surface/alarm.c", - "src/core/surface/api_trace.c", - "src/core/surface/api_trace.h", - "src/core/surface/byte_buffer.c", - "src/core/surface/byte_buffer_reader.c", - "src/core/surface/call.c", - "src/core/surface/call.h", - "src/core/surface/call_details.c", - "src/core/surface/call_log_batch.c", - "src/core/surface/call_test_only.h", - "src/core/surface/channel.c", - "src/core/surface/channel.h", - "src/core/surface/channel_connectivity.c", - "src/core/surface/channel_create.c", - "src/core/surface/channel_ping.c", - "src/core/surface/completion_queue.c", - "src/core/surface/completion_queue.h", - "src/core/surface/event_string.c", - "src/core/surface/event_string.h", - "src/core/surface/init.c", - "src/core/surface/init.h", - "src/core/surface/init_secure.c", - "src/core/surface/lame_client.c", - "src/core/surface/metadata_array.c", - "src/core/surface/secure_channel_create.c", - "src/core/surface/server.c", - "src/core/surface/server.h", - "src/core/surface/server_chttp2.c", - "src/core/surface/server_create.c", - "src/core/surface/surface_trace.h", - "src/core/surface/validate_metadata.c", - "src/core/surface/version.c", - "src/core/transport/byte_stream.c", - "src/core/transport/byte_stream.h", - "src/core/transport/chttp2/alpn.c", - "src/core/transport/chttp2/alpn.h", - "src/core/transport/chttp2/bin_encoder.c", - "src/core/transport/chttp2/bin_encoder.h", - "src/core/transport/chttp2/frame.h", - "src/core/transport/chttp2/frame_data.c", - "src/core/transport/chttp2/frame_data.h", - "src/core/transport/chttp2/frame_goaway.c", - "src/core/transport/chttp2/frame_goaway.h", - "src/core/transport/chttp2/frame_ping.c", - "src/core/transport/chttp2/frame_ping.h", - "src/core/transport/chttp2/frame_rst_stream.c", - "src/core/transport/chttp2/frame_rst_stream.h", - "src/core/transport/chttp2/frame_settings.c", - "src/core/transport/chttp2/frame_settings.h", - "src/core/transport/chttp2/frame_window_update.c", - "src/core/transport/chttp2/frame_window_update.h", - "src/core/transport/chttp2/hpack_encoder.c", - "src/core/transport/chttp2/hpack_encoder.h", - "src/core/transport/chttp2/hpack_parser.c", - "src/core/transport/chttp2/hpack_parser.h", - "src/core/transport/chttp2/hpack_table.c", - "src/core/transport/chttp2/hpack_table.h", - "src/core/transport/chttp2/http2_errors.h", - "src/core/transport/chttp2/huffsyms.c", - "src/core/transport/chttp2/huffsyms.h", - "src/core/transport/chttp2/incoming_metadata.c", - "src/core/transport/chttp2/incoming_metadata.h", - "src/core/transport/chttp2/internal.h", - "src/core/transport/chttp2/parsing.c", - "src/core/transport/chttp2/status_conversion.c", - "src/core/transport/chttp2/status_conversion.h", - "src/core/transport/chttp2/stream_lists.c", - "src/core/transport/chttp2/stream_map.c", - "src/core/transport/chttp2/stream_map.h", - "src/core/transport/chttp2/timeout_encoding.c", - "src/core/transport/chttp2/timeout_encoding.h", - "src/core/transport/chttp2/varint.c", - "src/core/transport/chttp2/varint.h", - "src/core/transport/chttp2/writing.c", - "src/core/transport/chttp2_transport.c", - "src/core/transport/chttp2_transport.h", - "src/core/transport/connectivity_state.c", - "src/core/transport/connectivity_state.h", - "src/core/transport/metadata.c", - "src/core/transport/metadata.h", - "src/core/transport/metadata_batch.c", - "src/core/transport/metadata_batch.h", - "src/core/transport/static_metadata.c", - "src/core/transport/static_metadata.h", - "src/core/transport/transport.c", - "src/core/transport/transport.h", - "src/core/transport/transport_impl.h", - "src/core/transport/transport_op_string.c", - "src/core/tsi/fake_transport_security.c", - "src/core/tsi/fake_transport_security.h", - "src/core/tsi/ssl_transport_security.c", - "src/core/tsi/ssl_transport_security.h", - "src/core/tsi/ssl_types.h", - "src/core/tsi/transport_security.c", - "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h" - ] + "test/core/end2end/fixtures/h2_fakesec.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ + "end2end_certs", + "end2end_tests", "gpr", - "grpc" + "gpr_test_util", + "grpc", + "grpc_test_util" ], "headers": [], "language": "c", - "name": "grpc_dll", - "src": [] + "name": "h2_full_test", + "src": [ + "test/core/end2end/fixtures/h2_full.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ + "end2end_certs", + "end2end_tests", "gpr", "gpr_test_util", - "grpc" + "grpc", + "grpc_test_util" ], - "headers": [ - "test/core/end2end/cq_verifier.h", - "test/core/end2end/data/ssl_test_data.h", - "test/core/end2end/fixtures/proxy.h", - "test/core/iomgr/endpoint_tests.h", - "test/core/security/oauth2_utils.h", - "test/core/util/grpc_profiler.h", - "test/core/util/parse_hexstring.h", - "test/core/util/port.h", - "test/core/util/slice_splitter.h" + "headers": [], + "language": "c", + "name": "h2_full+pipe_test", + "src": [ + "test/core/end2end/fixtures/h2_full+pipe.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], + "headers": [], "language": "c", - "name": "grpc_test_util", + "name": "h2_full+poll_test", "src": [ - "test/core/end2end/cq_verifier.c", - "test/core/end2end/cq_verifier.h", - "test/core/end2end/data/server1_cert.c", - "test/core/end2end/data/server1_key.c", - "test/core/end2end/data/ssl_test_data.h", - "test/core/end2end/data/test_root_cert.c", - "test/core/end2end/fixtures/proxy.c", - "test/core/end2end/fixtures/proxy.h", - "test/core/iomgr/endpoint_tests.c", - "test/core/iomgr/endpoint_tests.h", - "test/core/security/oauth2_utils.c", - "test/core/security/oauth2_utils.h", - "test/core/util/grpc_profiler.c", - "test/core/util/grpc_profiler.h", - "test/core/util/parse_hexstring.c", - "test/core/util/parse_hexstring.h", - "test/core/util/port.h", - "test/core/util/port_posix.c", - "test/core/util/port_windows.c", - "test/core/util/slice_splitter.c", - "test/core/util/slice_splitter.h" - ] + "test/core/end2end/fixtures/h2_full+poll.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ + "end2end_certs", + "end2end_tests", "gpr", "gpr_test_util", - "grpc_unsecure" + "grpc", + "grpc_test_util" ], - "headers": [ - "test/core/end2end/cq_verifier.h", - "test/core/end2end/fixtures/proxy.h", - "test/core/iomgr/endpoint_tests.h", - "test/core/util/grpc_profiler.h", - "test/core/util/parse_hexstring.h", - "test/core/util/port.h", - "test/core/util/slice_splitter.h" + "headers": [], + "language": "c", + "name": "h2_full+poll+pipe_test", + "src": [ + "test/core/end2end/fixtures/h2_full+poll+pipe.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], + "headers": [], "language": "c", - "name": "grpc_test_util_unsecure", + "name": "h2_oauth2_test", "src": [ - "test/core/end2end/cq_verifier.c", - "test/core/end2end/cq_verifier.h", - "test/core/end2end/fixtures/proxy.c", - "test/core/end2end/fixtures/proxy.h", - "test/core/iomgr/endpoint_tests.c", - "test/core/iomgr/endpoint_tests.h", - "test/core/util/grpc_profiler.c", - "test/core/util/grpc_profiler.h", - "test/core/util/parse_hexstring.c", - "test/core/util/parse_hexstring.h", - "test/core/util/port.h", - "test/core/util/port_posix.c", - "test/core/util/port_windows.c", - "test/core/util/slice_splitter.c", - "test/core/util/slice_splitter.h" - ] + "test/core/end2end/fixtures/h2_oauth2.c" + ], + "third_party": false, + "type": "target" }, { "deps": [ - "gpr" + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], - "headers": [ - "include/grpc/byte_buffer.h", - "include/grpc/byte_buffer_reader.h", - "include/grpc/census.h", - "include/grpc/compression.h", - "include/grpc/grpc.h", - "include/grpc/impl/codegen/byte_buffer.h", - "include/grpc/impl/codegen/compression_types.h", - "include/grpc/impl/codegen/connectivity_state.h", - "include/grpc/impl/codegen/grpc_types.h", - "include/grpc/impl/codegen/propagation_bits.h", - "include/grpc/impl/codegen/status.h", - "include/grpc/status.h", - "src/core/census/aggregation.h", - "src/core/census/grpc_filter.h", - "src/core/census/log.h", - "src/core/census/rpc_metric_id.h", - "src/core/channel/channel_args.h", - "src/core/channel/channel_stack.h", - "src/core/channel/client_channel.h", - "src/core/channel/client_uchannel.h", - "src/core/channel/compress_filter.h", - "src/core/channel/connected_channel.h", - "src/core/channel/context.h", - "src/core/channel/http_client_filter.h", - "src/core/channel/http_server_filter.h", - "src/core/channel/subchannel_call_holder.h", - "src/core/client_config/client_config.h", - "src/core/client_config/connector.h", - "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/pick_first.h", - "src/core/client_config/lb_policies/round_robin.h", - "src/core/client_config/lb_policy.h", - "src/core/client_config/lb_policy_factory.h", - "src/core/client_config/lb_policy_registry.h", - "src/core/client_config/resolver.h", - "src/core/client_config/resolver_factory.h", - "src/core/client_config/resolver_registry.h", - "src/core/client_config/resolvers/dns_resolver.h", - "src/core/client_config/resolvers/sockaddr_resolver.h", - "src/core/client_config/subchannel.h", - "src/core/client_config/subchannel_factory.h", - "src/core/client_config/subchannel_index.h", - "src/core/client_config/uri_parser.h", - "src/core/compression/algorithm_metadata.h", - "src/core/compression/message_compress.h", - "src/core/debug/trace.h", - "src/core/httpcli/format_request.h", - "src/core/httpcli/httpcli.h", - "src/core/httpcli/parser.h", - "src/core/iomgr/closure.h", - "src/core/iomgr/endpoint.h", - "src/core/iomgr/endpoint_pair.h", - "src/core/iomgr/exec_ctx.h", - "src/core/iomgr/executor.h", - "src/core/iomgr/fd_posix.h", - "src/core/iomgr/iocp_windows.h", - "src/core/iomgr/iomgr.h", - "src/core/iomgr/iomgr_internal.h", - "src/core/iomgr/iomgr_posix.h", - "src/core/iomgr/pollset.h", - "src/core/iomgr/pollset_posix.h", - "src/core/iomgr/pollset_set.h", - "src/core/iomgr/pollset_set_posix.h", - "src/core/iomgr/pollset_set_windows.h", - "src/core/iomgr/pollset_windows.h", - "src/core/iomgr/resolve_address.h", - "src/core/iomgr/sockaddr.h", - "src/core/iomgr/sockaddr_posix.h", - "src/core/iomgr/sockaddr_utils.h", - "src/core/iomgr/sockaddr_win32.h", - "src/core/iomgr/socket_utils_posix.h", - "src/core/iomgr/socket_windows.h", - "src/core/iomgr/tcp_client.h", - "src/core/iomgr/tcp_posix.h", - "src/core/iomgr/tcp_server.h", - "src/core/iomgr/tcp_windows.h", - "src/core/iomgr/time_averaged_stats.h", - "src/core/iomgr/timer.h", - "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", - "src/core/iomgr/udp_server.h", - "src/core/iomgr/wakeup_fd_pipe.h", - "src/core/iomgr/wakeup_fd_posix.h", - "src/core/iomgr/workqueue.h", - "src/core/iomgr/workqueue_posix.h", - "src/core/iomgr/workqueue_windows.h", - "src/core/json/json.h", - "src/core/json/json_common.h", - "src/core/json/json_reader.h", - "src/core/json/json_writer.h", - "src/core/statistics/census_interface.h", - "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.h", - "src/core/surface/call.h", - "src/core/surface/call_test_only.h", - "src/core/surface/channel.h", - "src/core/surface/completion_queue.h", - "src/core/surface/event_string.h", - "src/core/surface/init.h", - "src/core/surface/server.h", - "src/core/surface/surface_trace.h", - "src/core/transport/byte_stream.h", - "src/core/transport/chttp2/alpn.h", - "src/core/transport/chttp2/bin_encoder.h", - "src/core/transport/chttp2/frame.h", - "src/core/transport/chttp2/frame_data.h", - "src/core/transport/chttp2/frame_goaway.h", - "src/core/transport/chttp2/frame_ping.h", - "src/core/transport/chttp2/frame_rst_stream.h", - "src/core/transport/chttp2/frame_settings.h", - "src/core/transport/chttp2/frame_window_update.h", - "src/core/transport/chttp2/hpack_encoder.h", - "src/core/transport/chttp2/hpack_parser.h", - "src/core/transport/chttp2/hpack_table.h", - "src/core/transport/chttp2/http2_errors.h", - "src/core/transport/chttp2/huffsyms.h", - "src/core/transport/chttp2/incoming_metadata.h", - "src/core/transport/chttp2/internal.h", - "src/core/transport/chttp2/status_conversion.h", - "src/core/transport/chttp2/stream_map.h", - "src/core/transport/chttp2/timeout_encoding.h", - "src/core/transport/chttp2/varint.h", - "src/core/transport/chttp2_transport.h", - "src/core/transport/connectivity_state.h", - "src/core/transport/metadata.h", - "src/core/transport/metadata_batch.h", - "src/core/transport/static_metadata.h", - "src/core/transport/transport.h", - "src/core/transport/transport_impl.h" + "headers": [], + "language": "c", + "name": "h2_proxy_test", + "src": [ + "test/core/end2end/fixtures/h2_proxy.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" ], + "headers": [], "language": "c", - "name": "grpc_unsecure", + "name": "h2_sockpair_test", "src": [ - "include/grpc/byte_buffer.h", - "include/grpc/byte_buffer_reader.h", - "include/grpc/census.h", - "include/grpc/compression.h", - "include/grpc/grpc.h", - "include/grpc/impl/codegen/byte_buffer.h", + "test/core/end2end/fixtures/h2_sockpair.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_sockpair+trace_test", + "src": [ + "test/core/end2end/fixtures/h2_sockpair+trace.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_sockpair_1byte_test", + "src": [ + "test/core/end2end/fixtures/h2_sockpair_1byte.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_ssl_test", + "src": [ + "test/core/end2end/fixtures/h2_ssl.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_ssl+poll_test", + "src": [ + "test/core/end2end/fixtures/h2_ssl+poll.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_ssl_proxy_test", + "src": [ + "test/core/end2end/fixtures/h2_ssl_proxy.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_uchannel_test", + "src": [ + "test/core/end2end/fixtures/h2_uchannel.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_uds_test", + "src": [ + "test/core/end2end/fixtures/h2_uds.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_certs", + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_uds+poll_test", + "src": [ + "test/core/end2end/fixtures/h2_uds+poll.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_census_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_census.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_compress_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_compress.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_full_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_full.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_full+pipe_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_full+pipe.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_full+poll_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_full+poll.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_full+poll+pipe_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_full+poll+pipe.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_proxy_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_proxy.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_sockpair_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_sockpair.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_sockpair+trace_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_sockpair+trace.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_sockpair_1byte_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_sockpair_1byte.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_uchannel_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_uchannel.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_uds_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_uds.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_uds+poll_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_uds+poll.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [], + "headers": [ + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", + "include/grpc/support/alloc.h", + "include/grpc/support/atm.h", + "include/grpc/support/atm_gcc_atomic.h", + "include/grpc/support/atm_gcc_sync.h", + "include/grpc/support/atm_win32.h", + "include/grpc/support/avl.h", + "include/grpc/support/cmdline.h", + "include/grpc/support/cpu.h", + "include/grpc/support/histogram.h", + "include/grpc/support/host_port.h", + "include/grpc/support/log.h", + "include/grpc/support/log_win32.h", + "include/grpc/support/port_platform.h", + "include/grpc/support/slice.h", + "include/grpc/support/slice_buffer.h", + "include/grpc/support/string_util.h", + "include/grpc/support/subprocess.h", + "include/grpc/support/sync.h", + "include/grpc/support/sync_generic.h", + "include/grpc/support/sync_posix.h", + "include/grpc/support/sync_win32.h", + "include/grpc/support/thd.h", + "include/grpc/support/time.h", + "include/grpc/support/tls.h", + "include/grpc/support/tls_gcc.h", + "include/grpc/support/tls_msvc.h", + "include/grpc/support/tls_pthread.h", + "include/grpc/support/useful.h", + "src/core/profiling/timers.h", + "src/core/support/block_annotate.h", + "src/core/support/env.h", + "src/core/support/load_file.h", + "src/core/support/murmur_hash.h", + "src/core/support/stack_lockfree.h", + "src/core/support/string.h", + "src/core/support/string_win32.h", + "src/core/support/thd_internal.h", + "src/core/support/time_precise.h", + "src/core/support/tmpfile.h" + ], + "language": "c", + "name": "gpr", + "src": [ + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", + "include/grpc/support/alloc.h", + "include/grpc/support/atm.h", + "include/grpc/support/atm_gcc_atomic.h", + "include/grpc/support/atm_gcc_sync.h", + "include/grpc/support/atm_win32.h", + "include/grpc/support/avl.h", + "include/grpc/support/cmdline.h", + "include/grpc/support/cpu.h", + "include/grpc/support/histogram.h", + "include/grpc/support/host_port.h", + "include/grpc/support/log.h", + "include/grpc/support/log_win32.h", + "include/grpc/support/port_platform.h", + "include/grpc/support/slice.h", + "include/grpc/support/slice_buffer.h", + "include/grpc/support/string_util.h", + "include/grpc/support/subprocess.h", + "include/grpc/support/sync.h", + "include/grpc/support/sync_generic.h", + "include/grpc/support/sync_posix.h", + "include/grpc/support/sync_win32.h", + "include/grpc/support/thd.h", + "include/grpc/support/time.h", + "include/grpc/support/tls.h", + "include/grpc/support/tls_gcc.h", + "include/grpc/support/tls_msvc.h", + "include/grpc/support/tls_pthread.h", + "include/grpc/support/useful.h", + "src/core/profiling/basic_timers.c", + "src/core/profiling/stap_timers.c", + "src/core/profiling/timers.h", + "src/core/support/alloc.c", + "src/core/support/avl.c", + "src/core/support/block_annotate.h", + "src/core/support/cmdline.c", + "src/core/support/cpu_iphone.c", + "src/core/support/cpu_linux.c", + "src/core/support/cpu_posix.c", + "src/core/support/cpu_windows.c", + "src/core/support/env.h", + "src/core/support/env_linux.c", + "src/core/support/env_posix.c", + "src/core/support/env_win32.c", + "src/core/support/histogram.c", + "src/core/support/host_port.c", + "src/core/support/load_file.c", + "src/core/support/load_file.h", + "src/core/support/log.c", + "src/core/support/log_android.c", + "src/core/support/log_linux.c", + "src/core/support/log_posix.c", + "src/core/support/log_win32.c", + "src/core/support/murmur_hash.c", + "src/core/support/murmur_hash.h", + "src/core/support/slice.c", + "src/core/support/slice_buffer.c", + "src/core/support/stack_lockfree.c", + "src/core/support/stack_lockfree.h", + "src/core/support/string.c", + "src/core/support/string.h", + "src/core/support/string_posix.c", + "src/core/support/string_win32.c", + "src/core/support/string_win32.h", + "src/core/support/subprocess_posix.c", + "src/core/support/subprocess_windows.c", + "src/core/support/sync.c", + "src/core/support/sync_posix.c", + "src/core/support/sync_win32.c", + "src/core/support/thd.c", + "src/core/support/thd_internal.h", + "src/core/support/thd_posix.c", + "src/core/support/thd_win32.c", + "src/core/support/time.c", + "src/core/support/time_posix.c", + "src/core/support/time_precise.c", + "src/core/support/time_precise.h", + "src/core/support/time_win32.c", + "src/core/support/tls_pthread.c", + "src/core/support/tmpfile.h", + "src/core/support/tmpfile_posix.c", + "src/core/support/tmpfile_win32.c", + "src/core/support/wrap_memcpy.c" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr" + ], + "headers": [ + "test/core/util/test_config.h" + ], + "language": "c", + "name": "gpr_test_util", + "src": [ + "test/core/util/test_config.c", + "test/core/util/test_config.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr" + ], + "headers": [ + "include/grpc/byte_buffer.h", + "include/grpc/byte_buffer_reader.h", + "include/grpc/census.h", + "include/grpc/compression.h", + "include/grpc/grpc.h", + "include/grpc/grpc_security.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/status.h", + "src/core/census/aggregation.h", + "src/core/census/grpc_filter.h", + "src/core/census/mlog.h", + "src/core/census/rpc_metric_id.h", + "src/core/channel/channel_args.h", + "src/core/channel/channel_stack.h", + "src/core/channel/client_channel.h", + "src/core/channel/client_uchannel.h", + "src/core/channel/compress_filter.h", + "src/core/channel/connected_channel.h", + "src/core/channel/context.h", + "src/core/channel/http_client_filter.h", + "src/core/channel/http_server_filter.h", + "src/core/channel/subchannel_call_holder.h", + "src/core/client_config/client_config.h", + "src/core/client_config/connector.h", + "src/core/client_config/initial_connect_string.h", + "src/core/client_config/lb_policies/pick_first.h", + "src/core/client_config/lb_policies/round_robin.h", + "src/core/client_config/lb_policy.h", + "src/core/client_config/lb_policy_factory.h", + "src/core/client_config/lb_policy_registry.h", + "src/core/client_config/resolver.h", + "src/core/client_config/resolver_factory.h", + "src/core/client_config/resolver_registry.h", + "src/core/client_config/resolvers/dns_resolver.h", + "src/core/client_config/resolvers/sockaddr_resolver.h", + "src/core/client_config/subchannel.h", + "src/core/client_config/subchannel_factory.h", + "src/core/client_config/subchannel_index.h", + "src/core/client_config/uri_parser.h", + "src/core/compression/algorithm_metadata.h", + "src/core/compression/message_compress.h", + "src/core/debug/trace.h", + "src/core/httpcli/format_request.h", + "src/core/httpcli/httpcli.h", + "src/core/httpcli/parser.h", + "src/core/iomgr/closure.h", + "src/core/iomgr/endpoint.h", + "src/core/iomgr/endpoint_pair.h", + "src/core/iomgr/exec_ctx.h", + "src/core/iomgr/executor.h", + "src/core/iomgr/fd_posix.h", + "src/core/iomgr/iocp_windows.h", + "src/core/iomgr/iomgr.h", + "src/core/iomgr/iomgr_internal.h", + "src/core/iomgr/iomgr_posix.h", + "src/core/iomgr/pollset.h", + "src/core/iomgr/pollset_posix.h", + "src/core/iomgr/pollset_set.h", + "src/core/iomgr/pollset_set_posix.h", + "src/core/iomgr/pollset_set_windows.h", + "src/core/iomgr/pollset_windows.h", + "src/core/iomgr/resolve_address.h", + "src/core/iomgr/sockaddr.h", + "src/core/iomgr/sockaddr_posix.h", + "src/core/iomgr/sockaddr_utils.h", + "src/core/iomgr/sockaddr_win32.h", + "src/core/iomgr/socket_utils_posix.h", + "src/core/iomgr/socket_windows.h", + "src/core/iomgr/tcp_client.h", + "src/core/iomgr/tcp_posix.h", + "src/core/iomgr/tcp_server.h", + "src/core/iomgr/tcp_windows.h", + "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/timer.h", + "src/core/iomgr/timer_heap.h", + "src/core/iomgr/timer_internal.h", + "src/core/iomgr/udp_server.h", + "src/core/iomgr/wakeup_fd_pipe.h", + "src/core/iomgr/wakeup_fd_posix.h", + "src/core/iomgr/workqueue.h", + "src/core/iomgr/workqueue_posix.h", + "src/core/iomgr/workqueue_windows.h", + "src/core/json/json.h", + "src/core/json/json_common.h", + "src/core/json/json_reader.h", + "src/core/json/json_writer.h", + "src/core/security/auth_filters.h", + "src/core/security/b64.h", + "src/core/security/credentials.h", + "src/core/security/handshake.h", + "src/core/security/json_token.h", + "src/core/security/jwt_verifier.h", + "src/core/security/secure_endpoint.h", + "src/core/security/security_connector.h", + "src/core/security/security_context.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", + "src/core/surface/call.h", + "src/core/surface/call_test_only.h", + "src/core/surface/channel.h", + "src/core/surface/completion_queue.h", + "src/core/surface/event_string.h", + "src/core/surface/init.h", + "src/core/surface/server.h", + "src/core/surface/surface_trace.h", + "src/core/transport/byte_stream.h", + "src/core/transport/chttp2/alpn.h", + "src/core/transport/chttp2/bin_encoder.h", + "src/core/transport/chttp2/frame.h", + "src/core/transport/chttp2/frame_data.h", + "src/core/transport/chttp2/frame_goaway.h", + "src/core/transport/chttp2/frame_ping.h", + "src/core/transport/chttp2/frame_rst_stream.h", + "src/core/transport/chttp2/frame_settings.h", + "src/core/transport/chttp2/frame_window_update.h", + "src/core/transport/chttp2/hpack_encoder.h", + "src/core/transport/chttp2/hpack_parser.h", + "src/core/transport/chttp2/hpack_table.h", + "src/core/transport/chttp2/http2_errors.h", + "src/core/transport/chttp2/huffsyms.h", + "src/core/transport/chttp2/incoming_metadata.h", + "src/core/transport/chttp2/internal.h", + "src/core/transport/chttp2/status_conversion.h", + "src/core/transport/chttp2/stream_map.h", + "src/core/transport/chttp2/timeout_encoding.h", + "src/core/transport/chttp2/varint.h", + "src/core/transport/chttp2_transport.h", + "src/core/transport/connectivity_state.h", + "src/core/transport/metadata.h", + "src/core/transport/metadata_batch.h", + "src/core/transport/static_metadata.h", + "src/core/transport/transport.h", + "src/core/transport/transport_impl.h", + "src/core/tsi/fake_transport_security.h", + "src/core/tsi/ssl_transport_security.h", + "src/core/tsi/ssl_types.h", + "src/core/tsi/transport_security.h", + "src/core/tsi/transport_security_interface.h" + ], + "language": "c", + "name": "grpc", + "src": [ + "include/grpc/byte_buffer.h", + "include/grpc/byte_buffer_reader.h", + "include/grpc/census.h", + "include/grpc/compression.h", + "include/grpc/grpc.h", + "include/grpc/grpc_security.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/status.h", + "src/core/census/aggregation.h", + "src/core/census/context.c", + "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", + "src/core/census/grpc_filter.h", + "src/core/census/initialize.c", + "src/core/census/mlog.c", + "src/core/census/mlog.h", + "src/core/census/operation.c", + "src/core/census/placeholders.c", + "src/core/census/rpc_metric_id.h", + "src/core/census/tracing.c", + "src/core/channel/channel_args.c", + "src/core/channel/channel_args.h", + "src/core/channel/channel_stack.c", + "src/core/channel/channel_stack.h", + "src/core/channel/client_channel.c", + "src/core/channel/client_channel.h", + "src/core/channel/client_uchannel.c", + "src/core/channel/client_uchannel.h", + "src/core/channel/compress_filter.c", + "src/core/channel/compress_filter.h", + "src/core/channel/connected_channel.c", + "src/core/channel/connected_channel.h", + "src/core/channel/context.h", + "src/core/channel/http_client_filter.c", + "src/core/channel/http_client_filter.h", + "src/core/channel/http_server_filter.c", + "src/core/channel/http_server_filter.h", + "src/core/channel/subchannel_call_holder.c", + "src/core/channel/subchannel_call_holder.h", + "src/core/client_config/client_config.c", + "src/core/client_config/client_config.h", + "src/core/client_config/connector.c", + "src/core/client_config/connector.h", + "src/core/client_config/default_initial_connect_string.c", + "src/core/client_config/initial_connect_string.c", + "src/core/client_config/initial_connect_string.h", + "src/core/client_config/lb_policies/pick_first.c", + "src/core/client_config/lb_policies/pick_first.h", + "src/core/client_config/lb_policies/round_robin.c", + "src/core/client_config/lb_policies/round_robin.h", + "src/core/client_config/lb_policy.c", + "src/core/client_config/lb_policy.h", + "src/core/client_config/lb_policy_factory.c", + "src/core/client_config/lb_policy_factory.h", + "src/core/client_config/lb_policy_registry.c", + "src/core/client_config/lb_policy_registry.h", + "src/core/client_config/resolver.c", + "src/core/client_config/resolver.h", + "src/core/client_config/resolver_factory.c", + "src/core/client_config/resolver_factory.h", + "src/core/client_config/resolver_registry.c", + "src/core/client_config/resolver_registry.h", + "src/core/client_config/resolvers/dns_resolver.c", + "src/core/client_config/resolvers/dns_resolver.h", + "src/core/client_config/resolvers/sockaddr_resolver.c", + "src/core/client_config/resolvers/sockaddr_resolver.h", + "src/core/client_config/subchannel.c", + "src/core/client_config/subchannel.h", + "src/core/client_config/subchannel_factory.c", + "src/core/client_config/subchannel_factory.h", + "src/core/client_config/subchannel_index.c", + "src/core/client_config/subchannel_index.h", + "src/core/client_config/uri_parser.c", + "src/core/client_config/uri_parser.h", + "src/core/compression/algorithm_metadata.h", + "src/core/compression/compression_algorithm.c", + "src/core/compression/message_compress.c", + "src/core/compression/message_compress.h", + "src/core/debug/trace.c", + "src/core/debug/trace.h", + "src/core/httpcli/format_request.c", + "src/core/httpcli/format_request.h", + "src/core/httpcli/httpcli.c", + "src/core/httpcli/httpcli.h", + "src/core/httpcli/httpcli_security_connector.c", + "src/core/httpcli/parser.c", + "src/core/httpcli/parser.h", + "src/core/iomgr/closure.c", + "src/core/iomgr/closure.h", + "src/core/iomgr/endpoint.c", + "src/core/iomgr/endpoint.h", + "src/core/iomgr/endpoint_pair.h", + "src/core/iomgr/endpoint_pair_posix.c", + "src/core/iomgr/endpoint_pair_windows.c", + "src/core/iomgr/exec_ctx.c", + "src/core/iomgr/exec_ctx.h", + "src/core/iomgr/executor.c", + "src/core/iomgr/executor.h", + "src/core/iomgr/fd_posix.c", + "src/core/iomgr/fd_posix.h", + "src/core/iomgr/iocp_windows.c", + "src/core/iomgr/iocp_windows.h", + "src/core/iomgr/iomgr.c", + "src/core/iomgr/iomgr.h", + "src/core/iomgr/iomgr_internal.h", + "src/core/iomgr/iomgr_posix.c", + "src/core/iomgr/iomgr_posix.h", + "src/core/iomgr/iomgr_windows.c", + "src/core/iomgr/pollset.h", + "src/core/iomgr/pollset_multipoller_with_epoll.c", + "src/core/iomgr/pollset_multipoller_with_poll_posix.c", + "src/core/iomgr/pollset_posix.c", + "src/core/iomgr/pollset_posix.h", + "src/core/iomgr/pollset_set.h", + "src/core/iomgr/pollset_set_posix.c", + "src/core/iomgr/pollset_set_posix.h", + "src/core/iomgr/pollset_set_windows.c", + "src/core/iomgr/pollset_set_windows.h", + "src/core/iomgr/pollset_windows.c", + "src/core/iomgr/pollset_windows.h", + "src/core/iomgr/resolve_address.h", + "src/core/iomgr/resolve_address_posix.c", + "src/core/iomgr/resolve_address_windows.c", + "src/core/iomgr/sockaddr.h", + "src/core/iomgr/sockaddr_posix.h", + "src/core/iomgr/sockaddr_utils.c", + "src/core/iomgr/sockaddr_utils.h", + "src/core/iomgr/sockaddr_win32.h", + "src/core/iomgr/socket_utils_common_posix.c", + "src/core/iomgr/socket_utils_linux.c", + "src/core/iomgr/socket_utils_posix.c", + "src/core/iomgr/socket_utils_posix.h", + "src/core/iomgr/socket_windows.c", + "src/core/iomgr/socket_windows.h", + "src/core/iomgr/tcp_client.h", + "src/core/iomgr/tcp_client_posix.c", + "src/core/iomgr/tcp_client_windows.c", + "src/core/iomgr/tcp_posix.c", + "src/core/iomgr/tcp_posix.h", + "src/core/iomgr/tcp_server.h", + "src/core/iomgr/tcp_server_posix.c", + "src/core/iomgr/tcp_server_windows.c", + "src/core/iomgr/tcp_windows.c", + "src/core/iomgr/tcp_windows.h", + "src/core/iomgr/time_averaged_stats.c", + "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/timer.c", + "src/core/iomgr/timer.h", + "src/core/iomgr/timer_heap.c", + "src/core/iomgr/timer_heap.h", + "src/core/iomgr/timer_internal.h", + "src/core/iomgr/udp_server.c", + "src/core/iomgr/udp_server.h", + "src/core/iomgr/wakeup_fd_eventfd.c", + "src/core/iomgr/wakeup_fd_nospecial.c", + "src/core/iomgr/wakeup_fd_pipe.c", + "src/core/iomgr/wakeup_fd_pipe.h", + "src/core/iomgr/wakeup_fd_posix.c", + "src/core/iomgr/wakeup_fd_posix.h", + "src/core/iomgr/workqueue.h", + "src/core/iomgr/workqueue_posix.c", + "src/core/iomgr/workqueue_posix.h", + "src/core/iomgr/workqueue_windows.c", + "src/core/iomgr/workqueue_windows.h", + "src/core/json/json.c", + "src/core/json/json.h", + "src/core/json/json_common.h", + "src/core/json/json_reader.c", + "src/core/json/json_reader.h", + "src/core/json/json_string.c", + "src/core/json/json_writer.c", + "src/core/json/json_writer.h", + "src/core/security/auth_filters.h", + "src/core/security/b64.c", + "src/core/security/b64.h", + "src/core/security/client_auth_filter.c", + "src/core/security/credentials.c", + "src/core/security/credentials.h", + "src/core/security/credentials_metadata.c", + "src/core/security/credentials_posix.c", + "src/core/security/credentials_win32.c", + "src/core/security/google_default_credentials.c", + "src/core/security/handshake.c", + "src/core/security/handshake.h", + "src/core/security/json_token.c", + "src/core/security/json_token.h", + "src/core/security/jwt_verifier.c", + "src/core/security/jwt_verifier.h", + "src/core/security/secure_endpoint.c", + "src/core/security/secure_endpoint.h", + "src/core/security/security_connector.c", + "src/core/security/security_connector.h", + "src/core/security/security_context.c", + "src/core/security/security_context.h", + "src/core/security/server_auth_filter.c", + "src/core/security/server_secure_chttp2.c", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", + "src/core/surface/alarm.c", + "src/core/surface/api_trace.c", + "src/core/surface/api_trace.h", + "src/core/surface/byte_buffer.c", + "src/core/surface/byte_buffer_reader.c", + "src/core/surface/call.c", + "src/core/surface/call.h", + "src/core/surface/call_details.c", + "src/core/surface/call_log_batch.c", + "src/core/surface/call_test_only.h", + "src/core/surface/channel.c", + "src/core/surface/channel.h", + "src/core/surface/channel_connectivity.c", + "src/core/surface/channel_create.c", + "src/core/surface/channel_ping.c", + "src/core/surface/completion_queue.c", + "src/core/surface/completion_queue.h", + "src/core/surface/event_string.c", + "src/core/surface/event_string.h", + "src/core/surface/init.c", + "src/core/surface/init.h", + "src/core/surface/init_secure.c", + "src/core/surface/lame_client.c", + "src/core/surface/metadata_array.c", + "src/core/surface/secure_channel_create.c", + "src/core/surface/server.c", + "src/core/surface/server.h", + "src/core/surface/server_chttp2.c", + "src/core/surface/server_create.c", + "src/core/surface/surface_trace.h", + "src/core/surface/validate_metadata.c", + "src/core/surface/version.c", + "src/core/transport/byte_stream.c", + "src/core/transport/byte_stream.h", + "src/core/transport/chttp2/alpn.c", + "src/core/transport/chttp2/alpn.h", + "src/core/transport/chttp2/bin_encoder.c", + "src/core/transport/chttp2/bin_encoder.h", + "src/core/transport/chttp2/frame.h", + "src/core/transport/chttp2/frame_data.c", + "src/core/transport/chttp2/frame_data.h", + "src/core/transport/chttp2/frame_goaway.c", + "src/core/transport/chttp2/frame_goaway.h", + "src/core/transport/chttp2/frame_ping.c", + "src/core/transport/chttp2/frame_ping.h", + "src/core/transport/chttp2/frame_rst_stream.c", + "src/core/transport/chttp2/frame_rst_stream.h", + "src/core/transport/chttp2/frame_settings.c", + "src/core/transport/chttp2/frame_settings.h", + "src/core/transport/chttp2/frame_window_update.c", + "src/core/transport/chttp2/frame_window_update.h", + "src/core/transport/chttp2/hpack_encoder.c", + "src/core/transport/chttp2/hpack_encoder.h", + "src/core/transport/chttp2/hpack_parser.c", + "src/core/transport/chttp2/hpack_parser.h", + "src/core/transport/chttp2/hpack_table.c", + "src/core/transport/chttp2/hpack_table.h", + "src/core/transport/chttp2/http2_errors.h", + "src/core/transport/chttp2/huffsyms.c", + "src/core/transport/chttp2/huffsyms.h", + "src/core/transport/chttp2/incoming_metadata.c", + "src/core/transport/chttp2/incoming_metadata.h", + "src/core/transport/chttp2/internal.h", + "src/core/transport/chttp2/parsing.c", + "src/core/transport/chttp2/status_conversion.c", + "src/core/transport/chttp2/status_conversion.h", + "src/core/transport/chttp2/stream_lists.c", + "src/core/transport/chttp2/stream_map.c", + "src/core/transport/chttp2/stream_map.h", + "src/core/transport/chttp2/timeout_encoding.c", + "src/core/transport/chttp2/timeout_encoding.h", + "src/core/transport/chttp2/varint.c", + "src/core/transport/chttp2/varint.h", + "src/core/transport/chttp2/writing.c", + "src/core/transport/chttp2_transport.c", + "src/core/transport/chttp2_transport.h", + "src/core/transport/connectivity_state.c", + "src/core/transport/connectivity_state.h", + "src/core/transport/metadata.c", + "src/core/transport/metadata.h", + "src/core/transport/metadata_batch.c", + "src/core/transport/metadata_batch.h", + "src/core/transport/static_metadata.c", + "src/core/transport/static_metadata.h", + "src/core/transport/transport.c", + "src/core/transport/transport.h", + "src/core/transport/transport_impl.h", + "src/core/transport/transport_op_string.c", + "src/core/tsi/fake_transport_security.c", + "src/core/tsi/fake_transport_security.h", + "src/core/tsi/ssl_transport_security.c", + "src/core/tsi/ssl_transport_security.h", + "src/core/tsi/ssl_types.h", + "src/core/tsi/transport_security.c", + "src/core/tsi/transport_security.h", + "src/core/tsi/transport_security_interface.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "grpc" + ], + "headers": [], + "language": "c", + "name": "grpc_dll", + "src": [], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc" + ], + "headers": [ + "test/core/end2end/cq_verifier.h", + "test/core/end2end/data/ssl_test_data.h", + "test/core/end2end/fixtures/proxy.h", + "test/core/iomgr/endpoint_tests.h", + "test/core/security/oauth2_utils.h", + "test/core/util/grpc_profiler.h", + "test/core/util/parse_hexstring.h", + "test/core/util/port.h", + "test/core/util/slice_splitter.h" + ], + "language": "c", + "name": "grpc_test_util", + "src": [ + "test/core/end2end/cq_verifier.c", + "test/core/end2end/cq_verifier.h", + "test/core/end2end/data/server1_cert.c", + "test/core/end2end/data/server1_key.c", + "test/core/end2end/data/ssl_test_data.h", + "test/core/end2end/data/test_root_cert.c", + "test/core/end2end/fixtures/proxy.c", + "test/core/end2end/fixtures/proxy.h", + "test/core/iomgr/endpoint_tests.c", + "test/core/iomgr/endpoint_tests.h", + "test/core/security/oauth2_utils.c", + "test/core/security/oauth2_utils.h", + "test/core/util/grpc_profiler.c", + "test/core/util/grpc_profiler.h", + "test/core/util/parse_hexstring.c", + "test/core/util/parse_hexstring.h", + "test/core/util/port.h", + "test/core/util/port_posix.c", + "test/core/util/port_windows.c", + "test/core/util/slice_splitter.c", + "test/core/util/slice_splitter.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc_unsecure" + ], + "headers": [ + "test/core/end2end/cq_verifier.h", + "test/core/end2end/fixtures/proxy.h", + "test/core/iomgr/endpoint_tests.h", + "test/core/util/grpc_profiler.h", + "test/core/util/parse_hexstring.h", + "test/core/util/port.h", + "test/core/util/slice_splitter.h" + ], + "language": "c", + "name": "grpc_test_util_unsecure", + "src": [ + "test/core/end2end/cq_verifier.c", + "test/core/end2end/cq_verifier.h", + "test/core/end2end/fixtures/proxy.c", + "test/core/end2end/fixtures/proxy.h", + "test/core/iomgr/endpoint_tests.c", + "test/core/iomgr/endpoint_tests.h", + "test/core/util/grpc_profiler.c", + "test/core/util/grpc_profiler.h", + "test/core/util/parse_hexstring.c", + "test/core/util/parse_hexstring.h", + "test/core/util/port.h", + "test/core/util/port_posix.c", + "test/core/util/port_windows.c", + "test/core/util/slice_splitter.c", + "test/core/util/slice_splitter.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr" + ], + "headers": [ + "include/grpc/byte_buffer.h", + "include/grpc/byte_buffer_reader.h", + "include/grpc/census.h", + "include/grpc/compression.h", + "include/grpc/grpc.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/status.h", + "src/core/census/aggregation.h", + "src/core/census/grpc_filter.h", + "src/core/census/mlog.h", + "src/core/census/rpc_metric_id.h", + "src/core/channel/channel_args.h", + "src/core/channel/channel_stack.h", + "src/core/channel/client_channel.h", + "src/core/channel/client_uchannel.h", + "src/core/channel/compress_filter.h", + "src/core/channel/connected_channel.h", + "src/core/channel/context.h", + "src/core/channel/http_client_filter.h", + "src/core/channel/http_server_filter.h", + "src/core/channel/subchannel_call_holder.h", + "src/core/client_config/client_config.h", + "src/core/client_config/connector.h", + "src/core/client_config/initial_connect_string.h", + "src/core/client_config/lb_policies/pick_first.h", + "src/core/client_config/lb_policies/round_robin.h", + "src/core/client_config/lb_policy.h", + "src/core/client_config/lb_policy_factory.h", + "src/core/client_config/lb_policy_registry.h", + "src/core/client_config/resolver.h", + "src/core/client_config/resolver_factory.h", + "src/core/client_config/resolver_registry.h", + "src/core/client_config/resolvers/dns_resolver.h", + "src/core/client_config/resolvers/sockaddr_resolver.h", + "src/core/client_config/subchannel.h", + "src/core/client_config/subchannel_factory.h", + "src/core/client_config/subchannel_index.h", + "src/core/client_config/uri_parser.h", + "src/core/compression/algorithm_metadata.h", + "src/core/compression/message_compress.h", + "src/core/debug/trace.h", + "src/core/httpcli/format_request.h", + "src/core/httpcli/httpcli.h", + "src/core/httpcli/parser.h", + "src/core/iomgr/closure.h", + "src/core/iomgr/endpoint.h", + "src/core/iomgr/endpoint_pair.h", + "src/core/iomgr/exec_ctx.h", + "src/core/iomgr/executor.h", + "src/core/iomgr/fd_posix.h", + "src/core/iomgr/iocp_windows.h", + "src/core/iomgr/iomgr.h", + "src/core/iomgr/iomgr_internal.h", + "src/core/iomgr/iomgr_posix.h", + "src/core/iomgr/pollset.h", + "src/core/iomgr/pollset_posix.h", + "src/core/iomgr/pollset_set.h", + "src/core/iomgr/pollset_set_posix.h", + "src/core/iomgr/pollset_set_windows.h", + "src/core/iomgr/pollset_windows.h", + "src/core/iomgr/resolve_address.h", + "src/core/iomgr/sockaddr.h", + "src/core/iomgr/sockaddr_posix.h", + "src/core/iomgr/sockaddr_utils.h", + "src/core/iomgr/sockaddr_win32.h", + "src/core/iomgr/socket_utils_posix.h", + "src/core/iomgr/socket_windows.h", + "src/core/iomgr/tcp_client.h", + "src/core/iomgr/tcp_posix.h", + "src/core/iomgr/tcp_server.h", + "src/core/iomgr/tcp_windows.h", + "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/timer.h", + "src/core/iomgr/timer_heap.h", + "src/core/iomgr/timer_internal.h", + "src/core/iomgr/udp_server.h", + "src/core/iomgr/wakeup_fd_pipe.h", + "src/core/iomgr/wakeup_fd_posix.h", + "src/core/iomgr/workqueue.h", + "src/core/iomgr/workqueue_posix.h", + "src/core/iomgr/workqueue_windows.h", + "src/core/json/json.h", + "src/core/json/json_common.h", + "src/core/json/json_reader.h", + "src/core/json/json_writer.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", + "src/core/surface/call.h", + "src/core/surface/call_test_only.h", + "src/core/surface/channel.h", + "src/core/surface/completion_queue.h", + "src/core/surface/event_string.h", + "src/core/surface/init.h", + "src/core/surface/server.h", + "src/core/surface/surface_trace.h", + "src/core/transport/byte_stream.h", + "src/core/transport/chttp2/alpn.h", + "src/core/transport/chttp2/bin_encoder.h", + "src/core/transport/chttp2/frame.h", + "src/core/transport/chttp2/frame_data.h", + "src/core/transport/chttp2/frame_goaway.h", + "src/core/transport/chttp2/frame_ping.h", + "src/core/transport/chttp2/frame_rst_stream.h", + "src/core/transport/chttp2/frame_settings.h", + "src/core/transport/chttp2/frame_window_update.h", + "src/core/transport/chttp2/hpack_encoder.h", + "src/core/transport/chttp2/hpack_parser.h", + "src/core/transport/chttp2/hpack_table.h", + "src/core/transport/chttp2/http2_errors.h", + "src/core/transport/chttp2/huffsyms.h", + "src/core/transport/chttp2/incoming_metadata.h", + "src/core/transport/chttp2/internal.h", + "src/core/transport/chttp2/status_conversion.h", + "src/core/transport/chttp2/stream_map.h", + "src/core/transport/chttp2/timeout_encoding.h", + "src/core/transport/chttp2/varint.h", + "src/core/transport/chttp2_transport.h", + "src/core/transport/connectivity_state.h", + "src/core/transport/metadata.h", + "src/core/transport/metadata_batch.h", + "src/core/transport/static_metadata.h", + "src/core/transport/transport.h", + "src/core/transport/transport_impl.h" + ], + "language": "c", + "name": "grpc_unsecure", + "src": [ + "include/grpc/byte_buffer.h", + "include/grpc/byte_buffer_reader.h", + "include/grpc/census.h", + "include/grpc/compression.h", + "include/grpc/grpc.h", + "include/grpc/impl/codegen/byte_buffer.h", "include/grpc/impl/codegen/compression_types.h", "include/grpc/impl/codegen/connectivity_state.h", "include/grpc/impl/codegen/grpc_types.h", @@ -3661,8 +4523,8 @@ "src/core/census/grpc_filter.c", "src/core/census/grpc_filter.h", "src/core/census/initialize.c", - "src/core/census/log.c", - "src/core/census/log.h", + "src/core/census/mlog.c", + "src/core/census/mlog.h", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/rpc_metric_id.h", @@ -3721,8 +4583,8 @@ "src/core/client_config/subchannel_index.h", "src/core/client_config/uri_parser.c", "src/core/client_config/uri_parser.h", - "src/core/compression/algorithm.c", "src/core/compression/algorithm_metadata.h", + "src/core/compression/compression_algorithm.c", "src/core/compression/message_compress.c", "src/core/compression/message_compress.h", "src/core/debug/trace.c", @@ -3907,7 +4769,9 @@ "src/core/transport/transport.h", "src/core/transport/transport_impl.h", "src/core/transport/transport_op_string.c" - ] + ], + "third_party": false, + "type": "lib" }, { "deps": [ @@ -3918,52 +4782,322 @@ "include/grpc/grpc_zookeeper.h", "src/core/client_config/resolvers/zookeeper_resolver.h" ], - "language": "c", - "name": "grpc_zookeeper", - "src": [ - "include/grpc/grpc_zookeeper.h", - "src/core/client_config/resolvers/zookeeper_resolver.c", - "src/core/client_config/resolvers/zookeeper_resolver.h" - ] + "language": "c", + "name": "grpc_zookeeper", + "src": [ + "include/grpc/grpc_zookeeper.h", + "src/core/client_config/resolvers/zookeeper_resolver.c", + "src/core/client_config/resolvers/zookeeper_resolver.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util", + "test_tcp_server" + ], + "headers": [ + "test/core/util/reconnect_server.h" + ], + "language": "c", + "name": "reconnect_server", + "src": [ + "test/core/util/reconnect_server.c", + "test/core/util/reconnect_server.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [ + "test/core/util/test_tcp_server.h" + ], + "language": "c", + "name": "test_tcp_server", + "src": [ + "test/core/util/test_tcp_server.c", + "test/core/util/test_tcp_server.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "grpc" + ], + "headers": [ + "include/grpc++/alarm.h", + "include/grpc++/channel.h", + "include/grpc++/client_context.h", + "include/grpc++/completion_queue.h", + "include/grpc++/create_channel.h", + "include/grpc++/generic/async_generic_service.h", + "include/grpc++/generic/generic_stub.h", + "include/grpc++/grpc++.h", + "include/grpc++/impl/call.h", + "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", + "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/method_handler_impl.h", + "include/grpc++/impl/proto_utils.h", + "include/grpc++/impl/rpc_method.h", + "include/grpc++/impl/rpc_service_method.h", + "include/grpc++/impl/serialization_traits.h", + "include/grpc++/impl/server_builder_option.h", + "include/grpc++/impl/service_type.h", + "include/grpc++/impl/sync.h", + "include/grpc++/impl/sync_cxx11.h", + "include/grpc++/impl/sync_no_cxx11.h", + "include/grpc++/impl/thd.h", + "include/grpc++/impl/thd_cxx11.h", + "include/grpc++/impl/thd_no_cxx11.h", + "include/grpc++/security/auth_context.h", + "include/grpc++/security/auth_metadata_processor.h", + "include/grpc++/security/credentials.h", + "include/grpc++/security/server_credentials.h", + "include/grpc++/server.h", + "include/grpc++/server_builder.h", + "include/grpc++/server_context.h", + "include/grpc++/support/async_stream.h", + "include/grpc++/support/async_unary_call.h", + "include/grpc++/support/byte_buffer.h", + "include/grpc++/support/channel_arguments.h", + "include/grpc++/support/config.h", + "include/grpc++/support/config_protobuf.h", + "include/grpc++/support/slice.h", + "include/grpc++/support/status.h", + "include/grpc++/support/status_code_enum.h", + "include/grpc++/support/string_ref.h", + "include/grpc++/support/stub_options.h", + "include/grpc++/support/sync_stream.h", + "include/grpc++/support/time.h", + "src/cpp/client/create_channel_internal.h", + "src/cpp/client/secure_credentials.h", + "src/cpp/common/create_auth_context.h", + "src/cpp/common/secure_auth_context.h", + "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/secure_server_credentials.h", + "src/cpp/server/thread_pool_interface.h" + ], + "language": "c++", + "name": "grpc++", + "src": [ + "include/grpc++/alarm.h", + "include/grpc++/channel.h", + "include/grpc++/client_context.h", + "include/grpc++/completion_queue.h", + "include/grpc++/create_channel.h", + "include/grpc++/generic/async_generic_service.h", + "include/grpc++/generic/generic_stub.h", + "include/grpc++/grpc++.h", + "include/grpc++/impl/call.h", + "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", + "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/method_handler_impl.h", + "include/grpc++/impl/proto_utils.h", + "include/grpc++/impl/rpc_method.h", + "include/grpc++/impl/rpc_service_method.h", + "include/grpc++/impl/serialization_traits.h", + "include/grpc++/impl/server_builder_option.h", + "include/grpc++/impl/service_type.h", + "include/grpc++/impl/sync.h", + "include/grpc++/impl/sync_cxx11.h", + "include/grpc++/impl/sync_no_cxx11.h", + "include/grpc++/impl/thd.h", + "include/grpc++/impl/thd_cxx11.h", + "include/grpc++/impl/thd_no_cxx11.h", + "include/grpc++/security/auth_context.h", + "include/grpc++/security/auth_metadata_processor.h", + "include/grpc++/security/credentials.h", + "include/grpc++/security/server_credentials.h", + "include/grpc++/server.h", + "include/grpc++/server_builder.h", + "include/grpc++/server_context.h", + "include/grpc++/support/async_stream.h", + "include/grpc++/support/async_unary_call.h", + "include/grpc++/support/byte_buffer.h", + "include/grpc++/support/channel_arguments.h", + "include/grpc++/support/config.h", + "include/grpc++/support/config_protobuf.h", + "include/grpc++/support/slice.h", + "include/grpc++/support/status.h", + "include/grpc++/support/status_code_enum.h", + "include/grpc++/support/string_ref.h", + "include/grpc++/support/stub_options.h", + "include/grpc++/support/sync_stream.h", + "include/grpc++/support/time.h", + "src/cpp/client/channel.cc", + "src/cpp/client/client_context.cc", + "src/cpp/client/create_channel.cc", + "src/cpp/client/create_channel_internal.cc", + "src/cpp/client/create_channel_internal.h", + "src/cpp/client/credentials.cc", + "src/cpp/client/generic_stub.cc", + "src/cpp/client/insecure_credentials.cc", + "src/cpp/client/secure_credentials.cc", + "src/cpp/client/secure_credentials.h", + "src/cpp/codegen/grpc_library.cc", + "src/cpp/common/alarm.cc", + "src/cpp/common/auth_property_iterator.cc", + "src/cpp/common/call.cc", + "src/cpp/common/channel_arguments.cc", + "src/cpp/common/completion_queue.cc", + "src/cpp/common/create_auth_context.h", + "src/cpp/common/rpc_method.cc", + "src/cpp/common/secure_auth_context.cc", + "src/cpp/common/secure_auth_context.h", + "src/cpp/common/secure_channel_arguments.cc", + "src/cpp/common/secure_create_auth_context.cc", + "src/cpp/proto/proto_utils.cc", + "src/cpp/server/async_generic_service.cc", + "src/cpp/server/create_default_thread_pool.cc", + "src/cpp/server/dynamic_thread_pool.cc", + "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/insecure_server_credentials.cc", + "src/cpp/server/secure_server_credentials.cc", + "src/cpp/server/secure_server_credentials.h", + "src/cpp/server/server.cc", + "src/cpp/server/server_builder.cc", + "src/cpp/server/server_context.cc", + "src/cpp/server/server_credentials.cc", + "src/cpp/server/thread_pool_interface.h", + "src/cpp/util/byte_buffer.cc", + "src/cpp/util/slice.cc", + "src/cpp/util/status.cc", + "src/cpp/util/string_ref.cc", + "src/cpp/util/time.cc" + ], + "third_party": false, + "type": "lib" }, { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util", - "test_tcp_server" - ], + "deps": [], "headers": [ - "test/core/util/reconnect_server.h" + "test/cpp/util/test_config.h" ], - "language": "c", - "name": "reconnect_server", + "language": "c++", + "name": "grpc++_test_config", "src": [ - "test/core/util/reconnect_server.c", - "test/core/util/reconnect_server.h" - ] + "test/cpp/util/test_config.cc", + "test/cpp/util/test_config.h" + ], + "third_party": false, + "type": "lib" }, { "deps": [ - "gpr", - "gpr_test_util", - "grpc", + "grpc++", "grpc_test_util" ], "headers": [ - "test/core/util/test_tcp_server.h" + "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h", + "src/proto/grpc/testing/duplicate/echo_duplicate.pb.h", + "src/proto/grpc/testing/echo.grpc.pb.h", + "src/proto/grpc/testing/echo.pb.h", + "src/proto/grpc/testing/echo_messages.grpc.pb.h", + "src/proto/grpc/testing/echo_messages.pb.h", + "test/cpp/end2end/test_service_impl.h", + "test/cpp/util/byte_buffer_proto_helper.h", + "test/cpp/util/cli_call.h", + "test/cpp/util/create_test_channel.h", + "test/cpp/util/string_ref_helper.h", + "test/cpp/util/subprocess.h", + "test/cpp/util/test_credentials_provider.h" ], - "language": "c", - "name": "test_tcp_server", + "language": "c++", + "name": "grpc++_test_util", "src": [ - "test/core/util/test_tcp_server.c", - "test/core/util/test_tcp_server.h" - ] + "test/cpp/end2end/test_service_impl.cc", + "test/cpp/end2end/test_service_impl.h", + "test/cpp/util/byte_buffer_proto_helper.cc", + "test/cpp/util/byte_buffer_proto_helper.h", + "test/cpp/util/cli_call.cc", + "test/cpp/util/cli_call.h", + "test/cpp/util/create_test_channel.cc", + "test/cpp/util/create_test_channel.h", + "test/cpp/util/string_ref_helper.cc", + "test/cpp/util/string_ref_helper.h", + "test/cpp/util/subprocess.cc", + "test/cpp/util/subprocess.h", + "test/cpp/util/test_credentials_provider.cc", + "test/cpp/util/test_credentials_provider.h" + ], + "third_party": false, + "type": "lib" }, { "deps": [ - "grpc" + "gpr", + "grpc_unsecure" ], "headers": [ "include/grpc++/alarm.h", @@ -4041,26 +5175,195 @@ "include/grpc++/support/sync_stream.h", "include/grpc++/support/time.h", "src/cpp/client/create_channel_internal.h", - "src/cpp/client/secure_credentials.h", "src/cpp/common/create_auth_context.h", - "src/cpp/common/secure_auth_context.h", "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/secure_server_credentials.h", "src/cpp/server/thread_pool_interface.h" ], "language": "c++", - "name": "grpc++", + "name": "grpc++_unsecure", + "src": [ + "include/grpc++/alarm.h", + "include/grpc++/channel.h", + "include/grpc++/client_context.h", + "include/grpc++/completion_queue.h", + "include/grpc++/create_channel.h", + "include/grpc++/generic/async_generic_service.h", + "include/grpc++/generic/generic_stub.h", + "include/grpc++/grpc++.h", + "include/grpc++/impl/call.h", + "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", + "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/method_handler_impl.h", + "include/grpc++/impl/proto_utils.h", + "include/grpc++/impl/rpc_method.h", + "include/grpc++/impl/rpc_service_method.h", + "include/grpc++/impl/serialization_traits.h", + "include/grpc++/impl/server_builder_option.h", + "include/grpc++/impl/service_type.h", + "include/grpc++/impl/sync.h", + "include/grpc++/impl/sync_cxx11.h", + "include/grpc++/impl/sync_no_cxx11.h", + "include/grpc++/impl/thd.h", + "include/grpc++/impl/thd_cxx11.h", + "include/grpc++/impl/thd_no_cxx11.h", + "include/grpc++/security/auth_context.h", + "include/grpc++/security/auth_metadata_processor.h", + "include/grpc++/security/credentials.h", + "include/grpc++/security/server_credentials.h", + "include/grpc++/server.h", + "include/grpc++/server_builder.h", + "include/grpc++/server_context.h", + "include/grpc++/support/async_stream.h", + "include/grpc++/support/async_unary_call.h", + "include/grpc++/support/byte_buffer.h", + "include/grpc++/support/channel_arguments.h", + "include/grpc++/support/config.h", + "include/grpc++/support/config_protobuf.h", + "include/grpc++/support/slice.h", + "include/grpc++/support/status.h", + "include/grpc++/support/status_code_enum.h", + "include/grpc++/support/string_ref.h", + "include/grpc++/support/stub_options.h", + "include/grpc++/support/sync_stream.h", + "include/grpc++/support/time.h", + "src/cpp/client/channel.cc", + "src/cpp/client/client_context.cc", + "src/cpp/client/create_channel.cc", + "src/cpp/client/create_channel_internal.cc", + "src/cpp/client/create_channel_internal.h", + "src/cpp/client/credentials.cc", + "src/cpp/client/generic_stub.cc", + "src/cpp/client/insecure_credentials.cc", + "src/cpp/codegen/grpc_library.cc", + "src/cpp/common/alarm.cc", + "src/cpp/common/call.cc", + "src/cpp/common/channel_arguments.cc", + "src/cpp/common/completion_queue.cc", + "src/cpp/common/create_auth_context.h", + "src/cpp/common/insecure_create_auth_context.cc", + "src/cpp/common/rpc_method.cc", + "src/cpp/proto/proto_utils.cc", + "src/cpp/server/async_generic_service.cc", + "src/cpp/server/create_default_thread_pool.cc", + "src/cpp/server/dynamic_thread_pool.cc", + "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/insecure_server_credentials.cc", + "src/cpp/server/server.cc", + "src/cpp/server/server_builder.cc", + "src/cpp/server/server_context.cc", + "src/cpp/server/server_credentials.cc", + "src/cpp/server/thread_pool_interface.h", + "src/cpp/util/byte_buffer.cc", + "src/cpp/util/slice.cc", + "src/cpp/util/status.cc", + "src/cpp/util/string_ref.cc", + "src/cpp/util/time.cc" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [], + "headers": [ + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/config_protobuf.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", + "include/grpc++/support/config.h", + "include/grpc++/support/config_protobuf.h", + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", + "src/compiler/config.h", + "src/compiler/cpp_generator.h", + "src/compiler/cpp_generator_helpers.h", + "src/compiler/csharp_generator.h", + "src/compiler/csharp_generator_helpers.h", + "src/compiler/generator_helpers.h", + "src/compiler/objective_c_generator.h", + "src/compiler/objective_c_generator_helpers.h", + "src/compiler/python_generator.h", + "src/compiler/ruby_generator.h", + "src/compiler/ruby_generator_helpers-inl.h", + "src/compiler/ruby_generator_map-inl.h", + "src/compiler/ruby_generator_string-inl.h" + ], + "language": "c++", + "name": "grpc_plugin_support", "src": [ - "include/grpc++/alarm.h", - "include/grpc++/channel.h", - "include/grpc++/client_context.h", - "include/grpc++/completion_queue.h", - "include/grpc++/create_channel.h", - "include/grpc++/generic/async_generic_service.h", - "include/grpc++/generic/generic_stub.h", - "include/grpc++/grpc++.h", - "include/grpc++/impl/call.h", - "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/async_stream.h", "include/grpc++/impl/codegen/async_unary_call.h", "include/grpc++/impl/codegen/call.h", @@ -4091,635 +5394,1308 @@ "include/grpc++/impl/codegen/sync_no_cxx11.h", "include/grpc++/impl/codegen/sync_stream.h", "include/grpc++/impl/codegen/time.h", - "include/grpc++/impl/grpc_library.h", - "include/grpc++/impl/method_handler_impl.h", - "include/grpc++/impl/proto_utils.h", - "include/grpc++/impl/rpc_method.h", - "include/grpc++/impl/rpc_service_method.h", - "include/grpc++/impl/serialization_traits.h", - "include/grpc++/impl/server_builder_option.h", - "include/grpc++/impl/service_type.h", - "include/grpc++/impl/sync.h", - "include/grpc++/impl/sync_cxx11.h", - "include/grpc++/impl/sync_no_cxx11.h", - "include/grpc++/impl/thd.h", - "include/grpc++/impl/thd_cxx11.h", - "include/grpc++/impl/thd_no_cxx11.h", - "include/grpc++/security/auth_context.h", - "include/grpc++/security/auth_metadata_processor.h", - "include/grpc++/security/credentials.h", - "include/grpc++/security/server_credentials.h", - "include/grpc++/server.h", - "include/grpc++/server_builder.h", - "include/grpc++/server_context.h", - "include/grpc++/support/async_stream.h", - "include/grpc++/support/async_unary_call.h", - "include/grpc++/support/byte_buffer.h", - "include/grpc++/support/channel_arguments.h", "include/grpc++/support/config.h", "include/grpc++/support/config_protobuf.h", - "include/grpc++/support/slice.h", - "include/grpc++/support/status.h", - "include/grpc++/support/status_code_enum.h", - "include/grpc++/support/string_ref.h", - "include/grpc++/support/stub_options.h", - "include/grpc++/support/sync_stream.h", - "include/grpc++/support/time.h", - "src/cpp/client/channel.cc", - "src/cpp/client/client_context.cc", - "src/cpp/client/create_channel.cc", - "src/cpp/client/create_channel_internal.cc", - "src/cpp/client/create_channel_internal.h", - "src/cpp/client/credentials.cc", - "src/cpp/client/generic_stub.cc", - "src/cpp/client/insecure_credentials.cc", - "src/cpp/client/secure_credentials.cc", - "src/cpp/client/secure_credentials.h", - "src/cpp/codegen/grpc_library.cc", - "src/cpp/common/alarm.cc", - "src/cpp/common/auth_property_iterator.cc", - "src/cpp/common/call.cc", - "src/cpp/common/channel_arguments.cc", - "src/cpp/common/completion_queue.cc", - "src/cpp/common/create_auth_context.h", - "src/cpp/common/rpc_method.cc", - "src/cpp/common/secure_auth_context.cc", - "src/cpp/common/secure_auth_context.h", - "src/cpp/common/secure_channel_arguments.cc", - "src/cpp/common/secure_create_auth_context.cc", - "src/cpp/proto/proto_utils.cc", - "src/cpp/server/async_generic_service.cc", - "src/cpp/server/create_default_thread_pool.cc", - "src/cpp/server/dynamic_thread_pool.cc", - "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/insecure_server_credentials.cc", - "src/cpp/server/secure_server_credentials.cc", - "src/cpp/server/secure_server_credentials.h", - "src/cpp/server/server.cc", - "src/cpp/server/server_builder.cc", - "src/cpp/server/server_context.cc", - "src/cpp/server/server_credentials.cc", - "src/cpp/server/thread_pool_interface.h", - "src/cpp/util/byte_buffer.cc", - "src/cpp/util/slice.cc", - "src/cpp/util/status.cc", - "src/cpp/util/string_ref.cc", - "src/cpp/util/time.cc" - ] + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_win32.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_win32.h", + "include/grpc/impl/codegen/time.h", + "src/compiler/config.h", + "src/compiler/cpp_generator.cc", + "src/compiler/cpp_generator.h", + "src/compiler/cpp_generator_helpers.h", + "src/compiler/csharp_generator.cc", + "src/compiler/csharp_generator.h", + "src/compiler/csharp_generator_helpers.h", + "src/compiler/generator_helpers.h", + "src/compiler/objective_c_generator.cc", + "src/compiler/objective_c_generator.h", + "src/compiler/objective_c_generator_helpers.h", + "src/compiler/python_generator.cc", + "src/compiler/python_generator.h", + "src/compiler/ruby_generator.cc", + "src/compiler/ruby_generator.h", + "src/compiler/ruby_generator_helpers-inl.h", + "src/compiler/ruby_generator_map-inl.h", + "src/compiler/ruby_generator_string-inl.h", + "src/cpp/codegen/grpc_library.cc" + ], + "third_party": false, + "type": "lib" }, { - "deps": [], + "deps": [ + "gpr", + "grpc", + "grpc++", + "grpc++_test_util", + "grpc_test_util" + ], "headers": [ - "test/cpp/util/test_config.h" + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "test/cpp/interop/client_helper.h" + ], + "language": "c++", + "name": "interop_client_helper", + "src": [ + "test/cpp/interop/client_helper.cc", + "test/cpp/interop/client_helper.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", + "grpc++_test_config", + "grpc++_test_util", + "grpc_test_util", + "interop_client_helper" + ], + "headers": [ + "src/proto/grpc/testing/empty.grpc.pb.h", + "src/proto/grpc/testing/empty.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/test.grpc.pb.h", + "src/proto/grpc/testing/test.pb.h", + "test/cpp/interop/interop_client.h" + ], + "language": "c++", + "name": "interop_client_main", + "src": [ + "test/cpp/interop/client.cc", + "test/cpp/interop/interop_client.cc", + "test/cpp/interop/interop_client.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "grpc", + "grpc++", + "grpc_test_util" + ], + "headers": [ + "test/cpp/interop/server_helper.h" + ], + "language": "c++", + "name": "interop_server_helper", + "src": [ + "test/cpp/interop/server_helper.cc", + "test/cpp/interop/server_helper.h" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", + "grpc++_test_config", + "grpc++_test_util", + "grpc_test_util", + "interop_server_helper" + ], + "headers": [ + "src/proto/grpc/testing/empty.grpc.pb.h", + "src/proto/grpc/testing/empty.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/test.grpc.pb.h", + "src/proto/grpc/testing/test.pb.h" + ], + "language": "c++", + "name": "interop_server_main", + "src": [ + "test/cpp/interop/server_main.cc" + ], + "third_party": false, + "type": "lib" + }, + { + "deps": [ + "grpc++", + "grpc++_test_util", + "grpc_test_util" + ], + "headers": [ + "src/proto/grpc/testing/control.grpc.pb.h", + "src/proto/grpc/testing/control.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/payloads.grpc.pb.h", + "src/proto/grpc/testing/payloads.pb.h", + "src/proto/grpc/testing/perf_db.grpc.pb.h", + "src/proto/grpc/testing/perf_db.pb.h", + "src/proto/grpc/testing/services.grpc.pb.h", + "src/proto/grpc/testing/services.pb.h", + "src/proto/grpc/testing/stats.grpc.pb.h", + "src/proto/grpc/testing/stats.pb.h", + "test/cpp/qps/client.h", + "test/cpp/qps/driver.h", + "test/cpp/qps/histogram.h", + "test/cpp/qps/interarrival.h", + "test/cpp/qps/limit_cores.h", + "test/cpp/qps/perf_db_client.h", + "test/cpp/qps/qps_worker.h", + "test/cpp/qps/report.h", + "test/cpp/qps/server.h", + "test/cpp/qps/stats.h", + "test/cpp/qps/usage_timer.h", + "test/cpp/util/benchmark_config.h" ], "language": "c++", - "name": "grpc++_test_config", + "name": "qps", "src": [ - "test/cpp/util/test_config.cc", - "test/cpp/util/test_config.h" - ] - }, - { - "deps": [ - "grpc++", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate.pb.h", - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "test/cpp/end2end/test_service_impl.h", - "test/cpp/util/byte_buffer_proto_helper.h", - "test/cpp/util/cli_call.h", - "test/cpp/util/create_test_channel.h", - "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.h", - "test/cpp/util/test_credentials_provider.h" + "test/cpp/qps/client.h", + "test/cpp/qps/client_async.cc", + "test/cpp/qps/client_sync.cc", + "test/cpp/qps/driver.cc", + "test/cpp/qps/driver.h", + "test/cpp/qps/histogram.h", + "test/cpp/qps/interarrival.h", + "test/cpp/qps/limit_cores.cc", + "test/cpp/qps/limit_cores.h", + "test/cpp/qps/perf_db_client.cc", + "test/cpp/qps/perf_db_client.h", + "test/cpp/qps/qps_worker.cc", + "test/cpp/qps/qps_worker.h", + "test/cpp/qps/report.cc", + "test/cpp/qps/report.h", + "test/cpp/qps/server.h", + "test/cpp/qps/server_async.cc", + "test/cpp/qps/server_sync.cc", + "test/cpp/qps/stats.h", + "test/cpp/qps/usage_timer.cc", + "test/cpp/qps/usage_timer.h", + "test/cpp/util/benchmark_config.cc", + "test/cpp/util/benchmark_config.h" ], - "language": "c++", - "name": "grpc++_test_util", - "src": [ - "test/cpp/end2end/test_service_impl.cc", - "test/cpp/end2end/test_service_impl.h", - "test/cpp/util/byte_buffer_proto_helper.cc", - "test/cpp/util/byte_buffer_proto_helper.h", - "test/cpp/util/cli_call.cc", - "test/cpp/util/cli_call.h", - "test/cpp/util/create_test_channel.cc", - "test/cpp/util/create_test_channel.h", - "test/cpp/util/string_ref_helper.cc", - "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.cc", - "test/cpp/util/subprocess.h", - "test/cpp/util/test_credentials_provider.cc", - "test/cpp/util/test_credentials_provider.h" - ] + "third_party": false, + "type": "lib" }, { "deps": [ "gpr", - "grpc_unsecure" - ], - "headers": [ - "include/grpc++/alarm.h", - "include/grpc++/channel.h", - "include/grpc++/client_context.h", - "include/grpc++/completion_queue.h", - "include/grpc++/create_channel.h", - "include/grpc++/generic/async_generic_service.h", - "include/grpc++/generic/generic_stub.h", - "include/grpc++/grpc++.h", - "include/grpc++/impl/call.h", - "include/grpc++/impl/client_unary_call.h", - "include/grpc++/impl/codegen/async_stream.h", - "include/grpc++/impl/codegen/async_unary_call.h", - "include/grpc++/impl/codegen/call.h", - "include/grpc++/impl/codegen/call_hook.h", - "include/grpc++/impl/codegen/channel_interface.h", - "include/grpc++/impl/codegen/client_context.h", - "include/grpc++/impl/codegen/client_unary_call.h", - "include/grpc++/impl/codegen/completion_queue.h", - "include/grpc++/impl/codegen/completion_queue_tag.h", - "include/grpc++/impl/codegen/config.h", - "include/grpc++/impl/codegen/config_protobuf.h", - "include/grpc++/impl/codegen/grpc_library.h", - "include/grpc++/impl/codegen/method_handler_impl.h", - "include/grpc++/impl/codegen/proto_utils.h", - "include/grpc++/impl/codegen/rpc_method.h", - "include/grpc++/impl/codegen/rpc_service_method.h", - "include/grpc++/impl/codegen/security/auth_context.h", - "include/grpc++/impl/codegen/serialization_traits.h", - "include/grpc++/impl/codegen/server_context.h", - "include/grpc++/impl/codegen/server_interface.h", - "include/grpc++/impl/codegen/service_type.h", - "include/grpc++/impl/codegen/status.h", - "include/grpc++/impl/codegen/status_code_enum.h", - "include/grpc++/impl/codegen/string_ref.h", - "include/grpc++/impl/codegen/stub_options.h", - "include/grpc++/impl/codegen/sync.h", - "include/grpc++/impl/codegen/sync_cxx11.h", - "include/grpc++/impl/codegen/sync_no_cxx11.h", - "include/grpc++/impl/codegen/sync_stream.h", - "include/grpc++/impl/codegen/time.h", - "include/grpc++/impl/grpc_library.h", - "include/grpc++/impl/method_handler_impl.h", - "include/grpc++/impl/proto_utils.h", - "include/grpc++/impl/rpc_method.h", - "include/grpc++/impl/rpc_service_method.h", - "include/grpc++/impl/serialization_traits.h", - "include/grpc++/impl/server_builder_option.h", - "include/grpc++/impl/service_type.h", - "include/grpc++/impl/sync.h", - "include/grpc++/impl/sync_cxx11.h", - "include/grpc++/impl/sync_no_cxx11.h", - "include/grpc++/impl/thd.h", - "include/grpc++/impl/thd_cxx11.h", - "include/grpc++/impl/thd_no_cxx11.h", - "include/grpc++/security/auth_context.h", - "include/grpc++/security/auth_metadata_processor.h", - "include/grpc++/security/credentials.h", - "include/grpc++/security/server_credentials.h", - "include/grpc++/server.h", - "include/grpc++/server_builder.h", - "include/grpc++/server_context.h", - "include/grpc++/support/async_stream.h", - "include/grpc++/support/async_unary_call.h", - "include/grpc++/support/byte_buffer.h", - "include/grpc++/support/channel_arguments.h", - "include/grpc++/support/config.h", - "include/grpc++/support/config_protobuf.h", - "include/grpc++/support/slice.h", - "include/grpc++/support/status.h", - "include/grpc++/support/status_code_enum.h", - "include/grpc++/support/string_ref.h", - "include/grpc++/support/stub_options.h", - "include/grpc++/support/sync_stream.h", - "include/grpc++/support/time.h", - "src/cpp/client/create_channel_internal.h", - "src/cpp/common/create_auth_context.h", - "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/thread_pool_interface.h" + "grpc" ], - "language": "c++", - "name": "grpc++_unsecure", - "src": [ - "include/grpc++/alarm.h", - "include/grpc++/channel.h", - "include/grpc++/client_context.h", - "include/grpc++/completion_queue.h", - "include/grpc++/create_channel.h", - "include/grpc++/generic/async_generic_service.h", - "include/grpc++/generic/generic_stub.h", - "include/grpc++/grpc++.h", - "include/grpc++/impl/call.h", - "include/grpc++/impl/client_unary_call.h", - "include/grpc++/impl/codegen/async_stream.h", - "include/grpc++/impl/codegen/async_unary_call.h", - "include/grpc++/impl/codegen/call.h", - "include/grpc++/impl/codegen/call_hook.h", - "include/grpc++/impl/codegen/channel_interface.h", - "include/grpc++/impl/codegen/client_context.h", - "include/grpc++/impl/codegen/client_unary_call.h", - "include/grpc++/impl/codegen/completion_queue.h", - "include/grpc++/impl/codegen/completion_queue_tag.h", - "include/grpc++/impl/codegen/config.h", - "include/grpc++/impl/codegen/config_protobuf.h", - "include/grpc++/impl/codegen/grpc_library.h", - "include/grpc++/impl/codegen/method_handler_impl.h", - "include/grpc++/impl/codegen/proto_utils.h", - "include/grpc++/impl/codegen/rpc_method.h", - "include/grpc++/impl/codegen/rpc_service_method.h", - "include/grpc++/impl/codegen/security/auth_context.h", - "include/grpc++/impl/codegen/serialization_traits.h", - "include/grpc++/impl/codegen/server_context.h", - "include/grpc++/impl/codegen/server_interface.h", - "include/grpc++/impl/codegen/service_type.h", - "include/grpc++/impl/codegen/status.h", - "include/grpc++/impl/codegen/status_code_enum.h", - "include/grpc++/impl/codegen/string_ref.h", - "include/grpc++/impl/codegen/stub_options.h", - "include/grpc++/impl/codegen/sync.h", - "include/grpc++/impl/codegen/sync_cxx11.h", - "include/grpc++/impl/codegen/sync_no_cxx11.h", - "include/grpc++/impl/codegen/sync_stream.h", - "include/grpc++/impl/codegen/time.h", - "include/grpc++/impl/grpc_library.h", - "include/grpc++/impl/method_handler_impl.h", - "include/grpc++/impl/proto_utils.h", - "include/grpc++/impl/rpc_method.h", - "include/grpc++/impl/rpc_service_method.h", - "include/grpc++/impl/serialization_traits.h", - "include/grpc++/impl/server_builder_option.h", - "include/grpc++/impl/service_type.h", - "include/grpc++/impl/sync.h", - "include/grpc++/impl/sync_cxx11.h", - "include/grpc++/impl/sync_no_cxx11.h", - "include/grpc++/impl/thd.h", - "include/grpc++/impl/thd_cxx11.h", - "include/grpc++/impl/thd_no_cxx11.h", - "include/grpc++/security/auth_context.h", - "include/grpc++/security/auth_metadata_processor.h", - "include/grpc++/security/credentials.h", - "include/grpc++/security/server_credentials.h", - "include/grpc++/server.h", - "include/grpc++/server_builder.h", - "include/grpc++/server_context.h", - "include/grpc++/support/async_stream.h", - "include/grpc++/support/async_unary_call.h", - "include/grpc++/support/byte_buffer.h", - "include/grpc++/support/channel_arguments.h", - "include/grpc++/support/config.h", - "include/grpc++/support/config_protobuf.h", - "include/grpc++/support/slice.h", - "include/grpc++/support/status.h", - "include/grpc++/support/status_code_enum.h", - "include/grpc++/support/string_ref.h", - "include/grpc++/support/stub_options.h", - "include/grpc++/support/sync_stream.h", - "include/grpc++/support/time.h", - "src/cpp/client/channel.cc", - "src/cpp/client/client_context.cc", - "src/cpp/client/create_channel.cc", - "src/cpp/client/create_channel_internal.cc", - "src/cpp/client/create_channel_internal.h", - "src/cpp/client/credentials.cc", - "src/cpp/client/generic_stub.cc", - "src/cpp/client/insecure_credentials.cc", - "src/cpp/codegen/grpc_library.cc", - "src/cpp/common/alarm.cc", - "src/cpp/common/call.cc", - "src/cpp/common/channel_arguments.cc", - "src/cpp/common/completion_queue.cc", - "src/cpp/common/create_auth_context.h", - "src/cpp/common/insecure_create_auth_context.cc", - "src/cpp/common/rpc_method.cc", - "src/cpp/proto/proto_utils.cc", - "src/cpp/server/async_generic_service.cc", - "src/cpp/server/create_default_thread_pool.cc", - "src/cpp/server/dynamic_thread_pool.cc", - "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/insecure_server_credentials.cc", - "src/cpp/server/server.cc", - "src/cpp/server/server_builder.cc", - "src/cpp/server/server_context.cc", - "src/cpp/server/server_credentials.cc", - "src/cpp/server/thread_pool_interface.h", - "src/cpp/util/byte_buffer.cc", - "src/cpp/util/slice.cc", - "src/cpp/util/status.cc", - "src/cpp/util/string_ref.cc", - "src/cpp/util/time.cc" - ] + "headers": [], + "language": "csharp", + "name": "grpc_csharp_ext", + "src": [ + "src/csharp/ext/grpc_csharp_ext.c" + ], + "third_party": false, + "type": "lib" }, { "deps": [], "headers": [ - "include/grpc++/impl/codegen/async_stream.h", - "include/grpc++/impl/codegen/async_unary_call.h", - "include/grpc++/impl/codegen/call.h", - "include/grpc++/impl/codegen/call_hook.h", - "include/grpc++/impl/codegen/channel_interface.h", - "include/grpc++/impl/codegen/client_context.h", - "include/grpc++/impl/codegen/client_unary_call.h", - "include/grpc++/impl/codegen/completion_queue.h", - "include/grpc++/impl/codegen/completion_queue_tag.h", - "include/grpc++/impl/codegen/config.h", - "include/grpc++/impl/codegen/config_protobuf.h", - "include/grpc++/impl/codegen/grpc_library.h", - "include/grpc++/impl/codegen/method_handler_impl.h", - "include/grpc++/impl/codegen/proto_utils.h", - "include/grpc++/impl/codegen/rpc_method.h", - "include/grpc++/impl/codegen/rpc_service_method.h", - "include/grpc++/impl/codegen/security/auth_context.h", - "include/grpc++/impl/codegen/serialization_traits.h", - "include/grpc++/impl/codegen/server_context.h", - "include/grpc++/impl/codegen/server_interface.h", - "include/grpc++/impl/codegen/service_type.h", - "include/grpc++/impl/codegen/status.h", - "include/grpc++/impl/codegen/status_code_enum.h", - "include/grpc++/impl/codegen/string_ref.h", - "include/grpc++/impl/codegen/stub_options.h", - "include/grpc++/impl/codegen/sync.h", - "include/grpc++/impl/codegen/sync_cxx11.h", - "include/grpc++/impl/codegen/sync_no_cxx11.h", - "include/grpc++/impl/codegen/sync_stream.h", - "include/grpc++/impl/codegen/time.h", - "include/grpc++/support/config.h", - "include/grpc++/support/config_protobuf.h", - "include/grpc/impl/codegen/alloc.h", - "include/grpc/impl/codegen/atm.h", - "include/grpc/impl/codegen/atm_gcc_atomic.h", - "include/grpc/impl/codegen/atm_gcc_sync.h", - "include/grpc/impl/codegen/atm_win32.h", - "include/grpc/impl/codegen/byte_buffer.h", - "include/grpc/impl/codegen/compression_types.h", - "include/grpc/impl/codegen/connectivity_state.h", - "include/grpc/impl/codegen/grpc_types.h", - "include/grpc/impl/codegen/log.h", - "include/grpc/impl/codegen/port_platform.h", - "include/grpc/impl/codegen/propagation_bits.h", - "include/grpc/impl/codegen/slice.h", - "include/grpc/impl/codegen/slice_buffer.h", - "include/grpc/impl/codegen/status.h", - "include/grpc/impl/codegen/sync.h", - "include/grpc/impl/codegen/sync_generic.h", - "include/grpc/impl/codegen/sync_posix.h", - "include/grpc/impl/codegen/sync_win32.h", - "include/grpc/impl/codegen/time.h", - "src/compiler/config.h", - "src/compiler/cpp_generator.h", - "src/compiler/cpp_generator_helpers.h", - "src/compiler/csharp_generator.h", - "src/compiler/csharp_generator_helpers.h", - "src/compiler/generator_helpers.h", - "src/compiler/objective_c_generator.h", - "src/compiler/objective_c_generator_helpers.h", - "src/compiler/python_generator.h", - "src/compiler/ruby_generator.h", - "src/compiler/ruby_generator_helpers-inl.h", - "src/compiler/ruby_generator_map-inl.h", - "src/compiler/ruby_generator_string-inl.h" + "third_party/boringssl/crypto/aes/internal.h", + "third_party/boringssl/crypto/asn1/asn1_locl.h", + "third_party/boringssl/crypto/bio/internal.h", + "third_party/boringssl/crypto/bn/internal.h", + "third_party/boringssl/crypto/bn/rsaz_exp.h", + "third_party/boringssl/crypto/bytestring/internal.h", + "third_party/boringssl/crypto/cipher/internal.h", + "third_party/boringssl/crypto/conf/conf_def.h", + "third_party/boringssl/crypto/conf/internal.h", + "third_party/boringssl/crypto/des/internal.h", + "third_party/boringssl/crypto/dh/internal.h", + "third_party/boringssl/crypto/digest/internal.h", + "third_party/boringssl/crypto/digest/md32_common.h", + "third_party/boringssl/crypto/directory.h", + "third_party/boringssl/crypto/dsa/internal.h", + "third_party/boringssl/crypto/ec/internal.h", + "third_party/boringssl/crypto/ec/p256-x86_64-table.h", + "third_party/boringssl/crypto/evp/internal.h", + "third_party/boringssl/crypto/internal.h", + "third_party/boringssl/crypto/modes/internal.h", + "third_party/boringssl/crypto/obj/obj_dat.h", + "third_party/boringssl/crypto/obj/obj_xref.h", + "third_party/boringssl/crypto/pkcs8/internal.h", + "third_party/boringssl/crypto/rand/internal.h", + "third_party/boringssl/crypto/rsa/internal.h", + "third_party/boringssl/crypto/test/scoped_types.h", + "third_party/boringssl/crypto/test/test_util.h", + "third_party/boringssl/crypto/x509/charmap.h", + "third_party/boringssl/crypto/x509/vpm_int.h", + "third_party/boringssl/crypto/x509v3/ext_dat.h", + "third_party/boringssl/crypto/x509v3/pcy_int.h", + "third_party/boringssl/include/openssl/aead.h", + "third_party/boringssl/include/openssl/aes.h", + "third_party/boringssl/include/openssl/arm_arch.h", + "third_party/boringssl/include/openssl/asn1.h", + "third_party/boringssl/include/openssl/asn1_mac.h", + "third_party/boringssl/include/openssl/asn1t.h", + "third_party/boringssl/include/openssl/base.h", + "third_party/boringssl/include/openssl/base64.h", + "third_party/boringssl/include/openssl/bio.h", + "third_party/boringssl/include/openssl/blowfish.h", + "third_party/boringssl/include/openssl/bn.h", + "third_party/boringssl/include/openssl/buf.h", + "third_party/boringssl/include/openssl/buffer.h", + "third_party/boringssl/include/openssl/bytestring.h", + "third_party/boringssl/include/openssl/cast.h", + "third_party/boringssl/include/openssl/chacha.h", + "third_party/boringssl/include/openssl/cipher.h", + "third_party/boringssl/include/openssl/cmac.h", + "third_party/boringssl/include/openssl/conf.h", + "third_party/boringssl/include/openssl/cpu.h", + "third_party/boringssl/include/openssl/crypto.h", + "third_party/boringssl/include/openssl/curve25519.h", + "third_party/boringssl/include/openssl/des.h", + "third_party/boringssl/include/openssl/dh.h", + "third_party/boringssl/include/openssl/digest.h", + "third_party/boringssl/include/openssl/dsa.h", + "third_party/boringssl/include/openssl/dtls1.h", + "third_party/boringssl/include/openssl/ec.h", + "third_party/boringssl/include/openssl/ec_key.h", + "third_party/boringssl/include/openssl/ecdh.h", + "third_party/boringssl/include/openssl/ecdsa.h", + "third_party/boringssl/include/openssl/engine.h", + "third_party/boringssl/include/openssl/err.h", + "third_party/boringssl/include/openssl/evp.h", + "third_party/boringssl/include/openssl/ex_data.h", + "third_party/boringssl/include/openssl/hkdf.h", + "third_party/boringssl/include/openssl/hmac.h", + "third_party/boringssl/include/openssl/lhash.h", + "third_party/boringssl/include/openssl/lhash_macros.h", + "third_party/boringssl/include/openssl/md4.h", + "third_party/boringssl/include/openssl/md5.h", + "third_party/boringssl/include/openssl/mem.h", + "third_party/boringssl/include/openssl/obj.h", + "third_party/boringssl/include/openssl/obj_mac.h", + "third_party/boringssl/include/openssl/objects.h", + "third_party/boringssl/include/openssl/opensslfeatures.h", + "third_party/boringssl/include/openssl/opensslv.h", + "third_party/boringssl/include/openssl/ossl_typ.h", + "third_party/boringssl/include/openssl/pem.h", + "third_party/boringssl/include/openssl/pkcs12.h", + "third_party/boringssl/include/openssl/pkcs7.h", + "third_party/boringssl/include/openssl/pkcs8.h", + "third_party/boringssl/include/openssl/poly1305.h", + "third_party/boringssl/include/openssl/pqueue.h", + "third_party/boringssl/include/openssl/rand.h", + "third_party/boringssl/include/openssl/rc4.h", + "third_party/boringssl/include/openssl/rsa.h", + "third_party/boringssl/include/openssl/safestack.h", + "third_party/boringssl/include/openssl/sha.h", + "third_party/boringssl/include/openssl/srtp.h", + "third_party/boringssl/include/openssl/ssl.h", + "third_party/boringssl/include/openssl/ssl3.h", + "third_party/boringssl/include/openssl/stack.h", + "third_party/boringssl/include/openssl/stack_macros.h", + "third_party/boringssl/include/openssl/thread.h", + "third_party/boringssl/include/openssl/time_support.h", + "third_party/boringssl/include/openssl/tls1.h", + "third_party/boringssl/include/openssl/type_check.h", + "third_party/boringssl/include/openssl/x509.h", + "third_party/boringssl/include/openssl/x509_vfy.h", + "third_party/boringssl/include/openssl/x509v3.h", + "third_party/boringssl/ssl/internal.h", + "third_party/boringssl/ssl/test/async_bio.h", + "third_party/boringssl/ssl/test/packeted_bio.h", + "third_party/boringssl/ssl/test/scoped_types.h", + "third_party/boringssl/ssl/test/test_config.h" + ], + "language": "c", + "name": "boringssl", + "src": [ + "src/boringssl/err_data.c", + "third_party/boringssl/crypto/aes/aes.c", + "third_party/boringssl/crypto/aes/internal.h", + "third_party/boringssl/crypto/aes/mode_wrappers.c", + "third_party/boringssl/crypto/asn1/a_bitstr.c", + "third_party/boringssl/crypto/asn1/a_bool.c", + "third_party/boringssl/crypto/asn1/a_bytes.c", + "third_party/boringssl/crypto/asn1/a_d2i_fp.c", + "third_party/boringssl/crypto/asn1/a_dup.c", + "third_party/boringssl/crypto/asn1/a_enum.c", + "third_party/boringssl/crypto/asn1/a_gentm.c", + "third_party/boringssl/crypto/asn1/a_i2d_fp.c", + "third_party/boringssl/crypto/asn1/a_int.c", + "third_party/boringssl/crypto/asn1/a_mbstr.c", + "third_party/boringssl/crypto/asn1/a_object.c", + "third_party/boringssl/crypto/asn1/a_octet.c", + "third_party/boringssl/crypto/asn1/a_print.c", + "third_party/boringssl/crypto/asn1/a_strnid.c", + "third_party/boringssl/crypto/asn1/a_time.c", + "third_party/boringssl/crypto/asn1/a_type.c", + "third_party/boringssl/crypto/asn1/a_utctm.c", + "third_party/boringssl/crypto/asn1/a_utf8.c", + "third_party/boringssl/crypto/asn1/asn1_lib.c", + "third_party/boringssl/crypto/asn1/asn1_locl.h", + "third_party/boringssl/crypto/asn1/asn1_par.c", + "third_party/boringssl/crypto/asn1/asn_pack.c", + "third_party/boringssl/crypto/asn1/bio_asn1.c", + "third_party/boringssl/crypto/asn1/bio_ndef.c", + "third_party/boringssl/crypto/asn1/f_enum.c", + "third_party/boringssl/crypto/asn1/f_int.c", + "third_party/boringssl/crypto/asn1/f_string.c", + "third_party/boringssl/crypto/asn1/t_bitst.c", + "third_party/boringssl/crypto/asn1/t_pkey.c", + "third_party/boringssl/crypto/asn1/tasn_dec.c", + "third_party/boringssl/crypto/asn1/tasn_enc.c", + "third_party/boringssl/crypto/asn1/tasn_fre.c", + "third_party/boringssl/crypto/asn1/tasn_new.c", + "third_party/boringssl/crypto/asn1/tasn_prn.c", + "third_party/boringssl/crypto/asn1/tasn_typ.c", + "third_party/boringssl/crypto/asn1/tasn_utl.c", + "third_party/boringssl/crypto/asn1/x_bignum.c", + "third_party/boringssl/crypto/asn1/x_long.c", + "third_party/boringssl/crypto/base64/base64.c", + "third_party/boringssl/crypto/bio/bio.c", + "third_party/boringssl/crypto/bio/bio_mem.c", + "third_party/boringssl/crypto/bio/buffer.c", + "third_party/boringssl/crypto/bio/connect.c", + "third_party/boringssl/crypto/bio/fd.c", + "third_party/boringssl/crypto/bio/file.c", + "third_party/boringssl/crypto/bio/hexdump.c", + "third_party/boringssl/crypto/bio/internal.h", + "third_party/boringssl/crypto/bio/pair.c", + "third_party/boringssl/crypto/bio/printf.c", + "third_party/boringssl/crypto/bio/socket.c", + "third_party/boringssl/crypto/bio/socket_helper.c", + "third_party/boringssl/crypto/bn/add.c", + "third_party/boringssl/crypto/bn/asm/x86_64-gcc.c", + "third_party/boringssl/crypto/bn/bn.c", + "third_party/boringssl/crypto/bn/bn_asn1.c", + "third_party/boringssl/crypto/bn/cmp.c", + "third_party/boringssl/crypto/bn/convert.c", + "third_party/boringssl/crypto/bn/ctx.c", + "third_party/boringssl/crypto/bn/div.c", + "third_party/boringssl/crypto/bn/exponentiation.c", + "third_party/boringssl/crypto/bn/gcd.c", + "third_party/boringssl/crypto/bn/generic.c", + "third_party/boringssl/crypto/bn/internal.h", + "third_party/boringssl/crypto/bn/kronecker.c", + "third_party/boringssl/crypto/bn/montgomery.c", + "third_party/boringssl/crypto/bn/mul.c", + "third_party/boringssl/crypto/bn/prime.c", + "third_party/boringssl/crypto/bn/random.c", + "third_party/boringssl/crypto/bn/rsaz_exp.c", + "third_party/boringssl/crypto/bn/rsaz_exp.h", + "third_party/boringssl/crypto/bn/shift.c", + "third_party/boringssl/crypto/bn/sqrt.c", + "third_party/boringssl/crypto/buf/buf.c", + "third_party/boringssl/crypto/bytestring/ber.c", + "third_party/boringssl/crypto/bytestring/cbb.c", + "third_party/boringssl/crypto/bytestring/cbs.c", + "third_party/boringssl/crypto/bytestring/internal.h", + "third_party/boringssl/crypto/chacha/chacha_generic.c", + "third_party/boringssl/crypto/chacha/chacha_vec.c", + "third_party/boringssl/crypto/cipher/aead.c", + "third_party/boringssl/crypto/cipher/cipher.c", + "third_party/boringssl/crypto/cipher/derive_key.c", + "third_party/boringssl/crypto/cipher/e_aes.c", + "third_party/boringssl/crypto/cipher/e_chacha20poly1305.c", + "third_party/boringssl/crypto/cipher/e_des.c", + "third_party/boringssl/crypto/cipher/e_null.c", + "third_party/boringssl/crypto/cipher/e_rc2.c", + "third_party/boringssl/crypto/cipher/e_rc4.c", + "third_party/boringssl/crypto/cipher/e_ssl3.c", + "third_party/boringssl/crypto/cipher/e_tls.c", + "third_party/boringssl/crypto/cipher/internal.h", + "third_party/boringssl/crypto/cipher/tls_cbc.c", + "third_party/boringssl/crypto/cmac/cmac.c", + "third_party/boringssl/crypto/conf/conf.c", + "third_party/boringssl/crypto/conf/conf_def.h", + "third_party/boringssl/crypto/conf/internal.h", + "third_party/boringssl/crypto/cpu-arm.c", + "third_party/boringssl/crypto/cpu-intel.c", + "third_party/boringssl/crypto/crypto.c", + "third_party/boringssl/crypto/curve25519/curve25519.c", + "third_party/boringssl/crypto/des/des.c", + "third_party/boringssl/crypto/des/internal.h", + "third_party/boringssl/crypto/dh/check.c", + "third_party/boringssl/crypto/dh/dh.c", + "third_party/boringssl/crypto/dh/dh_asn1.c", + "third_party/boringssl/crypto/dh/internal.h", + "third_party/boringssl/crypto/dh/params.c", + "third_party/boringssl/crypto/digest/digest.c", + "third_party/boringssl/crypto/digest/digests.c", + "third_party/boringssl/crypto/digest/internal.h", + "third_party/boringssl/crypto/digest/md32_common.h", + "third_party/boringssl/crypto/directory.h", + "third_party/boringssl/crypto/directory_posix.c", + "third_party/boringssl/crypto/directory_win.c", + "third_party/boringssl/crypto/dsa/dsa.c", + "third_party/boringssl/crypto/dsa/dsa_asn1.c", + "third_party/boringssl/crypto/dsa/internal.h", + "third_party/boringssl/crypto/ec/ec.c", + "third_party/boringssl/crypto/ec/ec_asn1.c", + "third_party/boringssl/crypto/ec/ec_key.c", + "third_party/boringssl/crypto/ec/ec_montgomery.c", + "third_party/boringssl/crypto/ec/internal.h", + "third_party/boringssl/crypto/ec/oct.c", + "third_party/boringssl/crypto/ec/p224-64.c", + "third_party/boringssl/crypto/ec/p256-64.c", + "third_party/boringssl/crypto/ec/p256-x86_64-table.h", + "third_party/boringssl/crypto/ec/p256-x86_64.c", + "third_party/boringssl/crypto/ec/simple.c", + "third_party/boringssl/crypto/ec/util-64.c", + "third_party/boringssl/crypto/ec/wnaf.c", + "third_party/boringssl/crypto/ecdh/ecdh.c", + "third_party/boringssl/crypto/ecdsa/ecdsa.c", + "third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c", + "third_party/boringssl/crypto/engine/engine.c", + "third_party/boringssl/crypto/err/err.c", + "third_party/boringssl/crypto/evp/algorithm.c", + "third_party/boringssl/crypto/evp/digestsign.c", + "third_party/boringssl/crypto/evp/evp.c", + "third_party/boringssl/crypto/evp/evp_asn1.c", + "third_party/boringssl/crypto/evp/evp_ctx.c", + "third_party/boringssl/crypto/evp/internal.h", + "third_party/boringssl/crypto/evp/p_dsa_asn1.c", + "third_party/boringssl/crypto/evp/p_ec.c", + "third_party/boringssl/crypto/evp/p_ec_asn1.c", + "third_party/boringssl/crypto/evp/p_rsa.c", + "third_party/boringssl/crypto/evp/p_rsa_asn1.c", + "third_party/boringssl/crypto/evp/pbkdf.c", + "third_party/boringssl/crypto/evp/sign.c", + "third_party/boringssl/crypto/ex_data.c", + "third_party/boringssl/crypto/hkdf/hkdf.c", + "third_party/boringssl/crypto/hmac/hmac.c", + "third_party/boringssl/crypto/internal.h", + "third_party/boringssl/crypto/lhash/lhash.c", + "third_party/boringssl/crypto/md4/md4.c", + "third_party/boringssl/crypto/md5/md5.c", + "third_party/boringssl/crypto/mem.c", + "third_party/boringssl/crypto/modes/cbc.c", + "third_party/boringssl/crypto/modes/cfb.c", + "third_party/boringssl/crypto/modes/ctr.c", + "third_party/boringssl/crypto/modes/gcm.c", + "third_party/boringssl/crypto/modes/internal.h", + "third_party/boringssl/crypto/modes/ofb.c", + "third_party/boringssl/crypto/obj/obj.c", + "third_party/boringssl/crypto/obj/obj_dat.h", + "third_party/boringssl/crypto/obj/obj_xref.c", + "third_party/boringssl/crypto/obj/obj_xref.h", + "third_party/boringssl/crypto/pem/pem_all.c", + "third_party/boringssl/crypto/pem/pem_info.c", + "third_party/boringssl/crypto/pem/pem_lib.c", + "third_party/boringssl/crypto/pem/pem_oth.c", + "third_party/boringssl/crypto/pem/pem_pk8.c", + "third_party/boringssl/crypto/pem/pem_pkey.c", + "third_party/boringssl/crypto/pem/pem_x509.c", + "third_party/boringssl/crypto/pem/pem_xaux.c", + "third_party/boringssl/crypto/pkcs8/internal.h", + "third_party/boringssl/crypto/pkcs8/p5_pbe.c", + "third_party/boringssl/crypto/pkcs8/p5_pbev2.c", + "third_party/boringssl/crypto/pkcs8/p8_pkey.c", + "third_party/boringssl/crypto/pkcs8/pkcs8.c", + "third_party/boringssl/crypto/poly1305/poly1305.c", + "third_party/boringssl/crypto/poly1305/poly1305_arm.c", + "third_party/boringssl/crypto/poly1305/poly1305_vec.c", + "third_party/boringssl/crypto/rand/internal.h", + "third_party/boringssl/crypto/rand/rand.c", + "third_party/boringssl/crypto/rand/urandom.c", + "third_party/boringssl/crypto/rand/windows.c", + "third_party/boringssl/crypto/rc4/rc4.c", + "third_party/boringssl/crypto/refcount_c11.c", + "third_party/boringssl/crypto/refcount_lock.c", + "third_party/boringssl/crypto/rsa/blinding.c", + "third_party/boringssl/crypto/rsa/internal.h", + "third_party/boringssl/crypto/rsa/padding.c", + "third_party/boringssl/crypto/rsa/rsa.c", + "third_party/boringssl/crypto/rsa/rsa_asn1.c", + "third_party/boringssl/crypto/rsa/rsa_impl.c", + "third_party/boringssl/crypto/sha/sha1.c", + "third_party/boringssl/crypto/sha/sha256.c", + "third_party/boringssl/crypto/sha/sha512.c", + "third_party/boringssl/crypto/stack/stack.c", + "third_party/boringssl/crypto/test/scoped_types.h", + "third_party/boringssl/crypto/test/test_util.h", + "third_party/boringssl/crypto/thread.c", + "third_party/boringssl/crypto/thread_none.c", + "third_party/boringssl/crypto/thread_pthread.c", + "third_party/boringssl/crypto/thread_win.c", + "third_party/boringssl/crypto/time_support.c", + "third_party/boringssl/crypto/x509/a_digest.c", + "third_party/boringssl/crypto/x509/a_sign.c", + "third_party/boringssl/crypto/x509/a_strex.c", + "third_party/boringssl/crypto/x509/a_verify.c", + "third_party/boringssl/crypto/x509/asn1_gen.c", + "third_party/boringssl/crypto/x509/by_dir.c", + "third_party/boringssl/crypto/x509/by_file.c", + "third_party/boringssl/crypto/x509/charmap.h", + "third_party/boringssl/crypto/x509/i2d_pr.c", + "third_party/boringssl/crypto/x509/pkcs7.c", + "third_party/boringssl/crypto/x509/t_crl.c", + "third_party/boringssl/crypto/x509/t_req.c", + "third_party/boringssl/crypto/x509/t_x509.c", + "third_party/boringssl/crypto/x509/t_x509a.c", + "third_party/boringssl/crypto/x509/vpm_int.h", + "third_party/boringssl/crypto/x509/x509.c", + "third_party/boringssl/crypto/x509/x509_att.c", + "third_party/boringssl/crypto/x509/x509_cmp.c", + "third_party/boringssl/crypto/x509/x509_d2.c", + "third_party/boringssl/crypto/x509/x509_def.c", + "third_party/boringssl/crypto/x509/x509_ext.c", + "third_party/boringssl/crypto/x509/x509_lu.c", + "third_party/boringssl/crypto/x509/x509_obj.c", + "third_party/boringssl/crypto/x509/x509_r2x.c", + "third_party/boringssl/crypto/x509/x509_req.c", + "third_party/boringssl/crypto/x509/x509_set.c", + "third_party/boringssl/crypto/x509/x509_trs.c", + "third_party/boringssl/crypto/x509/x509_txt.c", + "third_party/boringssl/crypto/x509/x509_v3.c", + "third_party/boringssl/crypto/x509/x509_vfy.c", + "third_party/boringssl/crypto/x509/x509_vpm.c", + "third_party/boringssl/crypto/x509/x509cset.c", + "third_party/boringssl/crypto/x509/x509name.c", + "third_party/boringssl/crypto/x509/x509rset.c", + "third_party/boringssl/crypto/x509/x509spki.c", + "third_party/boringssl/crypto/x509/x509type.c", + "third_party/boringssl/crypto/x509/x_algor.c", + "third_party/boringssl/crypto/x509/x_all.c", + "third_party/boringssl/crypto/x509/x_attrib.c", + "third_party/boringssl/crypto/x509/x_crl.c", + "third_party/boringssl/crypto/x509/x_exten.c", + "third_party/boringssl/crypto/x509/x_info.c", + "third_party/boringssl/crypto/x509/x_name.c", + "third_party/boringssl/crypto/x509/x_pkey.c", + "third_party/boringssl/crypto/x509/x_pubkey.c", + "third_party/boringssl/crypto/x509/x_req.c", + "third_party/boringssl/crypto/x509/x_sig.c", + "third_party/boringssl/crypto/x509/x_spki.c", + "third_party/boringssl/crypto/x509/x_val.c", + "third_party/boringssl/crypto/x509/x_x509.c", + "third_party/boringssl/crypto/x509/x_x509a.c", + "third_party/boringssl/crypto/x509v3/ext_dat.h", + "third_party/boringssl/crypto/x509v3/pcy_cache.c", + "third_party/boringssl/crypto/x509v3/pcy_data.c", + "third_party/boringssl/crypto/x509v3/pcy_int.h", + "third_party/boringssl/crypto/x509v3/pcy_lib.c", + "third_party/boringssl/crypto/x509v3/pcy_map.c", + "third_party/boringssl/crypto/x509v3/pcy_node.c", + "third_party/boringssl/crypto/x509v3/pcy_tree.c", + "third_party/boringssl/crypto/x509v3/v3_akey.c", + "third_party/boringssl/crypto/x509v3/v3_akeya.c", + "third_party/boringssl/crypto/x509v3/v3_alt.c", + "third_party/boringssl/crypto/x509v3/v3_bcons.c", + "third_party/boringssl/crypto/x509v3/v3_bitst.c", + "third_party/boringssl/crypto/x509v3/v3_conf.c", + "third_party/boringssl/crypto/x509v3/v3_cpols.c", + "third_party/boringssl/crypto/x509v3/v3_crld.c", + "third_party/boringssl/crypto/x509v3/v3_enum.c", + "third_party/boringssl/crypto/x509v3/v3_extku.c", + "third_party/boringssl/crypto/x509v3/v3_genn.c", + "third_party/boringssl/crypto/x509v3/v3_ia5.c", + "third_party/boringssl/crypto/x509v3/v3_info.c", + "third_party/boringssl/crypto/x509v3/v3_int.c", + "third_party/boringssl/crypto/x509v3/v3_lib.c", + "third_party/boringssl/crypto/x509v3/v3_ncons.c", + "third_party/boringssl/crypto/x509v3/v3_pci.c", + "third_party/boringssl/crypto/x509v3/v3_pcia.c", + "third_party/boringssl/crypto/x509v3/v3_pcons.c", + "third_party/boringssl/crypto/x509v3/v3_pku.c", + "third_party/boringssl/crypto/x509v3/v3_pmaps.c", + "third_party/boringssl/crypto/x509v3/v3_prn.c", + "third_party/boringssl/crypto/x509v3/v3_purp.c", + "third_party/boringssl/crypto/x509v3/v3_skey.c", + "third_party/boringssl/crypto/x509v3/v3_sxnet.c", + "third_party/boringssl/crypto/x509v3/v3_utl.c", + "third_party/boringssl/include/openssl/aead.h", + "third_party/boringssl/include/openssl/aes.h", + "third_party/boringssl/include/openssl/arm_arch.h", + "third_party/boringssl/include/openssl/asn1.h", + "third_party/boringssl/include/openssl/asn1_mac.h", + "third_party/boringssl/include/openssl/asn1t.h", + "third_party/boringssl/include/openssl/base.h", + "third_party/boringssl/include/openssl/base64.h", + "third_party/boringssl/include/openssl/bio.h", + "third_party/boringssl/include/openssl/blowfish.h", + "third_party/boringssl/include/openssl/bn.h", + "third_party/boringssl/include/openssl/buf.h", + "third_party/boringssl/include/openssl/buffer.h", + "third_party/boringssl/include/openssl/bytestring.h", + "third_party/boringssl/include/openssl/cast.h", + "third_party/boringssl/include/openssl/chacha.h", + "third_party/boringssl/include/openssl/cipher.h", + "third_party/boringssl/include/openssl/cmac.h", + "third_party/boringssl/include/openssl/conf.h", + "third_party/boringssl/include/openssl/cpu.h", + "third_party/boringssl/include/openssl/crypto.h", + "third_party/boringssl/include/openssl/curve25519.h", + "third_party/boringssl/include/openssl/des.h", + "third_party/boringssl/include/openssl/dh.h", + "third_party/boringssl/include/openssl/digest.h", + "third_party/boringssl/include/openssl/dsa.h", + "third_party/boringssl/include/openssl/dtls1.h", + "third_party/boringssl/include/openssl/ec.h", + "third_party/boringssl/include/openssl/ec_key.h", + "third_party/boringssl/include/openssl/ecdh.h", + "third_party/boringssl/include/openssl/ecdsa.h", + "third_party/boringssl/include/openssl/engine.h", + "third_party/boringssl/include/openssl/err.h", + "third_party/boringssl/include/openssl/evp.h", + "third_party/boringssl/include/openssl/ex_data.h", + "third_party/boringssl/include/openssl/hkdf.h", + "third_party/boringssl/include/openssl/hmac.h", + "third_party/boringssl/include/openssl/lhash.h", + "third_party/boringssl/include/openssl/lhash_macros.h", + "third_party/boringssl/include/openssl/md4.h", + "third_party/boringssl/include/openssl/md5.h", + "third_party/boringssl/include/openssl/mem.h", + "third_party/boringssl/include/openssl/obj.h", + "third_party/boringssl/include/openssl/obj_mac.h", + "third_party/boringssl/include/openssl/objects.h", + "third_party/boringssl/include/openssl/opensslfeatures.h", + "third_party/boringssl/include/openssl/opensslv.h", + "third_party/boringssl/include/openssl/ossl_typ.h", + "third_party/boringssl/include/openssl/pem.h", + "third_party/boringssl/include/openssl/pkcs12.h", + "third_party/boringssl/include/openssl/pkcs7.h", + "third_party/boringssl/include/openssl/pkcs8.h", + "third_party/boringssl/include/openssl/poly1305.h", + "third_party/boringssl/include/openssl/pqueue.h", + "third_party/boringssl/include/openssl/rand.h", + "third_party/boringssl/include/openssl/rc4.h", + "third_party/boringssl/include/openssl/rsa.h", + "third_party/boringssl/include/openssl/safestack.h", + "third_party/boringssl/include/openssl/sha.h", + "third_party/boringssl/include/openssl/srtp.h", + "third_party/boringssl/include/openssl/ssl.h", + "third_party/boringssl/include/openssl/ssl3.h", + "third_party/boringssl/include/openssl/stack.h", + "third_party/boringssl/include/openssl/stack_macros.h", + "third_party/boringssl/include/openssl/thread.h", + "third_party/boringssl/include/openssl/time_support.h", + "third_party/boringssl/include/openssl/tls1.h", + "third_party/boringssl/include/openssl/type_check.h", + "third_party/boringssl/include/openssl/x509.h", + "third_party/boringssl/include/openssl/x509_vfy.h", + "third_party/boringssl/include/openssl/x509v3.h", + "third_party/boringssl/ssl/custom_extensions.c", + "third_party/boringssl/ssl/d1_both.c", + "third_party/boringssl/ssl/d1_clnt.c", + "third_party/boringssl/ssl/d1_lib.c", + "third_party/boringssl/ssl/d1_meth.c", + "third_party/boringssl/ssl/d1_pkt.c", + "third_party/boringssl/ssl/d1_srtp.c", + "third_party/boringssl/ssl/d1_srvr.c", + "third_party/boringssl/ssl/dtls_record.c", + "third_party/boringssl/ssl/internal.h", + "third_party/boringssl/ssl/pqueue/pqueue.c", + "third_party/boringssl/ssl/s3_both.c", + "third_party/boringssl/ssl/s3_clnt.c", + "third_party/boringssl/ssl/s3_enc.c", + "third_party/boringssl/ssl/s3_lib.c", + "third_party/boringssl/ssl/s3_meth.c", + "third_party/boringssl/ssl/s3_pkt.c", + "third_party/boringssl/ssl/s3_srvr.c", + "third_party/boringssl/ssl/ssl_aead_ctx.c", + "third_party/boringssl/ssl/ssl_asn1.c", + "third_party/boringssl/ssl/ssl_buffer.c", + "third_party/boringssl/ssl/ssl_cert.c", + "third_party/boringssl/ssl/ssl_cipher.c", + "third_party/boringssl/ssl/ssl_file.c", + "third_party/boringssl/ssl/ssl_lib.c", + "third_party/boringssl/ssl/ssl_rsa.c", + "third_party/boringssl/ssl/ssl_session.c", + "third_party/boringssl/ssl/ssl_stat.c", + "third_party/boringssl/ssl/t1_enc.c", + "third_party/boringssl/ssl/t1_lib.c", + "third_party/boringssl/ssl/test/async_bio.h", + "third_party/boringssl/ssl/test/packeted_bio.h", + "third_party/boringssl/ssl/test/scoped_types.h", + "third_party/boringssl/ssl/test/test_config.h", + "third_party/boringssl/ssl/tls_record.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [], + "headers": [], + "language": "c++", + "name": "boringssl_test_util", + "src": [ + "third_party/boringssl/crypto/test/file_test.cc", + "third_party/boringssl/crypto/test/malloc.cc", + "third_party/boringssl/crypto/test/test_util.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" ], + "headers": [], "language": "c++", - "name": "grpc_plugin_support", + "name": "boringssl_aes_test_lib", "src": [ - "include/grpc++/impl/codegen/async_stream.h", - "include/grpc++/impl/codegen/async_unary_call.h", - "include/grpc++/impl/codegen/call.h", - "include/grpc++/impl/codegen/call_hook.h", - "include/grpc++/impl/codegen/channel_interface.h", - "include/grpc++/impl/codegen/client_context.h", - "include/grpc++/impl/codegen/client_unary_call.h", - "include/grpc++/impl/codegen/completion_queue.h", - "include/grpc++/impl/codegen/completion_queue_tag.h", - "include/grpc++/impl/codegen/config.h", - "include/grpc++/impl/codegen/config_protobuf.h", - "include/grpc++/impl/codegen/grpc_library.h", - "include/grpc++/impl/codegen/method_handler_impl.h", - "include/grpc++/impl/codegen/proto_utils.h", - "include/grpc++/impl/codegen/rpc_method.h", - "include/grpc++/impl/codegen/rpc_service_method.h", - "include/grpc++/impl/codegen/security/auth_context.h", - "include/grpc++/impl/codegen/serialization_traits.h", - "include/grpc++/impl/codegen/server_context.h", - "include/grpc++/impl/codegen/server_interface.h", - "include/grpc++/impl/codegen/service_type.h", - "include/grpc++/impl/codegen/status.h", - "include/grpc++/impl/codegen/status_code_enum.h", - "include/grpc++/impl/codegen/string_ref.h", - "include/grpc++/impl/codegen/stub_options.h", - "include/grpc++/impl/codegen/sync.h", - "include/grpc++/impl/codegen/sync_cxx11.h", - "include/grpc++/impl/codegen/sync_no_cxx11.h", - "include/grpc++/impl/codegen/sync_stream.h", - "include/grpc++/impl/codegen/time.h", - "include/grpc++/support/config.h", - "include/grpc++/support/config_protobuf.h", - "include/grpc/impl/codegen/alloc.h", - "include/grpc/impl/codegen/atm.h", - "include/grpc/impl/codegen/atm_gcc_atomic.h", - "include/grpc/impl/codegen/atm_gcc_sync.h", - "include/grpc/impl/codegen/atm_win32.h", - "include/grpc/impl/codegen/byte_buffer.h", - "include/grpc/impl/codegen/compression_types.h", - "include/grpc/impl/codegen/connectivity_state.h", - "include/grpc/impl/codegen/grpc_types.h", - "include/grpc/impl/codegen/log.h", - "include/grpc/impl/codegen/port_platform.h", - "include/grpc/impl/codegen/propagation_bits.h", - "include/grpc/impl/codegen/slice.h", - "include/grpc/impl/codegen/slice_buffer.h", - "include/grpc/impl/codegen/status.h", - "include/grpc/impl/codegen/sync.h", - "include/grpc/impl/codegen/sync_generic.h", - "include/grpc/impl/codegen/sync_posix.h", - "include/grpc/impl/codegen/sync_win32.h", - "include/grpc/impl/codegen/time.h", - "src/compiler/config.h", - "src/compiler/cpp_generator.cc", - "src/compiler/cpp_generator.h", - "src/compiler/cpp_generator_helpers.h", - "src/compiler/csharp_generator.cc", - "src/compiler/csharp_generator.h", - "src/compiler/csharp_generator_helpers.h", - "src/compiler/generator_helpers.h", - "src/compiler/objective_c_generator.cc", - "src/compiler/objective_c_generator.h", - "src/compiler/objective_c_generator_helpers.h", - "src/compiler/python_generator.cc", - "src/compiler/python_generator.h", - "src/compiler/ruby_generator.cc", - "src/compiler/ruby_generator.h", - "src/compiler/ruby_generator_helpers-inl.h", - "src/compiler/ruby_generator_map-inl.h", - "src/compiler/ruby_generator_string-inl.h", - "src/cpp/codegen/grpc_library.cc" - ] + "third_party/boringssl/crypto/aes/aes_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_base64_test_lib", + "src": [ + "third_party/boringssl/crypto/base64/base64_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_bio_test_lib", + "src": [ + "third_party/boringssl/crypto/bio/bio_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_bn_test_lib", + "src": [ + "third_party/boringssl/crypto/bn/bn_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_bytestring_test_lib", + "src": [ + "third_party/boringssl/crypto/bytestring/bytestring_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_aead_test_lib", + "src": [ + "third_party/boringssl/crypto/cipher/aead_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_cipher_test_lib", + "src": [ + "third_party/boringssl/crypto/cipher/cipher_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_cmac_test_lib", + "src": [ + "third_party/boringssl/crypto/cmac/cmac_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_constant_time_test_lib", + "src": [ + "third_party/boringssl/crypto/constant_time_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_ed25519_test_lib", + "src": [ + "third_party/boringssl/crypto/curve25519/ed25519_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_x25519_test_lib", + "src": [ + "third_party/boringssl/crypto/curve25519/x25519_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_dh_test_lib", + "src": [ + "third_party/boringssl/crypto/dh/dh_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_digest_test_lib", + "src": [ + "third_party/boringssl/crypto/digest/digest_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_dsa_test_lib", + "src": [ + "third_party/boringssl/crypto/dsa/dsa_test.c" + ], + "third_party": true, + "type": "lib" }, { "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" + "boringssl", + "boringssl_test_util" ], - "headers": [ - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "test/cpp/interop/client_helper.h" + "headers": [], + "language": "c++", + "name": "boringssl_ec_test_lib", + "src": [ + "third_party/boringssl/crypto/ec/ec_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_example_mul_lib", + "src": [ + "third_party/boringssl/crypto/ec/example_mul.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" ], + "headers": [], "language": "c++", - "name": "interop_client_helper", + "name": "boringssl_ecdsa_test_lib", "src": [ - "test/cpp/interop/client_helper.cc", - "test/cpp/interop/client_helper.h" - ] + "third_party/boringssl/crypto/ecdsa/ecdsa_test.cc" + ], + "third_party": true, + "type": "lib" }, { "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "interop_client_helper" + "boringssl", + "boringssl_test_util" ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "test/cpp/interop/interop_client.h" + "headers": [], + "language": "c++", + "name": "boringssl_err_test_lib", + "src": [ + "third_party/boringssl/crypto/err/err_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" ], + "headers": [], "language": "c++", - "name": "interop_client_main", + "name": "boringssl_evp_extra_test_lib", "src": [ - "test/cpp/interop/client.cc", - "test/cpp/interop/interop_client.cc", - "test/cpp/interop/interop_client.h" - ] + "third_party/boringssl/crypto/evp/evp_extra_test.cc" + ], + "third_party": true, + "type": "lib" }, { "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc_test_util" + "boringssl", + "boringssl_test_util" ], - "headers": [ - "test/cpp/interop/server_helper.h" + "headers": [], + "language": "c++", + "name": "boringssl_evp_test_lib", + "src": [ + "third_party/boringssl/crypto/evp/evp_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" ], + "headers": [], "language": "c++", - "name": "interop_server_helper", + "name": "boringssl_pbkdf_test_lib", "src": [ - "test/cpp/interop/server_helper.cc", - "test/cpp/interop/server_helper.h" - ] + "third_party/boringssl/crypto/evp/pbkdf_test.cc" + ], + "third_party": true, + "type": "lib" }, { "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "interop_server_helper" + "boringssl", + "boringssl_test_util" ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h" + "headers": [], + "language": "c", + "name": "boringssl_hkdf_test_lib", + "src": [ + "third_party/boringssl/crypto/hkdf/hkdf_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" ], + "headers": [], "language": "c++", - "name": "interop_server_main", + "name": "boringssl_hmac_test_lib", "src": [ - "test/cpp/interop/server.cc" - ] + "third_party/boringssl/crypto/hmac/hmac_test.cc" + ], + "third_party": true, + "type": "lib" }, { "deps": [ - "grpc++", - "grpc++_test_util", - "grpc_test_util" + "boringssl", + "boringssl_test_util" ], - "headers": [ - "src/proto/grpc/testing/control.grpc.pb.h", - "src/proto/grpc/testing/control.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/payloads.grpc.pb.h", - "src/proto/grpc/testing/payloads.pb.h", - "src/proto/grpc/testing/perf_db.grpc.pb.h", - "src/proto/grpc/testing/perf_db.pb.h", - "src/proto/grpc/testing/services.grpc.pb.h", - "src/proto/grpc/testing/services.pb.h", - "src/proto/grpc/testing/stats.grpc.pb.h", - "src/proto/grpc/testing/stats.pb.h", - "test/cpp/qps/client.h", - "test/cpp/qps/driver.h", - "test/cpp/qps/histogram.h", - "test/cpp/qps/interarrival.h", - "test/cpp/qps/limit_cores.h", - "test/cpp/qps/perf_db_client.h", - "test/cpp/qps/qps_worker.h", - "test/cpp/qps/report.h", - "test/cpp/qps/server.h", - "test/cpp/qps/stats.h", - "test/cpp/qps/timer.h", - "test/cpp/util/benchmark_config.h" + "headers": [], + "language": "c", + "name": "boringssl_lhash_test_lib", + "src": [ + "third_party/boringssl/crypto/lhash/lhash_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_gcm_test_lib", + "src": [ + "third_party/boringssl/crypto/modes/gcm_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" ], + "headers": [], "language": "c++", - "name": "qps", + "name": "boringssl_pkcs12_test_lib", "src": [ - "test/cpp/qps/client.h", - "test/cpp/qps/client_async.cc", - "test/cpp/qps/client_sync.cc", - "test/cpp/qps/driver.cc", - "test/cpp/qps/driver.h", - "test/cpp/qps/histogram.h", - "test/cpp/qps/interarrival.h", - "test/cpp/qps/limit_cores.cc", - "test/cpp/qps/limit_cores.h", - "test/cpp/qps/perf_db_client.cc", - "test/cpp/qps/perf_db_client.h", - "test/cpp/qps/qps_worker.cc", - "test/cpp/qps/qps_worker.h", - "test/cpp/qps/report.cc", - "test/cpp/qps/report.h", - "test/cpp/qps/server.h", - "test/cpp/qps/server_async.cc", - "test/cpp/qps/server_sync.cc", - "test/cpp/qps/stats.h", - "test/cpp/qps/timer.cc", - "test/cpp/qps/timer.h", - "test/cpp/util/benchmark_config.cc", - "test/cpp/util/benchmark_config.h" - ] + "third_party/boringssl/crypto/pkcs8/pkcs12_test.cc" + ], + "third_party": true, + "type": "lib" }, { "deps": [ - "gpr", - "grpc" + "boringssl", + "boringssl_test_util" ], "headers": [], - "language": "csharp", - "name": "grpc_csharp_ext", + "language": "c++", + "name": "boringssl_pkcs8_test_lib", "src": [ - "src/csharp/ext/grpc_csharp_ext.c" - ] + "third_party/boringssl/crypto/pkcs8/pkcs8_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_poly1305_test_lib", + "src": [ + "third_party/boringssl/crypto/poly1305/poly1305_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_refcount_test_lib", + "src": [ + "third_party/boringssl/crypto/refcount_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_rsa_test_lib", + "src": [ + "third_party/boringssl/crypto/rsa/rsa_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_thread_test_lib", + "src": [ + "third_party/boringssl/crypto/thread_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_pkcs7_test_lib", + "src": [ + "third_party/boringssl/crypto/x509/pkcs7_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_tab_test_lib", + "src": [ + "third_party/boringssl/crypto/x509v3/tab_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_v3name_test_lib", + "src": [ + "third_party/boringssl/crypto/x509v3/v3name_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c", + "name": "boringssl_pqueue_test_lib", + "src": [ + "third_party/boringssl/ssl/pqueue/pqueue_test.c" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [ + "boringssl", + "boringssl_test_util" + ], + "headers": [], + "language": "c++", + "name": "boringssl_ssl_test_lib", + "src": [ + "third_party/boringssl/ssl/ssl_test.cc" + ], + "third_party": true, + "type": "lib" + }, + { + "deps": [], + "headers": [ + "third_party/zlib/crc32.h", + "third_party/zlib/deflate.h", + "third_party/zlib/gzguts.h", + "third_party/zlib/inffast.h", + "third_party/zlib/inffixed.h", + "third_party/zlib/inflate.h", + "third_party/zlib/inftrees.h", + "third_party/zlib/trees.h", + "third_party/zlib/zconf.h", + "third_party/zlib/zlib.h", + "third_party/zlib/zutil.h" + ], + "language": "c", + "name": "z", + "src": [ + "third_party/zlib/adler32.c", + "third_party/zlib/compress.c", + "third_party/zlib/crc32.c", + "third_party/zlib/crc32.h", + "third_party/zlib/deflate.c", + "third_party/zlib/deflate.h", + "third_party/zlib/gzclose.c", + "third_party/zlib/gzguts.h", + "third_party/zlib/gzlib.c", + "third_party/zlib/gzread.c", + "third_party/zlib/gzwrite.c", + "third_party/zlib/infback.c", + "third_party/zlib/inffast.c", + "third_party/zlib/inffast.h", + "third_party/zlib/inffixed.h", + "third_party/zlib/inflate.c", + "third_party/zlib/inflate.h", + "third_party/zlib/inftrees.c", + "third_party/zlib/inftrees.h", + "third_party/zlib/trees.c", + "third_party/zlib/trees.h", + "third_party/zlib/uncompr.c", + "third_party/zlib/zconf.h", + "third_party/zlib/zlib.h", + "third_party/zlib/zutil.c", + "third_party/zlib/zutil.h" + ], + "third_party": true, + "type": "lib" }, { "deps": [ @@ -4736,7 +6712,9 @@ "src": [ "test/core/bad_client/bad_client.c", "test/core/bad_client/bad_client.h" - ] + ], + "third_party": false, + "type": "lib" }, { "deps": [ @@ -4746,14 +6724,16 @@ "grpc_test_util" ], "headers": [ - "test/core/bad_ssl/server.h" + "test/core/bad_ssl/server_common.h" ], "language": "c", "name": "bad_ssl_test_server", "src": [ - "test/core/bad_ssl/server.c", - "test/core/bad_ssl/server.h" - ] + "test/core/bad_ssl/server_common.c", + "test/core/bad_ssl/server_common.h" + ], + "third_party": false, + "type": "lib" }, { "deps": [ @@ -4782,9 +6762,8 @@ "test/core/end2end/tests/cancel_in_a_vacuum.c", "test/core/end2end/tests/cancel_test_helpers.h", "test/core/end2end/tests/cancel_with_status.c", - "test/core/end2end/tests/channel_connectivity.c", - "test/core/end2end/tests/channel_ping.c", "test/core/end2end/tests/compressed_payload.c", + "test/core/end2end/tests/connectivity.c", "test/core/end2end/tests/default_host.c", "test/core/end2end/tests/disappearing_server.c", "test/core/end2end/tests/empty_batch.c", @@ -4795,10 +6774,10 @@ "test/core/end2end/tests/large_metadata.c", "test/core/end2end/tests/max_concurrent_streams.c", "test/core/end2end/tests/max_message_length.c", - "test/core/end2end/tests/metadata.c", "test/core/end2end/tests/negative_deadline.c", "test/core/end2end/tests/no_op.c", "test/core/end2end/tests/payload.c", + "test/core/end2end/tests/ping.c", "test/core/end2end/tests/ping_pong_streaming.c", "test/core/end2end/tests/registered_call.c", "test/core/end2end/tests/request_with_flags.c", @@ -4807,9 +6786,12 @@ "test/core/end2end/tests/shutdown_finishes_calls.c", "test/core/end2end/tests/shutdown_finishes_tags.c", "test/core/end2end/tests/simple_delayed_request.c", + "test/core/end2end/tests/simple_metadata.c", "test/core/end2end/tests/simple_request.c", "test/core/end2end/tests/trailing_metadata.c" - ] + ], + "third_party": false, + "type": "lib" }, { "deps": [ @@ -4836,9 +6818,8 @@ "test/core/end2end/tests/cancel_in_a_vacuum.c", "test/core/end2end/tests/cancel_test_helpers.h", "test/core/end2end/tests/cancel_with_status.c", - "test/core/end2end/tests/channel_connectivity.c", - "test/core/end2end/tests/channel_ping.c", "test/core/end2end/tests/compressed_payload.c", + "test/core/end2end/tests/connectivity.c", "test/core/end2end/tests/default_host.c", "test/core/end2end/tests/disappearing_server.c", "test/core/end2end/tests/empty_batch.c", @@ -4849,10 +6830,10 @@ "test/core/end2end/tests/large_metadata.c", "test/core/end2end/tests/max_concurrent_streams.c", "test/core/end2end/tests/max_message_length.c", - "test/core/end2end/tests/metadata.c", "test/core/end2end/tests/negative_deadline.c", "test/core/end2end/tests/no_op.c", "test/core/end2end/tests/payload.c", + "test/core/end2end/tests/ping.c", "test/core/end2end/tests/ping_pong_streaming.c", "test/core/end2end/tests/registered_call.c", "test/core/end2end/tests/request_with_flags.c", @@ -4861,9 +6842,12 @@ "test/core/end2end/tests/shutdown_finishes_calls.c", "test/core/end2end/tests/shutdown_finishes_tags.c", "test/core/end2end/tests/simple_delayed_request.c", + "test/core/end2end/tests/simple_metadata.c", "test/core/end2end/tests/simple_request.c", "test/core/end2end/tests/trailing_metadata.c" - ] + ], + "third_party": false, + "type": "lib" }, { "deps": [], @@ -4874,6 +6858,8 @@ "test/core/end2end/data/server1_cert.c", "test/core/end2end/data/server1_key.c", "test/core/end2end/data/test_root_cert.c" - ] + ], + "third_party": false, + "type": "lib" } ] -- cgit v1.2.3