]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test: Add statfs test case for mixed quotas
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 08:42:31 +0000 (14:12 +0530)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
(cherry picked from commit 2b057ec7bb40855e3be3cb0de12b63f8c10b450e)

src/test/libcephfs/test.cc

index 22367f67d55a5097a6b0a626a4b88859063ffe0f..2f5e1862b09cd7d6ac844fce553f3c8fa441c06d 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);