From 141b5c6229505836f53a0ee49e532d3326e73e60 Mon Sep 17 00:00:00 2001 From: "jeremy.zhang" Date: Wed, 6 Dec 2017 16:18:15 +0800 Subject: [PATCH] Fix test case in test_volume_unicode.py The test case `test_snapshot_create_volume_description_non_ascii_code` in test_volume_unicode.py breaks the CI job [1], as the test case makes a wrong assumption that the 'descrption' of snapshot will be inherited from source volume. This patch aims to fix it. [1] legacy-tempest-dsvm-full-devstack-plugin-ceph Change-Id: I038684acc488fb1ddba0daff348a23ebf45083da Closes-Bug: #1736676 --- cinder/tests/tempest/api/volume/test_volume_unicode.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cinder/tests/tempest/api/volume/test_volume_unicode.py b/cinder/tests/tempest/api/volume/test_volume_unicode.py index a00502656fb..7f1d828d05d 100644 --- a/cinder/tests/tempest/api/volume/test_volume_unicode.py +++ b/cinder/tests/tempest/api/volume/test_volume_unicode.py @@ -18,6 +18,7 @@ from tempest.api.volume import base as volume_base from tempest.common import waiters from tempest import config from tempest.lib.common.utils import data_utils +import testtools CONF = config.CONF @@ -58,13 +59,18 @@ class CinderUnicodeTest(volume_base.BaseVolumeTest): self.assertEqual(fetched_volume['name'], self.volume_name) + @testtools.skipUnless(CONF.volume_feature_enabled.snapshot, + "Cinder volume snapshots are disabled") def test_snapshot_create_volume_description_non_ascii_code(self): # Create a volume with non-ascii description description = u'\u05e7\u05d9\u05d9\u05e4\u05e9' volume = self.create_volume(description=description) vol_info = self.volumes_client.show_volume(volume['id'])['volume'] self.assertEqual(description, vol_info['description']) - snapshot = self.create_snapshot(volume['id']) + + # Create a snapshot with different non-ascii description + description = u'\u4e2d\u56fd\u793e\u533a' + snapshot = self.create_snapshot(volume['id'], description=description) snapshot_info = self.snapshots_client.show_snapshot( snapshot['id'])['snapshot'] self.assertEqual(description, snapshot_info['description'])