diff options
author | spisarski <s.pisarski@cablelabs.com> | 2018-03-09 14:42:34 -0700 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2018-03-12 08:28:45 -0600 |
commit | 9e9e09590cce321f55996c1a31370ffdf28251b0 (patch) | |
tree | a0e031d0365604f4a299ad8f748fe10d09a75a8a /snaps/openstack/utils/tests/glance_utils_tests.py | |
parent | fb0ab37c323717ca10ac3f3bda24ae390635495e (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/glance_utils_tests.py')
-rw-r--r-- | snaps/openstack/utils/tests/glance_utils_tests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/snaps/openstack/utils/tests/glance_utils_tests.py b/snaps/openstack/utils/tests/glance_utils_tests.py index e61b795..e761ed8 100644 --- a/snaps/openstack/utils/tests/glance_utils_tests.py +++ b/snaps/openstack/utils/tests/glance_utils_tests.py @@ -39,7 +39,7 @@ class GlanceSmokeTests(OSComponentTestCase): """ Tests to ensure that the proper credentials can connect. """ - glance = glance_utils.glance_client(self.os_creds) + glance = glance_utils.glance_client(self.os_creds, self.os_session) image = glance_utils.get_image(glance, image_name='foo') self.assertIsNone(image) @@ -69,7 +69,8 @@ class GlanceUtilsTests(OSComponentTestCase): guid = uuid.uuid4() self.image_name = self.__class__.__name__ + '-' + str(guid) self.image = None - self.glance = glance_utils.glance_client(self.os_creds) + self.glance = glance_utils.glance_client( + self.os_creds, self.os_session) if self.image_metadata: self.glance_test_meta = self.image_metadata.get('glance_tests') else: @@ -89,6 +90,8 @@ class GlanceUtilsTests(OSComponentTestCase): if os.path.exists(self.tmp_dir) and os.path.isdir(self.tmp_dir): shutil.rmtree(self.tmp_dir) + super(self.__class__, self).__clean__() + def test_create_image_minimal_url(self): """ Tests the glance_utils.create_image() function with a URL unless the |