]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: add test for removing non-existent xattr 40371/head
authorJeff Layton <jlayton@redhat.com>
Tue, 16 Mar 2021 15:14:28 +0000 (11:14 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 24 Mar 2021 15:57:06 +0000 (08:57 -0700)
We should get back -ENODATA.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit b94b668b7e340fa660462b75c97ab77dda9d5273)

src/test/libcephfs/test.cc

index e74e99740979423051760268f1641f8a6cfc1e61..f14a4605e1371ded5eca5ab795fd9204c6ded529 100644 (file)
@@ -540,6 +540,9 @@ TEST(LibCephFS, Xattrs) {
   int fd = ceph_open(cmount, test_xattr_file, O_CREAT, 0666);
   ASSERT_GT(fd, 0);
 
+  // test removing non-existent xattr
+  ASSERT_EQ(-ENODATA, ceph_removexattr(cmount, test_xattr_file, "user.nosuchxattr"));
+
   char i = 'a';
   char xattrk[128];
   char xattrv[128];