Add cli test to filter node groups

Add test to filter node group templates with the name of plugin

Change-Id: Ic6b79ba6ac2b039c40fabbd69a86a53eba01caad
This commit is contained in:
Alina Nesterova 2017-03-03 10:19:44 +04:00
parent 3071eaf1bd
commit f40c460b36
3 changed files with 24 additions and 1 deletions

View File

@ -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

View File

@ -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'
])

View File

@ -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')