Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/ceph_crypto: do not read ceph.conf in global_init() #12318

Merged
1 commit merged into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,6 @@ target_link_libraries(unittest_perf_counters global)
# unittest_ceph_crypto
add_executable(unittest_ceph_crypto
ceph_crypto.cc
$<TARGET_OBJECTS:unit-main>
)
add_ceph_unittest(unittest_ceph_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_crypto)
target_link_libraries(unittest_ceph_crypto global)
Expand Down
15 changes: 15 additions & 0 deletions src/test/ceph_crypto.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "gtest/gtest.h"
#include "common/ceph_argparse.h"
#include "common/ceph_crypto.h"
#include "common/common_init.h"
#include "global/global_init.h"
#include "global/global_context.h"

class CryptoEnvironment: public ::testing::Environment {
Expand Down Expand Up @@ -138,3 +141,15 @@ TEST_F(ForkDeathTest, MD5) {
ASSERT_EXIT(do_simple_crypto(), ::testing::ExitedWithCode(0), "^$");
}
#endif //GTEST_HAS_DEATH_TEST

int main(int argc, char **argv) {
std::vector<const char*> args(argv, argv + argc);
env_to_vec(args);
auto cct = global_init(NULL, args,
CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY,
CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
common_init_finish(g_ceph_context);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}