summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-06-17 14:43:36 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-07-23 17:35:59 +0100
commit0a7e454008d3a66327ea75ebe83ce77869610543 (patch)
tree3ae6a990d60b87f0da8d4c0243c0a74941fd5212
parentf59821dde89aaaf85b429b9523043ff9a679969e (diff)
downloadceph-0a7e454008d3a66327ea75ebe83ce77869610543.tar.gz
test: test_store_tool: global init before using LevelDBStorewip-5704
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/test/ObjectMap/test_store_tool/test_store_tool.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/test/ObjectMap/test_store_tool/test_store_tool.cc b/src/test/ObjectMap/test_store_tool/test_store_tool.cc
index 4ab62892880..ace91220df6 100644
--- a/src/test/ObjectMap/test_store_tool/test_store_tool.cc
+++ b/src/test/ObjectMap/test_store_tool/test_store_tool.cc
@@ -19,6 +19,12 @@
#include "os/LevelDBStore.h"
+#include "common/ceph_argparse.h"
+#include "global/global_init.h"
+#include "common/errno.h"
+#include "common/safe_io.h"
+#include "common/config.h"
+
using namespace std;
class StoreTool
@@ -98,15 +104,27 @@ void usage(const char *pname)
<< std::endl;
}
-int main(int argc, char *argv[])
+int main(int argc, const char *argv[])
{
- if (argc < 3) {
+ vector<const char*> args;
+ argv_to_vec(argc, argv, args);
+ env_to_vec(args);
+
+ global_init(
+ NULL, args,
+ CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
+ common_init_finish(g_ceph_context);
+
+
+ if (args.size() < 2) {
usage(argv[0]);
return 1;
}
- string path(argv[1]);
- string cmd(argv[2]);
+ string path(args[0]);
+ string cmd(args[1]);
+
+ std::cout << "path: " << path << " cmd " << cmd << std::endl;
StoreTool st(path);