]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Add statfs test case for mixed quotas 65918/head
authorChristopher Hoffman <choffman@redhat.com>
Fri, 10 Oct 2025 15:10:33 +0000 (15:10 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Mon, 13 Oct 2025 16:04:39 +0000 (16:04 +0000)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/test/libcephfs/test.cc

index 38740c5d916c7b7c0d389ee29ebc9bea9a257355..7609cf9d896e4d3dcdb0d589e5b9241ea7a33087 100644 (file)
@@ -1031,6 +1031,7 @@ TEST(LibCephFS, StatfsQuota) {
 
   ASSERT_EQ(0, ceph_mkdir(cmount, quota_dir, 0777));
   EXPECT_EQ(0, ceph_setxattr(cmount, quota_dir, "ceph.quota.max_files", "10000", 05, 0));
+  EXPECT_EQ(0, ceph_setxattr(cmount, "/", "ceph.quota.max_bytes", "20G", 03, 0));
 
   const int num_quota_files = 1;
   char quota_file[256];
@@ -1059,6 +1060,7 @@ TEST(LibCephFS, StatfsQuota) {
   struct statvfs reg_stvbuf;
   ASSERT_EQ(0, ceph_statfs(cmount, "test_statfs_regular_1", &reg_stvbuf));
   ASSERT_GT(reg_stvbuf.f_files, quota_stvbuf.f_files);
+  ASSERT_EQ(21474836480, quota_stvbuf.f_blocks*quota_stvbuf.f_bsize);
 
   for (int i = 0; i < num_reg_files; i++) {
     sprintf(regular_file, "test_statfs_regular_%d", i);