summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/tests/settings_utils_tests.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-02-22 11:42:52 -0700
committerspisarski <s.pisarski@cablelabs.com>2018-02-22 11:42:52 -0700
commitc711acf8ae3e4ad6f746500747857bcc9fd6f7be (patch)
tree4eeba467b4f42b37e935ccfff6b547bd11c65778 /snaps/openstack/utils/tests/settings_utils_tests.py
parentf3553913925b8ee5869c8e06047d6e4161a968c7 (diff)
Changed pattern on how objects lookup themselves by name and project.
The pattern being replaced has unwittingly added the requirement that all creator credentials must be of type 'admin' as when looking up the associated project ID required a call to keystone.projects.list(). As the SNAPS integration tests were always creating users with an 'admin' role, this issue was not caught. As part of this patch, integration test users will no longer be admin. JIRA: SNAPS-274 Change-Id: I02957f69e31a9d4dfa63362d371f061687e59fbf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/settings_utils_tests.py')
-rw-r--r--snaps/openstack/utils/tests/settings_utils_tests.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/snaps/openstack/utils/tests/settings_utils_tests.py b/snaps/openstack/utils/tests/settings_utils_tests.py
index 5dabe38..7287f44 100644
--- a/snaps/openstack/utils/tests/settings_utils_tests.py
+++ b/snaps/openstack/utils/tests/settings_utils_tests.py
@@ -37,7 +37,7 @@ from snaps.openstack.create_security_group import OpenStackSecurityGroup
from snaps.openstack.tests import openstack_tests
from snaps.openstack.tests.os_source_file_test import OSComponentTestCase
from snaps.openstack.utils import (
- neutron_utils, settings_utils, nova_utils, glance_utils)
+ neutron_utils, settings_utils, nova_utils, glance_utils, keystone_utils)
__author__ = 'spisarski'
@@ -155,6 +155,7 @@ class SettingsUtilsVmInstTests(OSComponentTestCase):
and creating an OS image file within OpenStack
"""
self.nova = nova_utils.nova_client(self.os_creds)
+ self.keystone = keystone_utils.keystone_client(self.os_creds)
self.glance = glance_utils.glance_client(self.os_creds)
self.neutron = neutron_utils.neutron_client(self.os_creds)
@@ -324,10 +325,11 @@ class SettingsUtilsVmInstTests(OSComponentTestCase):
self.inst_creator.create(block=True)
server = nova_utils.get_server(
- self.nova, self.neutron,
+ self.nova, self.neutron, self.keystone,
vm_inst_settings=self.inst_creator.instance_settings)
derived_vm_settings = settings_utils.create_vm_inst_config(
- self.nova, self.neutron, server, self.project_id)
+ self.nova, self.keystone, self.neutron, server,
+ self.os_creds.project_name)
self.assertIsNotNone(derived_vm_settings)
self.assertIsNotNone(derived_vm_settings.port_settings)
self.assertIsNotNone(derived_vm_settings.floating_ip_settings)
@@ -340,7 +342,7 @@ class SettingsUtilsVmInstTests(OSComponentTestCase):
self.inst_creator.create(block=True)
server = nova_utils.get_server(
- self.nova, self.neutron,
+ self.nova, self.neutron, self.keystone,
vm_inst_settings=self.inst_creator.instance_settings)
derived_image_settings = settings_utils.determine_image_config(
self.glance, server, [self.image_creator.image_settings])