Beispiel #1
0
    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))
Beispiel #2
0
    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))
Beispiel #4
0
 def create_mirror_group(self, name, mirror=None):
     return VNXMirrorGroup.create(self._cli, name, mirror)
Beispiel #5
0
 def get_mirror_group(self, name=None):
     return VNXMirrorGroup.get(self._cli, name)
Beispiel #6
0
 def test_delete_group(self):
     mg1 = VNXMirrorGroup.get(t_cli(), name='petermg')
     mg1.delete()
Beispiel #7
0
 def test_sync_group_already_promoted(self):
     mg1 = VNXMirrorGroup.get(t_cli(), name='mg_promote_on_primary')
     assert_that(mg1.sync_group, raises(VNXMirrorGroupAlreadyPromotedError))
Beispiel #8
0
 def test_sync_group(self):
     mg1 = VNXMirrorGroup.get(t_cli(), name='petermg')
     mg1.sync_group()
Beispiel #9
0
 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)
Beispiel #10
0
 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)
Beispiel #11
0
 def test_fracture_group(self):
     mg1 = VNXMirrorGroup.get(t_cli(), name='petermg1')
     mg1.fracture_group()
Beispiel #12
0
 def test_promote_group(self):
     mg1 = VNXMirrorGroup.get(t_cli(), name='petermg1')
     mg1.promote_group()
Beispiel #13
0
 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))
Beispiel #14
0
 def test_create_and_add(self):
     mirror = VNXMirrorView.get(t_cli(), name='mv_sync_2')
     mg = VNXMirrorGroup.create(t_cli(), name='petermg1', mirror=mirror)
     assert_that(mg, instance_of(VNXMirrorGroup))
Beispiel #15
0
 def _inner():
     VNXMirrorGroup.create(t_cli(), name='test_group_in_use')
Beispiel #16
0
 def test_create(self):
     mg = VNXMirrorGroup.create(t_cli(), name='test_group')
     assert_that(mg, instance_of(VNXMirrorGroup))