Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
 def test_fracture_image_success(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     # no error raised
     mv.fracture_image()
Ejemplo n.º 4
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.fracture_image('50:06:01:60:B6:60:23:8F')
Ejemplo n.º 5
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_003')
     mv.remove_image()
Ejemplo n.º 6
0
 def create_mirror_view_async(self, name, src_lun):
     return VNXMirrorViewAsync.create(self._cli, name, src_lun)
Ejemplo n.º 7
0
 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)
Ejemplo n.º 8
0
 def test_force_delete_mirror_has_secondary(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_006')
     # no error raised
     mv.delete(force=True)
Ejemplo n.º 9
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'mv8')
     mv.delete()
Ejemplo n.º 10
0
 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))
Ejemplo n.º 11
0
 def f():
     VNXMirrorViewAsync.create(t_cli(), 'testdr_003', 72)
Ejemplo n.º 12
0
 def f():
     VNXMirrorViewAsync.create(t_cli(), 'mv0', 244)
Ejemplo n.º 13
0
 def test_create_success(self):
     mv = VNXMirrorViewAsync.create(t_cli(), 'testdr_003', 71)
     assert_that(mv.name, equal_to('testdr_003'))
Ejemplo n.º 14
0
 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))
Ejemplo n.º 15
0
 def test_get_all(self):
     mv_list = VNXMirrorViewAsync.get(t_cli())
     assert_that(len(mv_list), equal_to(2))
Ejemplo n.º 16
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.promote_image('50:06:01:60:88:60:05:FF')
Ejemplo n.º 17
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.promote_image()
Ejemplo n.º 18
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.add_image('192.168.1.94', 72)
Ejemplo n.º 19
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_005')
     mv.delete()
Ejemplo n.º 20
0
 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))
Ejemplo n.º 21
0
 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))
Ejemplo n.º 22
0
 def f():
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_004')
     mv.remove_image('50:06:01:60:88:60:05:FF')
Ejemplo n.º 23
0
 def test_remove_image_success(self):
     mv = VNXMirrorViewAsync.get(t_cli(), 'testdr_004')
     # no error raised
     mv.remove_image()
Ejemplo n.º 24
0
 def get_mirror_view_async(self, name=None):
     return VNXMirrorViewAsync.get(self._cli, name)