|
12 | 12 |
|
13 | 13 | import uuid |
14 | 14 |
|
15 | | -from openstackclient.tests.functional import base |
| 15 | +# from openstackclient.tests.functional import base |
| 16 | +from openstackclient.tests.functional.object.v1 import common |
16 | 17 |
|
17 | 18 |
|
18 | | -class ContainerTests(base.TestCase): |
19 | | - """Functional tests for object containers. """ |
| 19 | +class ContainerTests(common.ObjectStoreTests): |
| 20 | + """Functional tests for Object Store container commands""" |
20 | 21 | NAME = uuid.uuid4().hex |
21 | 22 |
|
22 | 23 | @classmethod |
23 | 24 | def setUpClass(cls): |
24 | 25 | super(ContainerTests, cls).setUpClass() |
25 | | - opts = cls.get_opts(['container']) |
26 | | - raw_output = cls.openstack('container create ' + cls.NAME + opts) |
27 | | - cls.assertOutput(cls.NAME + '\n', raw_output) |
| 26 | + if cls.haz_object_store: |
| 27 | + opts = cls.get_opts(['container']) |
| 28 | + raw_output = cls.openstack('container create ' + cls.NAME + opts) |
| 29 | + cls.assertOutput(cls.NAME + '\n', raw_output) |
28 | 30 |
|
29 | 31 | @classmethod |
30 | 32 | def tearDownClass(cls): |
31 | 33 | try: |
32 | | - raw_output = cls.openstack('container delete ' + cls.NAME) |
33 | | - cls.assertOutput('', raw_output) |
| 34 | + if cls.haz_object_store: |
| 35 | + raw_output = cls.openstack('container delete ' + cls.NAME) |
| 36 | + cls.assertOutput('', raw_output) |
34 | 37 | finally: |
35 | 38 | super(ContainerTests, cls).tearDownClass() |
36 | 39 |
|
| 40 | + def setUp(self): |
| 41 | + super(ContainerTests, self).setUp() |
| 42 | + # Skip tests if no object-store is present |
| 43 | + if not self.haz_object_store: |
| 44 | + self.skipTest("No object-store service present") |
| 45 | + |
37 | 46 | def test_container_list(self): |
38 | 47 | opts = self.get_opts(['Name']) |
39 | 48 | raw_output = self.openstack('container list' + opts) |
|
0 commit comments