List Nova and Cinder extensions in debug log
For debugging purposes and post-processing Tempest logs it is useful
to get a list of Nova and Cinder extensions. This patch logs every
found extension to the debug log as a comma-separated list.
Change-Id: Ib550913e6c7b8b9eef12569c0ad7022c44b1f84d
diff --git a/tempest/api/compute/test_extensions.py b/tempest/api/compute/test_extensions.py
index b0bffc4..f9b44d8 100644
--- a/tempest/api/compute/test_extensions.py
+++ b/tempest/api/compute/test_extensions.py
@@ -17,10 +17,14 @@
from tempest.api.compute import base
+from tempest.openstack.common import log as logging
from tempest import test
import testtools
+LOG = logging.getLogger(__name__)
+
+
class ExtensionsTestJSON(base.BaseV2ComputeTest):
_interface = 'json'
@@ -31,6 +35,9 @@
# List of all extensions
resp, extensions = self.extensions_client.list_extensions()
self.assertIn("extensions", extensions)
+ extension_list = [extension.get('alias')
+ for extension in extensions.get('extensions', {})]
+ LOG.debug("Nova extensions: %s" % ','.join(extension_list))
self.assertEqual(200, resp.status)
self.assertTrue(self.extensions_client.is_enabled("Consoles"))
diff --git a/tempest/api/compute/v3/test_extensions.py b/tempest/api/compute/v3/test_extensions.py
index 2affd86..72dfe14 100644
--- a/tempest/api/compute/v3/test_extensions.py
+++ b/tempest/api/compute/v3/test_extensions.py
@@ -17,9 +17,13 @@
from tempest.api.compute import base
+from tempest.openstack.common import log as logging
from tempest import test
+LOG = logging.getLogger(__name__)
+
+
class ExtensionsV3TestJSON(base.BaseV3ComputeTest):
_interface = 'json'
@@ -28,6 +32,9 @@
# List of all extensions
resp, extensions = self.extensions_client.list_extensions()
self.assertIn("extensions", extensions)
+ extension_list = [extension.get('alias')
+ for extension in extensions.get('extensions', {})]
+ LOG.debug("Nova extensions: %s" % ','.join(extension_list))
self.assertEqual(200, resp.status)
self.assertTrue(self.extensions_client.is_enabled("Consoles"))
diff --git a/tempest/api/volume/test_extensions.py b/tempest/api/volume/test_extensions.py
index 90988a2..546c430 100644
--- a/tempest/api/volume/test_extensions.py
+++ b/tempest/api/volume/test_extensions.py
@@ -17,9 +17,13 @@
from tempest.api.volume import base
+from tempest.openstack.common import log as logging
from tempest.test import attr
+LOG = logging.getLogger(__name__)
+
+
class ExtensionsTestJSON(base.BaseVolumeTest):
_interface = 'json'
@@ -30,6 +34,8 @@
self.assertEqual(200, resp.status)
if len(self.config.volume_feature_enabled.api_extensions) == 0:
raise self.skipException('There are not any extensions configured')
+ extension_list = [extension.get('alias') for extension in extensions]
+ LOG.debug("Cinder extensions: %s" % ','.join(extension_list))
ext = self.config.volume_feature_enabled.api_extensions[0]
if ext == 'all':
self.assertIn('Hosts', map(lambda x: x['name'], extensions))