From ad1312e9056dd151fa54925ec41a08767ea7d22d Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 16 Apr 2025 14:17:18 +0530 Subject: [PATCH] qa/cephfs: test that user created pool is not deleted by... "volume create" command. Signed-off-by: Rishabh Dave (cherry picked from commit ad1716ff15743dc45d88ddb529b4705b6bd780a6) --- qa/tasks/cephfs/test_volumes.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 3f404a53b4a..cecd6ec66e9 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -769,6 +769,28 @@ class TestVolumeCreate(TestVolumesHelper): self.run_ceph_cmd(f'osd pool rm {data} {data} ' '--yes-i-really-really-mean-it') + def test_user_created_pool_isnt_deleted(self): + ''' + Test that the user created pool is not deleted by this commmand if it + has been passed to it along with a non-existent pool name. + ''' + data_pool = 'cephfs.b.data' + non_existent_meta_pool = 'nonexistent-pool' + + self.run_ceph_cmd(f'osd pool create {data_pool}') + o = self.get_ceph_cmd_stdout('osd pool ls') + self.assertIn(data_pool, o) + self.assertNotIn(non_existent_meta_pool, o) + + self.negtest_ceph_cmd( + args=f'fs volume create b --data-pool {data_pool} --meta-pool ' + f'{non_existent_meta_pool}', + retval=errno.ENOENT, + errmsgs=f'pool \'{non_existent_meta_pool}\' does not exist') + + o = self.get_ceph_cmd_stdout('osd pool ls') + self.assertIn(data_pool, o) + self.assertNotIn(non_existent_meta_pool, o) class TestRenameCmd(TestVolumesHelper): -- 2.39.5