]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard/qa: Fix ECP creation test 25120/head
authorStephan Müller <smueller@suse.com>
Thu, 15 Nov 2018 15:59:51 +0000 (16:59 +0100)
committerStephan Müller <smueller@suse.com>
Mon, 10 Dec 2018 11:37:03 +0000 (12:37 +0100)
The current solution fails on our CI-system as some outputs can have
more values and some parameters like 'w' can vary in different
environments.

As this was only tested before in a vstart cluster environment it
worked.

Through this commit only the given attributes we know to be there,
will be tested.

Fixes: https://tracker.ceph.com/issues/37275
Signed-off-by: Stephan Müller <smueller@suse.com>
qa/suites/rados/mgr/tasks/dashboard.yaml
qa/tasks/mgr/dashboard/helper.py
qa/tasks/mgr/dashboard/test_erasure_code_profile.py

index 6bb4a9a03b241e8d693a601cc605bf5ffc23335a..cda888a6aa8394dfbfcdb79aa131452b4c915ba5 100644 (file)
@@ -44,3 +44,4 @@ tasks:
         - tasks.mgr.dashboard.test_role
         - tasks.mgr.dashboard.test_settings
         - tasks.mgr.dashboard.test_user
+        - tasks.mgr.dashboard.test_erasure_code_profile
index 13fc8480b7a37fe8ea2143d309874e85d827e9a7..31fe13e742d6629b7a49436b423780c68f16618e 100644 (file)
@@ -319,10 +319,17 @@ class DashboardTestCase(MgrTestCase):
     def reset_session(cls):
         cls._session = requests.Session()
 
+    def assertSubset(self, data, biggerData):
+        for key, value in data.items():
+            self.assertEqual(biggerData[key], value)
+
     def assertJsonBody(self, data):
         body = self._resp.json()
         self.assertEqual(body, data)
 
+    def assertJsonSubset(self, data):
+        self.assertSubset(data, self._resp.json())
+
     def assertSchema(self, data, schema):
         try:
             return _validate_json(data, schema)
index 2a9bd2e5a0a5e45909f6ff01d51ce805ffa427e4..f5f1fd85ef6c9d6fc0b0b147b626c213767245e5 100644 (file)
@@ -47,7 +47,7 @@ class ECPTest(DashboardTestCase):
             }
             if 'crush-failure-domain' in default[0]:
                 default_ecp['crush-failure-domain'] = default[0]['crush-failure-domain']
-            self.assertEqual(default[0], default_ecp)
+            self.assertSubset(default_ecp, default[0])
             get_data = self._get('/api/erasure_code_profile/default')
             self.assertEqual(get_data, default[0])
 
@@ -58,7 +58,7 @@ class ECPTest(DashboardTestCase):
         self.assertStatus(201)
 
         self._get('/api/erasure_code_profile/ecp32')
-        self.assertJsonBody({
+        self.assertJsonSubset({
             'crush-device-class': '',
             'crush-failure-domain': 'osd',
             'crush-root': 'default',
@@ -68,7 +68,6 @@ class ECPTest(DashboardTestCase):
             'name': 'ecp32',
             'plugin': 'jerasure',
             'technique': 'reed_sol_van',
-            'w': '8'
         })
 
         self.assertStatus(200)