Browse Source

Fix the test nsxt_add_delete_compute_vmware_node

Change-Id: I63e94a5735d0d7b259b4a979a99384daabc7401a
ibumarskov 2 years ago
parent
commit
efc95b7cb8
2 changed files with 24 additions and 8 deletions
  1. 1
    1
      doc/test/source/test_suite_scale.rst
  2. 23
    7
      plugin_test/tests/test_plugin_scale.py

+ 1
- 1
doc/test/source/test_suite_scale.rst View File

@@ -162,7 +162,7 @@ Steps
162 162
     11. Add node with compute-vmware role.
163 163
     12. Reconfigure vcenter compute clusters.
164 164
     13. Redeploy cluster.
165
-    14. Check vm instance has been removed.
165
+    14. Check that instance is in place.
166 166
     15. Run OSTF.
167 167
     16. Remove node with compute-vmware role from base installation.
168 168
     17. Reconfigure vcenter compute clusters.

+ 23
- 7
plugin_test/tests/test_plugin_scale.py View File

@@ -13,6 +13,8 @@ License for the specific language governing permissions and limitations
13 13
 under the License.
14 14
 """
15 15
 
16
+import itertools
17
+
16 18
 from proboscis import test
17 19
 from proboscis.asserts import assert_true
18 20
 
@@ -266,7 +268,7 @@ class TestNSXtScale(TestNSXtBase):
266 268
             10. Add node with compute-vmware role.
267 269
             11. Reconfigure vcenter compute clusters.
268 270
             12. Redeploy cluster.
269
-            13. Check that instance has been removed.
271
+            13. Check that instance is in place.
270 272
             14. Run OSTF.
271 273
             15. Remove node with compute-vmware role.
272 274
             16. Reconfigure vcenter compute clusters.
@@ -319,7 +321,7 @@ class TestNSXtScale(TestNSXtBase):
319 321
             SERVTEST_PASSWORD,
320 322
             SERVTEST_TENANT)
321 323
 
322
-        vcenter_vm = os_help.create_instance(os_conn, az='vcenter')
324
+        os_help.create_instance(os_conn, az='vcenter')
323 325
 
324 326
         self.show_step(10)  # Add node with compute-vmware role
325 327
         self.fuel_web.update_nodes(cluster_id,
@@ -336,8 +338,8 @@ class TestNSXtScale(TestNSXtBase):
336 338
         self.show_step(12)  # Redeploy cluster
337 339
         self.fuel_web.deploy_cluster_wait(cluster_id)
338 340
 
339
-        self.show_step(13)  # Check that instance has been removed
340
-        assert_true(os_conn.is_srv_deleted(vcenter_vm))
341
+        self.show_step(13)  # Check that instance is in place
342
+        os_help.check_instances_state(os_conn)
341 343
 
342 344
         self.show_step(14)  # Run OSTF
343 345
         self.fuel_web.run_ostf(cluster_id)
@@ -348,9 +350,23 @@ class TestNSXtScale(TestNSXtBase):
348 350
                                    False, True)
349 351
 
350 352
         self.show_step(16)  # Reconfigure vcenter compute clusters
351
-        target_node2 = self.fuel_web.get_nailgun_node_by_name('slave-04')
352
-        self.fuel_web.vcenter_configure(cluster_id,
353
-                                        target_node_1=target_node2['hostname'])
353
+        vmware_attr = \
354
+            self.fuel_web.client.get_cluster_vmware_attributes(cluster_id)
355
+        vcenter_data = vmware_attr['editable']['value']['availability_zones'][
356
+            0]["nova_computes"]
357
+
358
+        comp_vmware_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
359
+            cluster_id, ['compute-vmware'])
360
+        comp_vmware_nodes = [node for node in comp_vmware_nodes if
361
+                             node['pending_deletion'] is True]
362
+
363
+        for node, nova_comp in itertools.product(comp_vmware_nodes,
364
+                                                 vcenter_data):
365
+            if node['hostname'] == nova_comp['target_node']['current']['id']:
366
+                vcenter_data.remove(nova_comp)
367
+        self.fuel_web.client.update_cluster_vmware_attributes(cluster_id,
368
+                                                              vmware_attr)
369
+
354 370
 
355 371
         self.show_step(17)    # Redeploy cluster
356 372
         self.fuel_web.deploy_cluster_wait(cluster_id)

Loading…
Cancel
Save