Stub out end2end tests

reviewable/pr8239/r2
Craig Tiller 8 years ago
parent ed9dc8d956
commit 82509936ae
  1. 4
      Makefile
  2. 2
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  3. 16
      test/core/end2end/end2end_nosec_tests.c
  4. 16
      test/core/end2end/end2end_tests.c
  5. 2
      test/core/end2end/gen_build_yaml.py
  6. 105
      test/core/end2end/tests/buffer_pool_client.c
  7. 105
      test/core/end2end/tests/buffer_pool_server.c
  8. 4
      tools/run_tests/sources_and_headers.json
  9. 1372
      tools/run_tests/tests.json
  10. 4
      vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj
  11. 6
      vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj.filters
  12. 4
      vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj
  13. 6
      vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj.filters

@ -6760,6 +6760,8 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/end2end_tests.c \
test/core/end2end/tests/bad_hostname.c \
test/core/end2end/tests/binary_metadata.c \
test/core/end2end/tests/buffer_pool_client.c \
test/core/end2end/tests/buffer_pool_server.c \
test/core/end2end/tests/call_creds.c \
test/core/end2end/tests/cancel_after_accept.c \
test/core/end2end/tests/cancel_after_client_done.c \
@ -6843,6 +6845,8 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/end2end_nosec_tests.c \
test/core/end2end/tests/bad_hostname.c \
test/core/end2end/tests/binary_metadata.c \
test/core/end2end/tests/buffer_pool_client.c \
test/core/end2end/tests/buffer_pool_server.c \
test/core/end2end/tests/cancel_after_accept.c \
test/core/end2end/tests/cancel_after_client_done.c \
test/core/end2end/tests/cancel_after_invoke.c \

@ -359,7 +359,7 @@ extern grpc_buffer_pool_unref_type grpc_buffer_pool_unref_import;
typedef void(*grpc_buffer_pool_resize_type)(grpc_buffer_pool *buffer_pool, size_t new_size);
extern grpc_buffer_pool_resize_type grpc_buffer_pool_resize_import;
#define grpc_buffer_pool_resize grpc_buffer_pool_resize_import
typedef grpc_arg_pointer_vtable *(*grpc_buffer_pool_arg_vtable_type)(void);
typedef const grpc_arg_pointer_vtable *(*grpc_buffer_pool_arg_vtable_type)(void);
extern grpc_buffer_pool_arg_vtable_type grpc_buffer_pool_arg_vtable_import;
#define grpc_buffer_pool_arg_vtable grpc_buffer_pool_arg_vtable_import
typedef grpc_channel *(*grpc_insecure_channel_create_from_fd_type)(const char *target, int fd, const grpc_channel_args *args);

@ -47,6 +47,10 @@ extern void bad_hostname(grpc_end2end_test_config config);
extern void bad_hostname_pre_init(void);
extern void binary_metadata(grpc_end2end_test_config config);
extern void binary_metadata_pre_init(void);
extern void buffer_pool_client(grpc_end2end_test_config config);
extern void buffer_pool_client_pre_init(void);
extern void buffer_pool_server(grpc_end2end_test_config config);
extern void buffer_pool_server_pre_init(void);
extern void cancel_after_accept(grpc_end2end_test_config config);
extern void cancel_after_accept_pre_init(void);
extern void cancel_after_client_done(grpc_end2end_test_config config);
@ -135,6 +139,8 @@ void grpc_end2end_tests_pre_init(void) {
g_pre_init_called = true;
bad_hostname_pre_init();
binary_metadata_pre_init();
buffer_pool_client_pre_init();
buffer_pool_server_pre_init();
cancel_after_accept_pre_init();
cancel_after_client_done_pre_init();
cancel_after_invoke_pre_init();
@ -187,6 +193,8 @@ void grpc_end2end_tests(int argc, char **argv,
if (argc <= 1) {
bad_hostname(config);
binary_metadata(config);
buffer_pool_client(config);
buffer_pool_server(config);
cancel_after_accept(config);
cancel_after_client_done(config);
cancel_after_invoke(config);
@ -240,6 +248,14 @@ void grpc_end2end_tests(int argc, char **argv,
binary_metadata(config);
continue;
}
if (0 == strcmp("buffer_pool_client", argv[i])) {
buffer_pool_client(config);
continue;
}
if (0 == strcmp("buffer_pool_server", argv[i])) {
buffer_pool_server(config);
continue;
}
if (0 == strcmp("cancel_after_accept", argv[i])) {
cancel_after_accept(config);
continue;

@ -47,6 +47,10 @@ extern void bad_hostname(grpc_end2end_test_config config);
extern void bad_hostname_pre_init(void);
extern void binary_metadata(grpc_end2end_test_config config);
extern void binary_metadata_pre_init(void);
extern void buffer_pool_client(grpc_end2end_test_config config);
extern void buffer_pool_client_pre_init(void);
extern void buffer_pool_server(grpc_end2end_test_config config);
extern void buffer_pool_server_pre_init(void);
extern void call_creds(grpc_end2end_test_config config);
extern void call_creds_pre_init(void);
extern void cancel_after_accept(grpc_end2end_test_config config);
@ -137,6 +141,8 @@ void grpc_end2end_tests_pre_init(void) {
g_pre_init_called = true;
bad_hostname_pre_init();
binary_metadata_pre_init();
buffer_pool_client_pre_init();
buffer_pool_server_pre_init();
call_creds_pre_init();
cancel_after_accept_pre_init();
cancel_after_client_done_pre_init();
@ -190,6 +196,8 @@ void grpc_end2end_tests(int argc, char **argv,
if (argc <= 1) {
bad_hostname(config);
binary_metadata(config);
buffer_pool_client(config);
buffer_pool_server(config);
call_creds(config);
cancel_after_accept(config);
cancel_after_client_done(config);
@ -244,6 +252,14 @@ void grpc_end2end_tests(int argc, char **argv,
binary_metadata(config);
continue;
}
if (0 == strcmp("buffer_pool_client", argv[i])) {
buffer_pool_client(config);
continue;
}
if (0 == strcmp("buffer_pool_server", argv[i])) {
buffer_pool_server(config);
continue;
}
if (0 == strcmp("call_creds", argv[i])) {
call_creds(config);
continue;

@ -88,6 +88,8 @@ LOWCPU = 0.1
END2END_TESTS = {
'bad_hostname': default_test_options,
'binary_metadata': default_test_options,
'buffer_pool_client': default_test_options,
'buffer_pool_server': default_test_options,
'call_creds': default_test_options._replace(secure=True),
'cancel_after_accept': default_test_options._replace(cpu_cost=LOWCPU),
'cancel_after_client_done': default_test_options,

@ -0,0 +1,105 @@
/*
*
* Copyright 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 "test/core/end2end/end2end_tests.h"
#include <stdio.h>
#include <string.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
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);
}
void buffer_pool_client(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f =
begin_test(config, "buffer_pool_client", NULL, NULL);
end_test(&f);
config.tear_down_data(&f);
}
void buffer_pool_client_pre_init(void) {}

@ -0,0 +1,105 @@
/*
*
* Copyright 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 "test/core/end2end/end2end_tests.h"
#include <stdio.h>
#include <string.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
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);
}
void buffer_pool_server(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f =
begin_test(config, "buffer_pool_server", NULL, NULL);
end_test(&f);
config.tear_down_data(&f);
}
void buffer_pool_server_pre_init(void) {}

@ -5636,6 +5636,8 @@
"test/core/end2end/end2end_tests.h",
"test/core/end2end/tests/bad_hostname.c",
"test/core/end2end/tests/binary_metadata.c",
"test/core/end2end/tests/buffer_pool_client.c",
"test/core/end2end/tests/buffer_pool_server.c",
"test/core/end2end/tests/call_creds.c",
"test/core/end2end/tests/cancel_after_accept.c",
"test/core/end2end/tests/cancel_after_client_done.c",
@ -5701,6 +5703,8 @@
"test/core/end2end/end2end_tests.h",
"test/core/end2end/tests/bad_hostname.c",
"test/core/end2end/tests/binary_metadata.c",
"test/core/end2end/tests/buffer_pool_client.c",
"test/core/end2end/tests/buffer_pool_server.c",
"test/core/end2end/tests/cancel_after_accept.c",
"test/core/end2end/tests/cancel_after_client_done.c",
"test/core/end2end/tests/cancel_after_invoke.c",

File diff suppressed because it is too large Load Diff

@ -157,6 +157,10 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\binary_metadata.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_client.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_server.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\cancel_after_accept.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\cancel_after_client_done.c">

@ -10,6 +10,12 @@
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\binary_metadata.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_client.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_server.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\cancel_after_accept.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>

@ -157,6 +157,10 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\binary_metadata.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_client.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_server.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\call_creds.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\cancel_after_accept.c">

@ -10,6 +10,12 @@
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\binary_metadata.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_client.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\buffer_pool_server.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\call_creds.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>

Loading…
Cancel
Save