From 8b1303f4b1d740eb6a73a7be54294e346def7b60 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Wed, 2 Aug 2023 17:41:51 +0530 Subject: [PATCH] qa: Add testcase for pending_subvolume_deletions count Fixes: https://tracker.ceph.com/issues/62278 Signed-off-by: Kotresh HR --- qa/tasks/cephfs/test_volumes.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index f5f5c15fba1..da6f22696b6 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -649,6 +649,22 @@ class TestVolumes(TestVolumesHelper): self.assertEqual(vol_info["used_size"], 0, "Size should be zero when volumes directory is empty") + def test_volume_info_pending_subvol_deletions(self): + """ + Tests the pending_subvolume_deletions in 'fs volume info' command + """ + subvolname = self._generate_random_subvolume_name() + # create subvolume + self._fs_cmd("subvolume", "create", self.volname, subvolname, "--mode=777") + # create 3K files of 0.1MB + self._do_subvolume_io(subvolname, number_of_files=3000, file_size=0.1) + # Delete the subvolume + self._fs_cmd("subvolume", "rm", self.volname, subvolname) + # get volume metadata + vol_info = json.loads(self._get_volume_info(self.volname)) + self.assertNotEqual(vol_info['pending_subvolume_deletions'], 0, + "pending_subvolume_deletions should be 1") + def test_volume_info_without_subvolumegroup(self): """ Tests the 'fs volume info' command without subvolume group