]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/libcephfs: Test rename error cases
authorSam Lang <sam.lang@inktank.com>
Fri, 22 Mar 2013 20:23:21 +0000 (15:23 -0500)
committerSage Weil <sage@inktank.com>
Sat, 23 Mar 2013 18:03:55 +0000 (11:03 -0700)
Make sure that rename fails with the ENOENT
if the source path doesn't exist.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/test/libcephfs/test.cc

index ff7ee14c26a4f5cdc12179e86e2a2dc17ec8b7e7..6022fc5e06a96bc04abc46bb4591a26bebcd4466 100644 (file)
@@ -848,6 +848,9 @@ TEST(LibCephFS, Rename) {
   /* test that src path doesn't exist */
   ASSERT_EQ(-ENOENT, ceph_lstat(cmount, path_src, &st));
 
+  /* rename with non-existent source path */
+  ASSERT_EQ(-ENOENT, ceph_rename(cmount, path_src, path_dst));
+
   ASSERT_EQ(0, ceph_unlink(cmount, path_dst));
   ceph_shutdown(cmount);
 }