Fix test_signed_image_upload_boot_failure skip method

Current skip runs from the testcase and consumes time and resources.
Changed the skip to decorator.

Change-Id: Ia98fa1607c56b34ed1c764873f2909f423d1fffd
This commit is contained in:
Benny Kopilov 2021-01-26 14:34:11 +02:00 committed by Douglas Mendizábal
parent a318f6d77c
commit 2691c0156f
1 changed files with 3 additions and 3 deletions

View File

@ -11,6 +11,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import testtools
from oslo_log import log as logging
from tempest.api.compute import base as compute_base
@ -61,6 +62,8 @@ class ImageSigningTest(barbican_manager.BarbicanScenarioTest):
@decorators.idempotent_id('74f022d6-a6ef-4458-96b7-541deadacf99')
@utils.services('compute', 'image')
@testtools.skipUnless(CONF.image_signature_verification.enforced,
"Image signature verification is not enforced")
def test_signed_image_upload_boot_failure(self):
"""Test that Nova refuses to boot an incorrectly signed image.
@ -80,9 +83,6 @@ class ImageSigningTest(barbican_manager.BarbicanScenarioTest):
* Attempt to boot the incorrectly signed image
* Confirm an exception is thrown
"""
if not CONF.image_signature_verification.enforced:
raise self.skipException("Image signature verification is not "
"enforced in this environment")
img_uuid = self.sign_and_upload_image()