summaryrefslogtreecommitdiff
path: root/functional
diff options
context:
space:
mode:
authorSteve Martinelli <stevemar@ca.ibm.com>2015-04-17 13:37:44 -0400
committerSteve Martinelli <stevemar@ca.ibm.com>2015-04-17 13:37:44 -0400
commit6c4f81516c6ad119d39c4952f3ab274f3d3f2efa (patch)
tree2be9f3f7859f8eb260c9fedd12ab6410561878f1 /functional
parent6ce930e846c71f99b6cae8508681e7fb0d1eee89 (diff)
downloadpython-openstackclient-6c4f81516c6ad119d39c4952f3ab274f3d3f2efa.tar.gz
Re-organize functional tests
The tests should be further divded by project version, similar to the structure of the unit tests. Change-Id: Ied3a4204983cdd253c5602a60968c066038d88f2
Diffstat (limited to 'functional')
-rw-r--r--functional/tests/examples/__init__.py0
-rw-r--r--functional/tests/examples/test_examples.py (renamed from functional/tests/test_examples.py)0
-rw-r--r--functional/tests/identity/__init__.py0
-rw-r--r--functional/tests/identity/v2/__init__.py0
-rw-r--r--functional/tests/identity/v2/test_identity.py (renamed from functional/tests/test_identity.py)79
-rw-r--r--functional/tests/identity/v3/__init__.py0
-rw-r--r--functional/tests/identity/v3/test_identity.py95
-rw-r--r--functional/tests/object/__init__.py0
-rw-r--r--functional/tests/object/v1/__init__.py0
-rw-r--r--functional/tests/object/v1/test_object.py (renamed from functional/tests/test_object.py)0
10 files changed, 95 insertions, 79 deletions
diff --git a/functional/tests/examples/__init__.py b/functional/tests/examples/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functional/tests/examples/__init__.py
diff --git a/functional/tests/test_examples.py b/functional/tests/examples/test_examples.py
index 6e0e5867..6e0e5867 100644
--- a/functional/tests/test_examples.py
+++ b/functional/tests/examples/test_examples.py
diff --git a/functional/tests/identity/__init__.py b/functional/tests/identity/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functional/tests/identity/__init__.py
diff --git a/functional/tests/identity/v2/__init__.py b/functional/tests/identity/v2/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functional/tests/identity/v2/__init__.py
diff --git a/functional/tests/test_identity.py b/functional/tests/identity/v2/test_identity.py
index b3281154..37f29fc8 100644
--- a/functional/tests/test_identity.py
+++ b/functional/tests/identity/v2/test_identity.py
@@ -10,9 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import os
-import uuid
-
from functional.common import exceptions
from functional.common import test
@@ -115,79 +112,3 @@ class IdentityV2Tests(test.TestCase):
'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. """
-
- DOMAIN_FIELDS = ['description', 'enabled', 'id', 'name', 'links']
- GROUP_FIELDS = ['description', 'domain_id', 'id', 'name', 'links']
- TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id']
-
- def _create_dummy_group(self):
- name = uuid.uuid4().hex
- self.openstack('group create ' + name)
- return name
-
- def _create_dummy_domain(self):
- name = uuid.uuid4().hex
- self.openstack('domain create ' + name)
- return name
-
- def setUp(self):
- super(IdentityV3Tests, self).setUp()
- auth_url = os.environ.get('OS_AUTH_URL')
- auth_url = auth_url.replace('v2.0', 'v3')
- os.environ['OS_AUTH_URL'] = auth_url
- os.environ['OS_IDENTITY_API_VERSION'] = '3'
- os.environ['OS_USER_DOMAIN_ID'] = 'default'
- os.environ['OS_PROJECT_DOMAIN_ID'] = 'default'
-
- def test_group_create(self):
- raw_output = self.openstack('group create ' + uuid.uuid4().hex)
- items = self.parse_show(raw_output)
- self.assert_show_fields(items, self.GROUP_FIELDS)
-
- def test_group_list(self):
- self._create_dummy_group()
- raw_output = self.openstack('group list')
- items = self.parse_listing(raw_output)
- self.assert_table_structure(items, BASIC_LIST_HEADERS)
-
- def test_group_delete(self):
- name = self._create_dummy_group()
- raw_output = self.openstack('group delete ' + name)
- self.assertEqual(0, len(raw_output))
-
- def test_group_show(self):
- name = self._create_dummy_group()
- raw_output = self.openstack('group show ' + name)
- items = self.parse_show(raw_output)
- self.assert_show_fields(items, self.GROUP_FIELDS)
-
- def test_domain_create(self):
- raw_output = self.openstack('domain create ' + uuid.uuid4().hex)
- items = self.parse_show(raw_output)
- self.assert_show_fields(items, self.DOMAIN_FIELDS)
-
- def test_domain_list(self):
- self._create_dummy_domain()
- raw_output = self.openstack('domain list')
- items = self.parse_listing(raw_output)
- self.assert_table_structure(items, BASIC_LIST_HEADERS)
-
- def test_domain_delete(self):
- name = self._create_dummy_domain()
- self.assertRaises(exceptions.CommandFailed,
- self.openstack, 'domain delete ' + name)
-
- def test_domain_show(self):
- name = self._create_dummy_domain()
- raw_output = self.openstack('domain show ' + name)
- items = self.parse_show(raw_output)
- self.assert_show_fields(items, self.DOMAIN_FIELDS)
-
- def test_token_issue(self):
- raw_output = self.openstack('token issue')
- items = self.parse_show(raw_output)
- self.assert_show_fields(items, self.TOKEN_FIELDS)
diff --git a/functional/tests/identity/v3/__init__.py b/functional/tests/identity/v3/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functional/tests/identity/v3/__init__.py
diff --git a/functional/tests/identity/v3/test_identity.py b/functional/tests/identity/v3/test_identity.py
new file mode 100644
index 00000000..82319085
--- /dev/null
+++ b/functional/tests/identity/v3/test_identity.py
@@ -0,0 +1,95 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import os
+import uuid
+
+from functional.common import exceptions
+from functional.common import test
+
+BASIC_LIST_HEADERS = ['ID', 'Name']
+
+
+class IdentityV3Tests(test.TestCase):
+ """Functional tests for Identity V3 commands. """
+
+ DOMAIN_FIELDS = ['description', 'enabled', 'id', 'name', 'links']
+ GROUP_FIELDS = ['description', 'domain_id', 'id', 'name', 'links']
+ TOKEN_FIELDS = ['expires', 'id', 'project_id', 'user_id']
+
+ def _create_dummy_group(self):
+ name = uuid.uuid4().hex
+ self.openstack('group create ' + name)
+ return name
+
+ def _create_dummy_domain(self):
+ name = uuid.uuid4().hex
+ self.openstack('domain create ' + name)
+ return name
+
+ def setUp(self):
+ super(IdentityV3Tests, self).setUp()
+ auth_url = os.environ.get('OS_AUTH_URL')
+ auth_url = auth_url.replace('v2.0', 'v3')
+ os.environ['OS_AUTH_URL'] = auth_url
+ os.environ['OS_IDENTITY_API_VERSION'] = '3'
+ os.environ['OS_USER_DOMAIN_ID'] = 'default'
+ os.environ['OS_PROJECT_DOMAIN_ID'] = 'default'
+
+ def test_group_create(self):
+ raw_output = self.openstack('group create ' + uuid.uuid4().hex)
+ items = self.parse_show(raw_output)
+ self.assert_show_fields(items, self.GROUP_FIELDS)
+
+ def test_group_list(self):
+ self._create_dummy_group()
+ raw_output = self.openstack('group list')
+ items = self.parse_listing(raw_output)
+ self.assert_table_structure(items, BASIC_LIST_HEADERS)
+
+ def test_group_delete(self):
+ name = self._create_dummy_group()
+ raw_output = self.openstack('group delete ' + name)
+ self.assertEqual(0, len(raw_output))
+
+ def test_group_show(self):
+ name = self._create_dummy_group()
+ raw_output = self.openstack('group show ' + name)
+ items = self.parse_show(raw_output)
+ self.assert_show_fields(items, self.GROUP_FIELDS)
+
+ def test_domain_create(self):
+ raw_output = self.openstack('domain create ' + uuid.uuid4().hex)
+ items = self.parse_show(raw_output)
+ self.assert_show_fields(items, self.DOMAIN_FIELDS)
+
+ def test_domain_list(self):
+ self._create_dummy_domain()
+ raw_output = self.openstack('domain list')
+ items = self.parse_listing(raw_output)
+ self.assert_table_structure(items, BASIC_LIST_HEADERS)
+
+ def test_domain_delete(self):
+ name = self._create_dummy_domain()
+ self.assertRaises(exceptions.CommandFailed,
+ self.openstack, 'domain delete ' + name)
+
+ def test_domain_show(self):
+ name = self._create_dummy_domain()
+ raw_output = self.openstack('domain show ' + name)
+ items = self.parse_show(raw_output)
+ self.assert_show_fields(items, self.DOMAIN_FIELDS)
+
+ def test_token_issue(self):
+ raw_output = self.openstack('token issue')
+ items = self.parse_show(raw_output)
+ self.assert_show_fields(items, self.TOKEN_FIELDS)
diff --git a/functional/tests/object/__init__.py b/functional/tests/object/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functional/tests/object/__init__.py
diff --git a/functional/tests/object/v1/__init__.py b/functional/tests/object/v1/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functional/tests/object/v1/__init__.py
diff --git a/functional/tests/test_object.py b/functional/tests/object/v1/test_object.py
index 4121524a..4121524a 100644
--- a/functional/tests/test_object.py
+++ b/functional/tests/object/v1/test_object.py