]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: take keys in test
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 8 Sep 2015 23:12:24 +0000 (19:12 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 16:57:54 +0000 (11:57 -0500)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/test/librgw_file.cc

index 4fa07ccc6f44b4504d3e944a934ca9ca1c1f46db..930351046f977e23dd08f05933ac8d721c5df3b0 100644 (file)
@@ -24,6 +24,8 @@
 
 namespace {
   librgw_t rgw = nullptr;
+  string access_key("C4B4D3E4H355VTDTQXRF");
+  string secret_key("NRBkhM2rUZNUbydD86HpNJ110VpQjVroumCOHJXw");
 }
 
 TEST(LibRGW, INIT) {
@@ -38,6 +40,24 @@ TEST(LibRGW, SHUTDOWN) {
 
 int main(int argc, char *argv[])
 {
+  string val;
+  vector<const char*> args;
+
+  argv_to_vec(argc, const_cast<const char**>(argv), args);
+  env_to_vec(args);
+
+  for (auto arg_iter = args.begin(); arg_iter != args.end();) {
+    if (ceph_argparse_witharg(args, arg_iter, &val, "--access",
+                             (char*) NULL)) {
+      access_key = val;
+    } else if (ceph_argparse_witharg(args, arg_iter, &val, "--secret",
+                                    (char*) NULL)) {
+      secret_key = val;
+    } else {
+      ++arg_iter;
+    }
+  }
+
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
 }