From 6d7c3c14f58f15a0add0f1bc03e9e80ce7839f0e Mon Sep 17 00:00:00 2001 From: Chi Lo Date: Wed, 13 May 2020 12:36:42 -0700 Subject: [PATCH] Add skip_checks for Ims test cases Add skip_checks for Ims test cases when image_url is not specified in tempest.conf. Change-Id: If8149c744c735c972fa013bf860ba96df7bf7707 --- ranger_tempest_plugin/config.py | 1 + ranger_tempest_plugin/tests/api/test_images.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ranger_tempest_plugin/config.py b/ranger_tempest_plugin/config.py index d1bd16f..5f09487 100755 --- a/ranger_tempest_plugin/config.py +++ b/ranger_tempest_plugin/config.py @@ -33,6 +33,7 @@ ORM_GROUP = cfg.OptGroup( ORM_GROUP_OPTIONS = [ cfg.StrOpt("image_url", + default='', help="swift container url where image is located"), cfg.StrOpt("ranger_cms_base_url", help="Ranger Project Service URL"), diff --git a/ranger_tempest_plugin/tests/api/test_images.py b/ranger_tempest_plugin/tests/api/test_images.py index afc98fd..5cb77c1 100644 --- a/ranger_tempest_plugin/tests/api/test_images.py +++ b/ranger_tempest_plugin/tests/api/test_images.py @@ -29,6 +29,12 @@ SYNC = lockutils.synchronized_with_prefix(PREFIX) class TestTempestIms(ims_base.ImsBaseOrmTest): + @classmethod + def skip_checks(cls): + super(TestTempestIms, cls).skip_checks() + if not CONF.ranger.image_url: + raise cls.skipException("Image not available") + @classmethod def setup_clients(cls): super(TestTempestIms, cls).setup_clients()