def test_remove_from_group_already_removed(self): mirror = VNXMirrorGroup.get(t_cli(), name='not_in_group') mg1 = VNXMirrorGroup.get(t_cli(), name='petermg') def _inner(): mg1.remove_mirror(mirror) assert_that(_inner, raises(VNXMirrorGroupMirrorNotMemberError))
def test_add_to_group_existed(self): mirror = VNXMirrorView.get(t_cli(), name='mv0') mg1 = VNXMirrorGroup.get(t_cli(), name='petermg') def _inner(): mg1.add_mirror(mirror) assert_that(_inner, raises(VNXMirrorGroupAlreadyMemberError))
def test_get_single(self): mg = VNXMirrorGroup.get(t_cli(), name='petermg') assert_that(mg, instance_of(VNXMirrorGroup)) assert_that(mg.name, equal_to('petermg')) assert_that(mg.gid, equal_to('50:06:01:60:B6:60:25:22:00:00:00:00')) assert_that(mg.description, equal_to('')) assert_that(mg.state, equal_to('Synchronized')) assert_that(mg.role, equal_to('Primary')) assert_that(mg.condition, equal_to('Active')) assert_that(mg.policy, equal_to(VNXMirrorGroupRecoveryPolicy.MANUAL)) assert_that(mg.mirrors, has_length(2)) assert_that(mg.group_mirrors, has_length(2)) for m in mg.mirrors: assert_that(m, instance_of(VNXMirrorView)) for mg in mg.group_mirrors: assert_that(mg.mirror_name, not_none()) assert_that(mg.src_lun_id, instance_of(int))
def get_mirror_group(self, name=None): return VNXMirrorGroup.get(self._cli, name)
def test_delete_group(self): mg1 = VNXMirrorGroup.get(t_cli(), name='petermg') mg1.delete()
def test_sync_group_already_promoted(self): mg1 = VNXMirrorGroup.get(t_cli(), name='mg_promote_on_primary') assert_that(mg1.sync_group, raises(VNXMirrorGroupAlreadyPromotedError))
def test_sync_group(self): mg1 = VNXMirrorGroup.get(t_cli(), name='petermg') mg1.sync_group()
def test_remove_from_group(self): mirror = VNXMirrorGroup.get(t_cli(), name='mv_sync_2') mg1 = VNXMirrorGroup.get(t_cli(), name='petermg') mg1.remove_mirror(mirror)
def test_add_to_group(self): mirror = VNXMirrorView.get(t_cli(), name='mv_sync_2') mg1 = VNXMirrorGroup.get(t_cli(), name='petermg1') mg1.add_mirror(mirror)
def test_fracture_group(self): mg1 = VNXMirrorGroup.get(t_cli(), name='petermg1') mg1.fracture_group()
def test_promote_group(self): mg1 = VNXMirrorGroup.get(t_cli(), name='petermg1') mg1.promote_group()
def test_get_all(self): mg_list = VNXMirrorGroup.get(t_cli()) assert_that(len(mg_list), equal_to(2)) assert_that(mg_list, instance_of(VNXMirrorGroupList))