summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/tests/keystone_utils_tests.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-03-09 14:42:34 -0700
committerspisarski <s.pisarski@cablelabs.com>2018-03-12 08:28:45 -0600
commit9e9e09590cce321f55996c1a31370ffdf28251b0 (patch)
treea0e031d0365604f4a299ad8f748fe10d09a75a8a /snaps/openstack/utils/tests/keystone_utils_tests.py
parentfb0ab37c323717ca10ac3f3bda24ae390635495e (diff)
Closing keystone sessions after done with them.
By not closing all of the keystone sessions being created when running all of the tests, this may be the root cause to the IOError occasionally being observed: IOError: [Errno 24] Too many open files JIRA: SNAPS-285 Change-Id: I7fc7ab0c6cdd02f1ae32bb3ae4f121cb465d5693 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/keystone_utils_tests.py')
-rw-r--r--snaps/openstack/utils/tests/keystone_utils_tests.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/snaps/openstack/utils/tests/keystone_utils_tests.py b/snaps/openstack/utils/tests/keystone_utils_tests.py
index 7ce7a61..cc3a8ad 100644
--- a/snaps/openstack/utils/tests/keystone_utils_tests.py
+++ b/snaps/openstack/utils/tests/keystone_utils_tests.py
@@ -31,7 +31,8 @@ class KeystoneSmokeTests(OSComponentTestCase):
"""
Tests to ensure that the proper credentials can connect.
"""
- keystone = keystone_utils.keystone_client(self.os_creds)
+ keystone = keystone_utils.keystone_client(
+ self.os_creds, self.os_session)
users = keystone.users.list()
self.assertIsNotNone(users)
@@ -66,14 +67,16 @@ class KeystoneUtilsTests(OSComponentTestCase):
self.project_name = self.guid + '-projName'
self.project = None
self.role = None
- self.keystone = keystone_utils.keystone_client(self.os_creds)
+ self.keystone = keystone_utils.keystone_client(
+ self.os_creds, self.os_session)
def tearDown(self):
"""
Cleans the remote OpenStack objects
"""
if self.project:
- neutron = neutron_utils.neutron_client(self.os_creds)
+ neutron = neutron_utils.neutron_client(
+ self.os_creds, self.os_session)
default_sec_grp = neutron_utils.get_security_group(
neutron, self.keystone, sec_grp_name='default',
project_name=self.os_creds.project_name)
@@ -92,6 +95,8 @@ class KeystoneUtilsTests(OSComponentTestCase):
if self.role:
keystone_utils.delete_role(self.keystone, self.role)
+ super(self.__class__, self).__clean__()
+
def test_create_user_minimal(self):
"""
Tests the keystone_utils.create_user() function