diff --git a/releasenotes/notes/add-cli-for-ng-cbdcdddd5195c333.yaml b/releasenotes/notes/add-cli-for-ng-cbdcdddd5195c333.yaml new file mode 100644 index 00000000..886eaf22 --- /dev/null +++ b/releasenotes/notes/add-cli-for-ng-cbdcdddd5195c333.yaml @@ -0,0 +1,6 @@ +--- +prelude: > + Create new cli test in Sahara Tempest plugin for node group templates +features: + - Now we can filter node group template with column flag by plugin + and check if it was filtered successfully diff --git a/sahara_tempest_plugin/tests/cli/node_group_templates.py b/sahara_tempest_plugin/tests/cli/node_group_templates.py index afd3814d..d8349d80 100644 --- a/sahara_tempest_plugin/tests/cli/node_group_templates.py +++ b/sahara_tempest_plugin/tests/cli/node_group_templates.py @@ -99,3 +99,20 @@ class SaharaNodeGroupCLITest(base.ClientTestBase): node_group_name) self.openstack_node_group_template_update(node_group_name, update_field='unprotected') + + def filter_node_group_list_with_plugin(self): + """Test to filter node group templates with the plugin""" + plugins_list = self.listing_result('plugin list') + plugins_names = [p['Name'] for p in plugins_list] + if len(plugins_names) == 0: + raise self.skipException('No plugin to filter node group') + filter_cmd = self.listing_result( + 'node group template list --plugin %s' % plugins_names[0]) + for ng in filter_cmd: + self.assertEqual(plugins_names[0], ng['Plugin name']) + self.assertTableStruct(filter_cmd, [ + 'Name', + 'Id', + 'Plugin version', + 'Plugin name' + ]) diff --git a/sahara_tempest_plugin/tests/cli/test_scenario.py b/sahara_tempest_plugin/tests/cli/test_scenario.py index 9578e095..be1082ea 100644 --- a/sahara_tempest_plugin/tests/cli/test_scenario.py +++ b/sahara_tempest_plugin/tests/cli/test_scenario.py @@ -51,7 +51,7 @@ class Scenario(images.SaharaImageCLITest, worker_ngt = self.openstack_node_group_template_create('worker', '3') self.addCleanup(self.delete_resource, NODE_GROUP_TEMPLATE, master_ngt) self.addCleanup(self.delete_resource, NODE_GROUP_TEMPLATE, worker_ngt) - + self.filter_node_group_list_with_plugin() self.openstack_node_group_template_list() new_master_ngt = self.openstack_node_group_template_update( master_ngt, update_field='name')