summaryrefslogtreecommitdiff
path: root/functional/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-12-06 16:50:19 +0000
committerGerrit Code Review <review@openstack.org>2014-12-06 16:50:19 +0000
commit8b9f45c1626de1f95f20397c46416b71a142f70a (patch)
treec4b243da1c58bf224b8b2938bf84c31a7f0f38fc /functional/tests
parent95b185339648790a9efbef2d187426c8cf3ef2a1 (diff)
parent1a25cbaf8f2c1643181ef6233f72a57aaac5404d (diff)
downloadpython-openstackclient-8b9f45c1626de1f95f20397c46416b71a142f70a.tar.gz
Merge "Followup for ec2 credentials command fix"
Diffstat (limited to 'functional/tests')
-rw-r--r--functional/tests/test_identity.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/functional/tests/test_identity.py b/functional/tests/test_identity.py
index c5779a20..b3281154 100644
--- a/functional/tests/test_identity.py
+++ b/functional/tests/test_identity.py
@@ -24,6 +24,19 @@ class IdentityV2Tests(test.TestCase):
USER_FIELDS = ['email', 'enabled', 'id', 'name', 'project_id', 'username']
PROJECT_FIELDS = ['enabled', 'id', 'name', 'description']
+ EC2_CREDENTIALS_FIELDS = [
+ 'access',
+ 'project_id',
+ 'secret',
+ 'trust_id',
+ 'user_id',
+ ]
+ EC2_CREDENTIALS_LIST_HEADERS = [
+ 'Access',
+ 'Secret',
+ 'Project ID',
+ 'User ID',
+ ]
def test_user_list(self):
raw_output = self.openstack('user list')
@@ -70,6 +83,39 @@ class IdentityV2Tests(test.TestCase):
raw_output = self.openstack('project delete dummy-project')
self.assertEqual(0, len(raw_output))
+ def test_ec2_credentials_create(self):
+ create_output = self.openstack('ec2 credentials create')
+ create_items = self.parse_show(create_output)
+ self.openstack(
+ 'ec2 credentials delete %s' % create_items[0]['access'],
+ )
+ self.assert_show_fields(create_items, self.EC2_CREDENTIALS_FIELDS)
+
+ def test_ec2_credentials_delete(self):
+ create_output = self.openstack('ec2 credentials create')
+ create_items = self.parse_show(create_output)
+ raw_output = self.openstack(
+ 'ec2 credentials delete %s' % create_items[0]['access'],
+ )
+ self.assertEqual(0, len(raw_output))
+
+ def test_ec2_credentials_list(self):
+ raw_output = self.openstack('ec2 credentials list')
+ items = self.parse_listing(raw_output)
+ self.assert_table_structure(items, self.EC2_CREDENTIALS_LIST_HEADERS)
+
+ def test_ec2_credentials_show(self):
+ create_output = self.openstack('ec2 credentials create')
+ create_items = self.parse_show(create_output)
+ show_output = self.openstack(
+ 'ec2 credentials show %s' % create_items[0]['access'],
+ )
+ items = self.parse_show(show_output)
+ self.openstack(
+ 'ec2 credentials delete %s' % create_items[0]['access'],
+ )
+ self.assert_show_fields(items, self.EC2_CREDENTIALS_FIELDS)
+
class IdentityV3Tests(test.TestCase):
"""Functional tests for Identity V3 commands. """