From 022fdb10ebf5e539fb4d84550d00943d55e5f746 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 26 Jul 2017 11:31:06 -0500 Subject: Skip object-store functional tests when Swift is not available Specifically, in the py3 jobs Swift is not (yet) properly starting as a py2 service, so we disabled swift in those OSC jobs and need to skip the object-store functional tests in that case. Change-Id: I073551c41b7636f04b3ee97dc6fe69630e207b67 --- .../tests/functional/object/v1/test_container.py | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'openstackclient/tests/functional/object/v1/test_container.py') diff --git a/openstackclient/tests/functional/object/v1/test_container.py b/openstackclient/tests/functional/object/v1/test_container.py index acfbab11..d66aa842 100644 --- a/openstackclient/tests/functional/object/v1/test_container.py +++ b/openstackclient/tests/functional/object/v1/test_container.py @@ -12,28 +12,37 @@ import uuid -from openstackclient.tests.functional import base +# from openstackclient.tests.functional import base +from openstackclient.tests.functional.object.v1 import common -class ContainerTests(base.TestCase): - """Functional tests for object containers. """ +class ContainerTests(common.ObjectStoreTests): + """Functional tests for Object Store container commands""" NAME = uuid.uuid4().hex @classmethod def setUpClass(cls): super(ContainerTests, cls).setUpClass() - opts = cls.get_opts(['container']) - raw_output = cls.openstack('container create ' + cls.NAME + opts) - cls.assertOutput(cls.NAME + '\n', raw_output) + if cls.haz_object_store: + opts = cls.get_opts(['container']) + raw_output = cls.openstack('container create ' + cls.NAME + opts) + cls.assertOutput(cls.NAME + '\n', raw_output) @classmethod def tearDownClass(cls): try: - raw_output = cls.openstack('container delete ' + cls.NAME) - cls.assertOutput('', raw_output) + if cls.haz_object_store: + raw_output = cls.openstack('container delete ' + cls.NAME) + cls.assertOutput('', raw_output) finally: super(ContainerTests, cls).tearDownClass() + def setUp(self): + super(ContainerTests, self).setUp() + # Skip tests if no object-store is present + if not self.haz_object_store: + self.skipTest("No object-store service present") + def test_container_list(self): opts = self.get_opts(['Name']) raw_output = self.openstack('container list' + opts) -- cgit v1.2.1