]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Add statfs test case for mixed quotas 66473/head
authorChristopher Hoffman <choffman@redhat.com>
Fri, 10 Oct 2025 15:10:33 +0000 (15:10 +0000)
committerJos Collin <jcollin@redhat.com>
Tue, 2 Dec 2025 01:57:32 +0000 (07:27 +0530)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
(cherry picked from commit 2b057ec7bb40855e3be3cb0de12b63f8c10b450e)

src/test/libcephfs/test.cc

index 9a74603c25b1866c3364ef8519e53598a1a6b388..733714a3f8ba340620bae2e586a858c9bef88813 100644 (file)
@@ -1029,6 +1029,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];
@@ -1057,6 +1058,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);