diff options
Diffstat (limited to 'openstackclient/tests/functional')
| -rw-r--r-- | openstackclient/tests/functional/identity/v3/common.py | 1 | ||||
| -rw-r--r-- | openstackclient/tests/functional/identity/v3/test_endpoint.py | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/identity/v3/common.py b/openstackclient/tests/functional/identity/v3/common.py index 6d7896d8..33cb5d86 100644 --- a/openstackclient/tests/functional/identity/v3/common.py +++ b/openstackclient/tests/functional/identity/v3/common.py @@ -42,6 +42,7 @@ class IdentityTests(base.TestCase): REGION_LIST_HEADERS = ['Region', 'Parent Region', 'Description'] ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type', 'Enabled', 'Interface', 'URL'] + ENDPOINT_LIST_PROJECT_HEADERS = ['ID', 'Name'] IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids', 'domain_id'] diff --git a/openstackclient/tests/functional/identity/v3/test_endpoint.py b/openstackclient/tests/functional/identity/v3/test_endpoint.py index 22dc1b65..41f0b4c8 100644 --- a/openstackclient/tests/functional/identity/v3/test_endpoint.py +++ b/openstackclient/tests/functional/identity/v3/test_endpoint.py @@ -42,6 +42,29 @@ class EndpointTests(common.IdentityTests): items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ENDPOINT_LIST_HEADERS) + def test_endpoint_list_filter(self): + endpoint_id = self._create_dummy_endpoint(add_clean_up=False) + project_id = self._create_dummy_project(add_clean_up=False) + raw_output = self.openstack( + 'endpoint add project ' + '%(endpoint_id)s ' + '%(project_id)s' % { + 'project_id': project_id, + 'endpoint_id': endpoint_id}) + self.assertEqual(0, len(raw_output)) + raw_output = self.openstack( + 'endpoint list --endpoint %s' % endpoint_id) + self.assertIn(project_id, raw_output) + items = self.parse_listing(raw_output) + self.assert_table_structure(items, + self.ENDPOINT_LIST_PROJECT_HEADERS) + + raw_output = self.openstack( + 'endpoint list --project %s' % project_id) + self.assertIn(endpoint_id, raw_output) + items = self.parse_listing(raw_output) + self.assert_table_structure(items, self.ENDPOINT_LIST_HEADERS) + def test_endpoint_set(self): endpoint_id = self._create_dummy_endpoint() new_endpoint_url = data_utils.rand_url() @@ -65,3 +88,22 @@ class EndpointTests(common.IdentityTests): raw_output = self.openstack('endpoint show %s' % endpoint_id) items = self.parse_show(raw_output) self.assert_show_fields(items, self.ENDPOINT_FIELDS) + + def test_endpoint_add_remove_project(self): + endpoint_id = self._create_dummy_endpoint(add_clean_up=False) + project_id = self._create_dummy_project(add_clean_up=False) + raw_output = self.openstack( + 'endpoint add project ' + '%(endpoint_id)s ' + '%(project_id)s' % { + 'project_id': project_id, + 'endpoint_id': endpoint_id}) + self.assertEqual(0, len(raw_output)) + + raw_output = self.openstack( + 'endpoint remove project ' + '%(endpoint_id)s ' + '%(project_id)s' % { + 'project_id': project_id, + 'endpoint_id': endpoint_id}) + self.assertEqual(0, len(raw_output)) |
