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

index 930351046f977e23dd08f05933ac8d721c5df3b0..0fc48a9e6691466ff57cfba516b1ad7f04145194 100644 (file)
 
 namespace {
   librgw_t rgw = nullptr;
+  string uid("testuser");
   string access_key("C4B4D3E4H355VTDTQXRF");
   string secret_key("NRBkhM2rUZNUbydD86HpNJ110VpQjVroumCOHJXw");
+  struct rgw_fs *fs = nullptr;
 }
 
 TEST(LibRGW, INIT) {
@@ -34,6 +36,18 @@ TEST(LibRGW, INIT) {
   ASSERT_NE(rgw, nullptr);
 }
 
+TEST(LibRGW, MOUNT) {
+  int ret = rgw_mount(uid.c_str(), access_key.c_str(), secret_key.c_str(),
+                     &fs);
+  ASSERT_EQ(ret, 0);
+  ASSERT_NE(fs, nullptr);
+}
+
+TEST(LibRGW, UMOUNT) {
+  int ret = rgw_umount(fs);
+  ASSERT_EQ(ret, 0);
+}
+
 TEST(LibRGW, SHUTDOWN) {
   librgw_shutdown(rgw);
 }
@@ -53,7 +67,11 @@ int main(int argc, char *argv[])
     } else if (ceph_argparse_witharg(args, arg_iter, &val, "--secret",
                                     (char*) NULL)) {
       secret_key = val;
-    } else {
+    } else if (ceph_argparse_witharg(args, arg_iter, &val, "--uid",
+                                    (char*) NULL)) {
+      uid = val;
+    }
+    else {
       ++arg_iter;
     }
   }