]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: add ceph_mksnap and ceph_rmsnap replacements 40768/head
authorJeff Layton <jlayton@redhat.com>
Wed, 26 May 2021 11:05:13 +0000 (07:05 -0400)
committerNathan Cutler <ncutler@suse.com>
Thu, 27 May 2021 15:26:31 +0000 (17:26 +0200)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/test/libcephfs/test.cc

index 4b5e977dde96bcd83be6b5bc45f7e9e64015f631..13239b3acba304be598ad3916efd1eec707d98f7 100644 (file)
@@ -2463,6 +2463,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);