]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: add ceph_mksnap and ceph_rmsnap replacements 40769/head
authorJeff Layton <jlayton@redhat.com>
Wed, 26 May 2021 11:05:13 +0000 (07:05 -0400)
committerJeff Layton <jlayton@redhat.com>
Thu, 27 May 2021 14:16:04 +0000 (10:16 -0400)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/test/libcephfs/test.cc

index 2eb911f7c94b8d9e80a6a228f77d6fceaf016e8d..ae1114990454248ea6a5b8854b47dd774aac7f2b 100644 (file)
@@ -2471,6 +2471,23 @@ TEST(LibCephFS, Lseek) {
   ceph_shutdown(cmount);
 }
 
+static int ceph_mksnap(struct ceph_mount_info *cmount, const char *path, const char *name,
+                      mode_t mode, void *unused, size_t nr_unused)
+{
+  char snap_path[PATH_MAX];
+
+  sprintf(snap_path, "%s/.snap/%s", path, name);
+  return ceph_mkdir(cmount, snap_path, mode);
+}
+
+static int ceph_rmsnap(struct ceph_mount_info *cmount, const char *path, const char *name)
+{
+  char snap_path[PATH_MAX];
+
+  sprintf(snap_path, "%s/.snap/%s", path, name);
+  return ceph_rmdir(cmount, snap_path);
+}
+
 TEST(LibCephFS, LookupVino) {
   struct ceph_mount_info *cmount;
   ASSERT_EQ(ceph_create(&cmount, NULL), 0);