X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftest%2Frgw%2Ftest_http_manager.cc;fp=src%2Fceph%2Fsrc%2Ftest%2Frgw%2Ftest_http_manager.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=7c3da281ab38a338e49484239d226a8c3c65ef35;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/test/rgw/test_http_manager.cc b/src/ceph/src/test/rgw/test_http_manager.cc deleted file mode 100644 index 7c3da28..0000000 --- a/src/ceph/src/test/rgw/test_http_manager.cc +++ /dev/null @@ -1,60 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2015 Red Hat - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ -#include "rgw/rgw_rados.h" -#include "rgw/rgw_http_client.h" -#include "global/global_init.h" -#include "common/ceph_argparse.h" -#include -#include - -TEST(HTTPManager, SignalThread) -{ - auto cct = g_ceph_context; - RGWHTTPManager http(cct); - - ASSERT_EQ(0, http.set_threaded()); - - // default pipe buffer size according to man pipe - constexpr size_t max_pipe_buffer_size = 65536; - // each signal writes 4 bytes to the pipe - constexpr size_t max_pipe_signals = max_pipe_buffer_size / sizeof(uint32_t); - // add_request and unregister_request - constexpr size_t pipe_signals_per_request = 2; - // number of http requests to fill the pipe buffer - constexpr size_t max_requests = max_pipe_signals / pipe_signals_per_request; - - // send one extra request to test that we don't deadlock - constexpr size_t num_requests = max_requests + 1; - - for (size_t i = 0; i < num_requests; i++) { - RGWHTTPClient client{cct}; - http.add_request(&client, "PUT", "http://127.0.0.1:80"); - } -} - -int main(int argc, char** argv) -{ - vector args; - argv_to_vec(argc, (const char **)argv, args); - - auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, - CODE_ENVIRONMENT_UTILITY, 0); - common_init_finish(g_ceph_context); - - curl_global_init(CURL_GLOBAL_ALL); - ::testing::InitGoogleTest(&argc, argv); - int r = RUN_ALL_TESTS(); - curl_global_cleanup(); - return r; -}