From 5f193a9955e4364215a3b9dc4134da8767903e7e Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 16 Mar 2021 11:14:28 -0400 Subject: [PATCH] test: add test for removing non-existent xattr We should get back -ENODATA. Signed-off-by: Jeff Layton (cherry picked from commit b94b668b7e340fa660462b75c97ab77dda9d5273) --- src/test/libcephfs/test.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index e74e997409794..f14a4605e1371 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -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]; -- 2.39.5