]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/cephfs: test that user created pool is not deleted by...
authorRishabh Dave <ridave@redhat.com>
Wed, 16 Apr 2025 08:47:18 +0000 (14:17 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 15 Sep 2025 06:18:49 +0000 (11:48 +0530)
"volume create" command.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit ad1716ff15743dc45d88ddb529b4705b6bd780a6)

qa/tasks/cephfs/test_volumes.py

index 3f404a53b4a1438c1c128a9894ae912ce88928f2..cecd6ec66e94ec1f862095c3d34f4ae42fd8b3ef 100644 (file)
@@ -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):