]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: ensure limit 0 returns 0 images 47887/head
authorPere Diaz Bou <pdiazbou@redhat.com>
Thu, 18 Aug 2022 11:34:15 +0000 (13:34 +0200)
committerPere Diaz Bou <pdiazbou@redhat.com>
Wed, 31 Aug 2022 19:01:38 +0000 (21:01 +0200)
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
(cherry picked from commit a80c058ad21127bee09b4a67886745d880799a10)

src/pybind/mgr/dashboard/tests/test_rbd_service.py

index afd316c41cbbc9cf8a54d64ca40cb51a349cad24..6d780c816511e3b9ab07c58edaf1ee1b844bb0c2 100644 (file)
@@ -130,6 +130,12 @@ class RbdServiceTest(unittest.TestCase):
             'namespace': ''
         }
 
+        # test with limit 0, it should return a list of pools with an empty list, but
+        rbd_pool_list = RbdService.rbd_pool_list(['test_pool'], offset=0, limit=0)
+        self.assertEqual(rbd_pool_list, ([], 1))
+
+        self.rbd_inst_mock.namespace_list.return_value = []
+
         rbd_pool_list = RbdService.rbd_pool_list(['test_pool'], offset=0, limit=5)
         self.assertEqual(rbd_pool_list, ([{
             'id': '3c1a5ee60a88',