Add test for volume create with non-ascii characters
This test was uploaded since there was a bug [1] while creating
a volume snapshot if the description of the parent volume contains
non-ascii code.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1383899
Related-bug: #1393871
Closes-Bug: #1736676
Change-Id: I9fc41a426b29fad4f4d42a584325f0465a20effe
lkuchlan authored 8 years ago
Sean McGinnis committed 8 years ago
| 17 | 17 | from tempest import config |
| 18 | 18 | from tempest.lib.common.utils import data_utils |
| 19 | 19 | from tempest.lib.common.utils import test_utils |
| 20 | from tempest.lib import decorators | |
| 21 | import testtools | |
| 20 | 22 | |
| 21 | 23 | from cinder_tempest_plugin.api.volume import base |
| 22 | 24 | |
| 61 | 63 | fetched_volume = result['volume'] |
| 62 | 64 | self.assertEqual(fetched_volume['name'], |
| 63 | 65 | self.volume_name) |
| 66 | ||
| 67 | @testtools.skipUnless(CONF.volume_feature_enabled.snapshot, | |
| 68 | "Cinder volume snapshots are disabled") | |
| 69 | @decorators.related_bug('1393871') | |
| 70 | def test_snapshot_create_volume_description_non_ascii_code(self): | |
| 71 | # Create a volume with non-ascii description | |
| 72 | description = u'\u05e7\u05d9\u05d9\u05e4\u05e9' | |
| 73 | volume = self.create_volume(description=description) | |
| 74 | vol_info = self.volumes_client.show_volume(volume['id'])['volume'] | |
| 75 | self.assertEqual(description, vol_info['description']) | |
| 76 | ||
| 77 | # Create a snapshot with different non-ascii description | |
| 78 | description = u'\u4e2d\u56fd\u793e\u533a' | |
| 79 | snapshot = self.create_snapshot(volume['id'], description=description) | |
| 80 | snapshot_info = self.snapshots_client.show_snapshot( | |
| 81 | snapshot['id'])['snapshot'] | |
| 82 | self.assertEqual(description, snapshot_info['description']) | |