[VNX] Fix test case issue

Major changes:
1. Fix mock file issue
2. Fix cg test case issue

Change-Id: Ia95936f3cea611f9fb7517d3b6849f511be2450b
Closes-bug: #1795957
(cherry picked from commit 18fbbd1afe)
(cherry picked from commit 053c33cbfc)
This commit is contained in:
Yong Huang 2019-05-17 10:03:46 +08:00
parent 75bee1af05
commit 4fd1cdcf62
2 changed files with 15 additions and 10 deletions

View File

@ -355,7 +355,7 @@ test_migrate_lun_error:
test_verify_migration:
lun1: &src_lun
_propertis:
_properties:
<<: *lun_base_prop
lun2: &dst_lun
_properties:
@ -1656,10 +1656,13 @@ test_do_create_cg_from_cgsnap:
lun_id: 12
_methods:
attach_snap:
lun: &src_lun_in_cg
_methods:
create_mount_point: *smp_from_src_lun
lun2: &new_lun
_properties:
poll: false
wwn: 'new_wwn'
vnx:
_properties:
_methods:
@ -1668,7 +1671,8 @@ test_do_create_cg_from_cgsnap:
*snapshot_test_delete_snapshot]
get_lun:
_side_effect: [*src_lun_in_cg, *smp_from_src_lun,
*smp_from_src_lun, *lun_migrate, *src_lun, *dst_lun]
*smp_from_src_lun, *new_lun, *lun_migrate,
*src_lun, *new_lun]
get_pool: *pool_test_create_lun
get_migration_session: *session_verify
create_cg: *cg_for_create
@ -1681,7 +1685,8 @@ test_do_clone_cg:
get_snap: *snapshot_test_delete_snapshot
get_lun:
_side_effect: [*src_lun_in_cg, *smp_from_src_lun,
*smp_from_src_lun, *lun_migrate, *src_lun, *dst_lun]
*smp_from_src_lun, *new_lun, *lun_migrate,
*src_lun, *new_lun]
get_pool: *pool_test_create_lun
get_migration_session: *session_verify
create_cg: *cg_for_create

View File

@ -218,9 +218,9 @@ class TestCommonAdapter(test.TestCase):
vnx_common.do_create_cg_from_cgsnap(
cg_id, cg_host, volumes, cgsnap_id, snaps))
self.assertIsNone(model_update)
self.assertIsNotNone(
re.findall('id^12',
volume_updates[0]['provider_location']))
provider_location = re.findall('id\^12',
volume_updates[0]['provider_location'])
self.assertEqual(1, len(provider_location))
@res_mock.patch_common_adapter
def test_create_cloned_cg(self, common, _):
@ -277,9 +277,9 @@ class TestCommonAdapter(test.TestCase):
model_update, volume_updates = vnx_common.do_clone_cg(
cg_id, cg_host, volumes, src_cg_id, src_volumes)
self.assertIsNone(model_update)
self.assertIsNotNone(
re.findall('id^12',
volume_updates[0]['provider_location']))
provider_location = re.findall('id\^12',
volume_updates[0]['provider_location'])
self.assertEqual(1, len(provider_location))
@res_mock.patch_common_adapter
def test_parse_pools(self, vnx_common, mocked):