summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/functional')
-rw-r--r--openstackclient/tests/functional/common/test_extension.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/openstackclient/tests/functional/common/test_extension.py b/openstackclient/tests/functional/common/test_extension.py
index cc4cb7e1..d7dc398b 100644
--- a/openstackclient/tests/functional/common/test_extension.py
+++ b/openstackclient/tests/functional/common/test_extension.py
@@ -15,6 +15,8 @@
import json
+from tempest.lib import exceptions as tempest_exc
+
from openstackclient.tests.functional import base
@@ -23,7 +25,6 @@ class ExtensionTests(base.TestCase):
@classmethod
def setUpClass(cls):
- # super(NetworkTests, cls).setUp()
cls.haz_network = base.is_service_enabled('network')
def test_extension_list_compute(self):
@@ -38,6 +39,18 @@ class ExtensionTests(base.TestCase):
name_list,
)
+ def test_extension_list_volume(self):
+ """Test volume extension list"""
+ json_output = json.loads(self.openstack(
+ 'extension list -f json ' +
+ '--volume'
+ ))
+ name_list = [item.get('Name') for item in json_output]
+ self.assertIn(
+ 'TypesManage',
+ name_list,
+ )
+
def test_extension_list_network(self):
"""Test network extension list"""
if not self.haz_network:
@@ -79,5 +92,19 @@ class ExtensionTests(base.TestCase):
))
self.assertEqual(
name,
- json_output.get('Alias'),
+ json_output.get('alias'),
)
+
+ def test_extension_show_not_exist(self):
+ """Test extension show with not existed name"""
+ if not self.haz_network:
+ self.skipTest("No Network service present")
+
+ name = 'not_existed_ext'
+ try:
+ self.openstack('extension show ' + name)
+ except tempest_exc.CommandFailed as e:
+ self.assertIn('ResourceNotFound', str(e))
+ self.assertIn(name, str(e))
+ else:
+ self.fail('CommandFailed should be raised')