def test_get(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_001')
     assert_that(
         mv.uid,
         equal_to('8F:23:60:B6:60:01:06:50:08:00:00:00:00:00:00:00'))
     assert_that(mv.name, equal_to('testdr_001'))
     assert_that(mv.description, equal_to(''))
     assert_that(mv.logical_unit_numbers, 55)
     assert_that(mv.recovery_policy,
                 equal_to(VNXMirrorViewRecoveryPolicy.AUTO))
     assert_that(len(mv.images), equal_to(2))
     assert_that(mv.images[0], instance_of(VNXMirrorViewImage))
     assert_that(mv.synchronization_rate,
                 equal_to(VNXMirrorViewSyncRate.MEDIUM))
     assert_that(mv.existed, equal_to(True))
     assert_that(mv.state, equal_to('Active'))
     assert_that(mv.image_transitioning, equal_to(False))
     assert_that(mv.image_size, equal_to(104857600))
     assert_that(mv.image_count, equal_to(2))
     assert_that(mv.image_faulted, equal_to(False))
     assert_that(mv.minimum_number_of_images_required, equal_to(0))
     assert_that(mv.synchronizing_progress, equal_to(100))
     assert_that(mv.remote_mirror_status, equal_to('Mirrored'))
     assert_that(mv.faulted, equal_to(False))
     assert_that(mv.transitioning, equal_to(False))
     assert_that(mv.is_primary, equal_to(True))
    def test_add_to_group_existed(self):
        mirror = VNXMirrorViewAsync.get(t_cli(), name='testdr_004')
        mg1 = VNXMirrorGroupAsync.get(t_cli(), name='petermg1')

        def _inner():
            mg1.add_mirror(mirror)

        assert_that(_inner, raises(VNXMirrorGroupAlreadyMemberError))
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.delete()
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'mv8')
     mv.delete()
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.promote_image()
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.promote_image('50:06:01:60:88:60:05:FF')
 def test_fracture_image_success(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     # no error raised
     mv.fracture_image()
 def test_get_all(self):
     mv_list = VNXMirrorViewAsync.get(t_cli())
     assert_that(len(mv_list), equal_to(2))
 def test_add_to_group(self):
     mirror = VNXMirrorViewAsync.get(t_cli(), name='testdr_004')
     mg1 = VNXMirrorGroupAsync.get(t_cli(), name='petermg1')
     mg1.add_mirror(mirror)
 def test_remove_image_success(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_004')
     # no error raised
     mv.remove_image()
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_004')
     mv.remove_image('50:06:01:60:88:60:05:FF')
 def test_get_image_found(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_004')
     image = mv.get_image('50:06:01:60:B6:60:23:7E')
     assert_that(image.state, equal_to(VNXMirrorImageState.SYNCHRONIZED))
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.add_image('192.168.1.94', 72)
 def test_add_image_success(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.add_image('192.168.1.94', 71)
     assert_that(len(mv.images), equal_to(2))
 def test_image_properties(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_001')
     assert_that(mv.is_primary, equal_to(True))
     assert_that(mv.primary_image.is_primary, equal_to(True))
     assert_that(mv.secondary_image.is_primary, equal_to(False))
 def test_force_delete_mirror_has_secondary(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_006')
     # no error raised
     mv.delete(force=True)
 def test_create_and_add(self):
     mirror = VNXMirrorViewAsync.get(t_cli(), name='testdr_004')
     mg = VNXMirrorGroupAsync.create(t_cli(),
                                     name='petermg1',
                                     mirror=mirror)
     assert_that(mg, instance_of(VNXMirrorGroupAsync))
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_003')
     mv.remove_image()
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.fracture_image('50:06:01:60:B6:60:23:8F')
Exemple #20
0
 def get_mirror_view_async(self, name=None):
     return VNXMirrorViewAsync.get(self._cli, name)