Example #1
0
    def test_connection_port_not_in_hba_port_set(self):
        ports = self.hba_port_set()
        c_port = VNXConnectionPort(sp='a', port_id=4, cli=t_cli())
        assert_that(ports, is_not(has_item(c_port)))

        c_port = VNXConnectionPort(sp='a', port_id=9, cli=t_cli())
        assert_that(ports, is_not(has_item(c_port)))
Example #2
0
 def test_set_path_with_fcoe_port_success(self):
     uid = 'iqn.1992-04.com.abc:a.b.c'
     port = VNXConnectionPort.get(sp=VNXSPEnum.SP_A, port_id=8,
                                  vport_id=0, cli=t_cli())
     sg = VNXStorageGroup(cli=t_cli(), name='sg0')
     # no error raised
     sg.connect_hba(port, uid, 'host0')
Example #3
0
    def test_connection_port_not_in_hba_port_set(self):
        ports = self.hba_port_set()
        c_port = VNXConnectionPort(sp='a', port_id=4, cli=t_cli())
        assert_that(ports, is_not(has_item(c_port)))

        c_port = VNXConnectionPort(sp='a', port_id=9, cli=t_cli())
        assert_that(ports, is_not(has_item(c_port)))
Example #4
0
 def f():
     uid = 'iqn.1992-04.com.abc:a.b.c'
     port = VNXConnectionPort.get(sp=VNXSPEnum.SP_A,
                                  port_id=10,
                                  cli=t_cli())[0]
     sg = VNXStorageGroup(cli=t_cli(), name='sg0')
     sg.set_path(port, uid, 'host0')
Example #5
0
 def test_hba_in_sp_port(self):
     sg = VNXStorageGroup(name='server7', cli=t_cli())
     hba = None
     for hba in sg.ports:
         if hba.sp == VNXSPEnum.SP_A and hba.port_id == 0:
             break
     ports = VNXSPPort.get(t_cli())
     assert_that(ports, has_item(hba))
Example #6
0
 def test_hba_in_sp_port(self):
     sg = VNXStorageGroup(name='server7', cli=t_cli())
     hba = None
     for hba in sg.ports:
         if hba.sp == VNXSPEnum.SP_A and hba.port_id == 0:
             break
     ports = VNXSPPort.get(t_cli())
     assert_that(ports, has_item(hba))
Example #7
0
 def test_mount_point_properties(self):
     lun = VNXLun(name='l1', cli=t_cli())
     m1 = lun.create_mount_point(name='m1')
     assert_that(m1.name, equal_to('m1'))
     assert_that(m1.lun_id, equal_to(4057))
     s1 = m1.attached_snapshot
     assert_that(s1, instance_of(VNXSnap))
     assert_that(s1._cli, equal_to(t_cli()))
     assert_that(s1._get_name(), equal_to('s1'))
Example #8
0
 def test_set_path_with_fcoe_port_success(self):
     uid = 'iqn.1992-04.com.abc:a.b.c'
     port = VNXConnectionPort.get(sp=VNXSPEnum.SP_A,
                                  port_id=8,
                                  vport_id=0,
                                  cli=t_cli())
     sg = VNXStorageGroup(cli=t_cli(), name='sg0')
     # no error raised
     sg.connect_hba(port, uid, 'host0')
Example #9
0
 def test_mount_point_properties(self):
     lun = VNXLun(name='l1', cli=t_cli())
     m1 = lun.create_mount_point(name='m1')
     assert_that(m1.name, equal_to('m1'))
     assert_that(m1.lun_id, equal_to(4057))
     s1 = m1.attached_snapshot
     assert_that(s1, instance_of(VNXSnap))
     assert_that(s1._cli, equal_to(t_cli()))
     assert_that(s1._get_name(), equal_to('s1'))
Example #10
0
    def test_migration_on_complete_session_not_found(self):
        c = _Counter()

        def on_complete():
            c.increase()

        l0 = VNXLun(name='lun0', cli=t_cli())
        l1 = VNXLun(name='lun1', cli=t_cli())
        l0.migrate(l1, on_complete=on_complete).join()
        assert_that(c.x, equal_to(1))
Example #11
0
    def test_migration_on_error(self):
        c = _Counter()

        def on_error():
            c.decrease()

        l0 = VNXLun(name='lun0', cli=t_cli())
        l2 = VNXLun(name='lun2', cli=t_cli())
        l2.migrate(l0, on_error=on_error).join()
        assert_that(c.x, equal_to(-1))
Example #12
0
 def test_attach_alu(self):
     sg = self.test_sg()
     lun = VNXLun(name='x', cli=t_cli())
     assert_that(sg.has_alu(0), equal_to(False))
     sg.attach_alu(lun)
     assert_that(sg.has_alu(0), equal_to(True))
     assert_that(sg.get_hlu(0), equal_to(1))
Example #13
0
 def test_disks(self):
     rg = VNXRaidGroup(4, t_cli())
     disks = rg.disks
     assert_that(len(disks), equal_to(5))
     for disk in disks:
         assert_that(disk, instance_of(VNXDisk))
         assert_that(disk.existed, equal_to(True))
Example #14
0
 def test_get_lun(self):
     pool = VNXPool(pool_id=1, cli=t_cli())
     assert_that(pool.name, equal_to('Pool_daq'))
     lun_list = pool.get_lun()
     assert_that(len(lun_list), equal_to(50))
     assert_that(pool.lun_list, equal_to(lun_list))
     assert_that(len(set(lun_list.pool_name)), equal_to(1))
Example #15
0
 def test_get_lun(self):
     pool = VNXPool(pool_id=1, cli=t_cli())
     assert_that(pool.name, equal_to('Pool_daq'))
     lun_list = pool.get_lun()
     assert_that(len(lun_list), equal_to(50))
     assert_that(pool.lun_list, equal_to(lun_list))
     assert_that(len(set(lun_list.pool_name)), equal_to(1))
Example #16
0
 def test_change_name_failed(self):
     l = VNXLun(name='l1', cli=t_cli())
     try:
         l.name = 'l3'
         self.fail('should have raised an exception.')
     except VNXModifyLunError:
         assert_that(l._get_name(), equal_to('l1'))
Example #17
0
 def test_disks(self):
     rg = VNXRaidGroup(4, t_cli())
     disks = rg.disks
     assert_that(len(disks), equal_to(5))
     for disk in disks:
         assert_that(disk, instance_of(VNXDisk))
         assert_that(disk.existed, equal_to(True))
Example #18
0
 def test_lun_perf_counters(self):
     l = VNXLun(lun_id=3, cli=t_cli())
     assert_that(l.read_requests, equal_to(1))
     assert_that(l.read_requests_sp_a, equal_to(2))
     assert_that(l.read_requests_sp_b, equal_to(3))
     assert_that(l.write_requests, equal_to(4))
     assert_that(l.write_requests_sp_a, equal_to(5))
     assert_that(l.write_requests_sp_b, equal_to(6))
     assert_that(l.blocks_read, equal_to(7))
     assert_that(l.blocks_read_sp_a, equal_to(8))
     assert_that(l.blocks_read_sp_b, equal_to(9))
     assert_that(l.blocks_written, equal_to(10))
     assert_that(l.blocks_written_sp_a, equal_to(11))
     assert_that(l.blocks_written_sp_b, equal_to(12))
     assert_that(l.busy_ticks, equal_to(13))
     assert_that(l.busy_ticks_sp_a, equal_to(14))
     assert_that(l.busy_ticks_sp_b, equal_to(15))
     assert_that(l.idle_ticks, equal_to(16))
     assert_that(l.idle_ticks_sp_a, equal_to(17))
     assert_that(l.idle_ticks_sp_b, equal_to(18))
     assert_that(l.sum_of_outstanding_requests, equal_to(19))
     assert_that(l.sum_of_outstanding_requests_sp_a, equal_to(20))
     assert_that(l.sum_of_outstanding_requests_sp_b, equal_to(21))
     assert_that(l.non_zero_request_count_arrivals, equal_to(22))
     assert_that(l.non_zero_request_count_arrivals_sp_a, equal_to(23))
     assert_that(l.non_zero_request_count_arrivals_sp_b, equal_to(24))
     assert_that(l.implicit_trespasses, equal_to(25))
     assert_that(l.implicit_trespasses_sp_a, equal_to(26))
     assert_that(l.implicit_trespasses_sp_b, equal_to(27))
     assert_that(l.explicit_trespasses, equal_to(28))
     assert_that(l.explicit_trespasses_sp_a, equal_to(29))
     assert_that(l.explicit_trespasses_sp_b, equal_to(30))
     assert_that(l.extreme_performance, equal_to(1.96))
     assert_that(l.performance, equal_to(5.68))
     assert_that(l.capacity, equal_to(92.37))
Example #19
0
 def test_host_with_lun(self):
     host = VNXHost.get(cli=t_cli(), name='ubuntu14')
     assert_that(host.lun_list.lun_id, only_contains(4, 15))
     assert_that(host.alu_hlu_map[4], equal_to(14))
     assert_that(host.alu_hlu_map[15], equal_to(154))
     assert_that(host.alu_ids, only_contains(4, 15))
     assert_that(host.hlu_ids, only_contains(14, 154))
Example #20
0
 def test_host_property(self):
     host = VNXHost.get(cli=t_cli(), name='ubuntu-server7')
     assert_that(host.name, equal_to('ubuntu-server7'))
     assert_that(host.existed, equal_to(True))
     assert_that(len(host.connections), equal_to(15))
     assert_that(host.storage_group.name, equal_to('ubuntu-server7'))
     assert_that(len(host.lun_list), equal_to(0))
Example #21
0
 def test_modify_snap_failed(self):
     snap = VNXSnap(cli=t_cli(), name='s2')
     try:
         snap.modify(new_name='s1')
         self.fail('should have raise an exception.')
     except VNXSnapError:
         assert_that(snap._name, equal_to('s2'))
Example #22
0
 def test_lun_perf_counters(self):
     l = VNXLun(lun_id=3, cli=t_cli())
     assert_that(l.read_requests, equal_to(1))
     assert_that(l.read_requests_sp_a, equal_to(2))
     assert_that(l.read_requests_sp_b, equal_to(3))
     assert_that(l.write_requests, equal_to(4))
     assert_that(l.write_requests_sp_a, equal_to(5))
     assert_that(l.write_requests_sp_b, equal_to(6))
     assert_that(l.blocks_read, equal_to(7))
     assert_that(l.blocks_read_sp_a, equal_to(8))
     assert_that(l.blocks_read_sp_b, equal_to(9))
     assert_that(l.blocks_written, equal_to(10))
     assert_that(l.blocks_written_sp_a, equal_to(11))
     assert_that(l.blocks_written_sp_b, equal_to(12))
     assert_that(l.busy_ticks, equal_to(13))
     assert_that(l.busy_ticks_sp_a, equal_to(14))
     assert_that(l.busy_ticks_sp_b, equal_to(15))
     assert_that(l.idle_ticks, equal_to(16))
     assert_that(l.idle_ticks_sp_a, equal_to(17))
     assert_that(l.idle_ticks_sp_b, equal_to(18))
     assert_that(l.sum_of_outstanding_requests, equal_to(19))
     assert_that(l.sum_of_outstanding_requests_sp_a, equal_to(20))
     assert_that(l.sum_of_outstanding_requests_sp_b, equal_to(21))
     assert_that(l.non_zero_request_count_arrivals, equal_to(22))
     assert_that(l.non_zero_request_count_arrivals_sp_a, equal_to(23))
     assert_that(l.non_zero_request_count_arrivals_sp_b, equal_to(24))
     assert_that(l.implicit_trespasses, equal_to(25))
     assert_that(l.implicit_trespasses_sp_a, equal_to(26))
     assert_that(l.implicit_trespasses_sp_b, equal_to(27))
     assert_that(l.explicit_trespasses, equal_to(28))
     assert_that(l.explicit_trespasses_sp_a, equal_to(29))
     assert_that(l.explicit_trespasses_sp_b, equal_to(30))
     assert_that(l.extreme_performance, equal_to(1.96))
     assert_that(l.performance, equal_to(5.68))
     assert_that(l.capacity, equal_to(92.37))
Example #23
0
 def test_change_name_failed(self):
     l = VNXLun(name='l1', cli=t_cli())
     try:
         l.name = 'l3'
         self.fail('should have raised an exception.')
     except VNXModifyLunError:
         assert_that(l._get_name(), equal_to('l1'))
Example #24
0
 def test_get_sg_list(self):
     sg_list = VNXStorageGroupList(t_cli())
     assert_that(
         sg_list.name,
         has_items('VNX9495', 'ubuntu-server11', 'ubuntu-server7',
                   'ubuntu14'))
     assert_that(len(sg_list), equal_to(4))
Example #25
0
 def test_get_all(self):
     disks = VNXDisk.get(t_cli())
     assert_that(len(disks), equal_to(180))
     for disk in disks:
         if disk.index == '4_0_e8':
             verify_disk_4_0_e8(disk)
             break
Example #26
0
 def test_get(self):
     mv = VNXMirrorView.get(t_cli(), 'mv_sync_2')
     assert_that(
         mv.uid,
         equal_to('50:06:01:60:88:60:05:FE:04:00:00:00:00:00:00:00'))
     assert_that(mv.name, equal_to('mv_sync_2'))
     assert_that(mv.description, equal_to(''))
     assert_that(mv.logical_unit_numbers, 30)
     assert_that(mv.quiesce_threshold, equal_to(60))
     assert_that(mv.recovery_policy,
                 equal_to(VNXMirrorViewRecoveryPolicy.MANUAL))
     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(2097152))
     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.write_intent_log_used, equal_to(True))
     assert_that(mv.synchronizing_progress, equal_to(100))
     assert_that(mv.remote_mirror_status, equal_to('Secondary Copy'))
     assert_that(mv.faulted, equal_to(False))
     assert_that(mv.transitioning, equal_to(False))
Example #27
0
 def test_get(self):
     mv = VNXMirrorView.get(t_cli(), 'mv_sync_2')
     assert_that(mv.uid, equal_to(
         '50:06:01:60:88:60:05:FE:04:00:00:00:00:00:00:00'))
     assert_that(mv.name, equal_to('mv_sync_2'))
     assert_that(mv.description, equal_to(''))
     assert_that(mv.logical_unit_numbers, 30)
     assert_that(mv.quiesce_threshold, equal_to(60))
     assert_that(mv.recovery_policy,
                 equal_to(VNXMirrorViewRecoveryPolicy.MANUAL))
     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(2097152))
     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.write_intent_log_used, equal_to(True))
     assert_that(mv.synchronizing_progress, equal_to(100))
     assert_that(mv.remote_mirror_status, equal_to('Secondary Copy'))
     assert_that(mv.faulted, equal_to(False))
     assert_that(mv.transitioning, equal_to(False))
Example #28
0
 def test_get_snap(self):
     lun = VNXLun(lun_id=196, cli=t_cli())
     assert_that(lun.name, equal_to('Exch-BronzePlan-AppSync-2.2'))
     assert_that(lun.lun_id, equal_to(196))
     snaps = lun.get_snap()
     assert_that(len(snaps), equal_to(13))
     for snap in snaps:
         assert_that(snap.source_luns, has_item(lun.lun_id))
Example #29
0
 def test_get_snap(self):
     lun = VNXLun(lun_id=196, cli=t_cli())
     assert_that(lun.name, equal_to('Exch-BronzePlan-AppSync-2.2'))
     assert_that(lun.lun_id, equal_to(196))
     snaps = lun.get_snap()
     assert_that(len(snaps), equal_to(13))
     for snap in snaps:
         assert_that(snap.source_luns, has_item(lun.lun_id))
Example #30
0
 def test_get_sg_os01(self):
     sg = VNXStorageGroup(name='os01', cli=t_cli())
     assert_that(len(sg.hba_sp_pairs), equal_to(1))
     assert_that(sg.hba_sp_pairs, instance_of(VNXStorageGroupHBAList))
     hba = sg.hba_sp_pairs[0]
     assert_that(hba.sp, equal_to(VNXSPEnum.SP_A))
     assert_that(hba.uid,
                 equal_to('iqn.1993-08.org.debian:01:95bbe389e025'))
     assert_that(hba.port_id, equal_to(4))
Example #31
0
 def test_get_rg_list(self):
     rgs = VNXRaidGroup.get(t_cli())
     assert_that(len(rgs), equal_to(7))
     for rg in rgs:
         if rg.raid_group_id == 0:
             verify_raid0(rg)
             break
     else:
         self.fail('RAID group 0 not found.')
Example #32
0
 def test_get(self):
     ndu = VNXNdu.get(t_cli(), '-VNXSnapshots')
     assert_that(ndu.name, equal_to('-VNXSnapshots'))
     assert_that(ndu.revision, equal_to('-'))
     assert_that(ndu.commit_required, equal_to(False))
     assert_that(ndu.revert_possible, equal_to(False))
     assert_that(ndu.active_state, equal_to(True))
     assert_that(ndu.is_installation_completed, equal_to(True))
     assert_that(ndu.is_this_system_software, equal_to(False))
Example #33
0
 def test_get(self):
     ndu = VNXNdu.get(t_cli(), '-VNXSnapshots')
     assert_that(ndu.name, equal_to('-VNXSnapshots'))
     assert_that(ndu.revision, equal_to('-'))
     assert_that(ndu.commit_required, equal_to(False))
     assert_that(ndu.revert_possible, equal_to(False))
     assert_that(ndu.active_state, equal_to(True))
     assert_that(ndu.is_installation_completed, equal_to(True))
     assert_that(ndu.is_this_system_software, equal_to(False))
Example #34
0
 def test_property_instance_cache(self):
     m1 = VNXLun(name='m1', cli=t_cli())
     s1 = m1.attached_snapshot
     s2 = m1.attached_snapshot
     assert_that(hash(s1), equal_to(hash(s2)))
     m1.update()
     s3 = m1.attached_snapshot
     assert_that(hash(s3), is_not(equal_to(hash(s1))))
     assert_that(s1._cli, not_none())
Example #35
0
 def test_get_rg_list(self):
     rgs = VNXRaidGroup.get(t_cli())
     assert_that(len(rgs), equal_to(7))
     for rg in rgs:
         if rg.raid_group_id == 0:
             verify_raid0(rg)
             break
     else:
         self.fail('RAID group 0 not found.')
Example #36
0
 def test_property_instance_cache(self):
     m1 = VNXLun(name='m1', cli=t_cli())
     s1 = m1.attached_snapshot
     s2 = m1.attached_snapshot
     assert_that(hash(s1), equal_to(hash(s2)))
     m1.update()
     s3 = m1.attached_snapshot
     assert_that(hash(s3), is_not(equal_to(hash(s1))))
     assert_that(s1._cli, not_none())
Example #37
0
 def test_create_mount_point(self):
     lun = VNXLun(name='l1', cli=t_cli())
     m1 = lun.create_mount_point(mount_point_name='m1')
     assert_that(m1.name, equal_to('m1'))
     assert_that(m1.lun_id, equal_to(4057))
     assert_that(m1.attached_snapshot, equal_to('s1'))
     m2 = lun.create_mount_point(mount_point_name='m2')
     assert_that(lun.snapshot_mount_points, only_contains(4056, 4057))
     assert_that(m2.attached_snapshot, equal_to('N/A'))
Example #38
0
 def test_get_hlu_to_add_shuffle(self):
     sg = VNXStorageGroup.get(t_cli(), 'server7')
     first = sg._get_hlu_to_add(12)
     sg._delete_alu(12)
     assert_that(len(sg.get_alu_hlu_map()), equal_to(2))
     second = sg._get_hlu_to_add(12)
     assert_that(first, is_not(equal_to(second)))
     sg._delete_alu(12)
     assert_that(len(sg.get_alu_hlu_map()), equal_to(2))
Example #39
0
 def test_create_mount_point(self):
     lun = VNXLun(name='l1', cli=t_cli())
     m1 = lun.create_mount_point(mount_point_name='m1')
     assert_that(m1.name, equal_to('m1'))
     assert_that(m1.lun_id, equal_to(4057))
     assert_that(m1.attached_snapshot, equal_to('s1'))
     m2 = lun.create_mount_point(mount_point_name='m2')
     assert_that(lun.snapshot_mount_points, only_contains(4056, 4057))
     assert_that(m2.attached_snapshot, equal_to('N/A'))
Example #40
0
 def test_empty_sg_property(self):
     sg = VNXStorageGroup.get(t_cli(), 'sg1')
     wwn = 'BB:50:E8:2F:23:01:E6:11:83:36:00:60:16:58:B3:E9'
     assert_that(sg.name, equal_to('sg1'))
     assert_that(sg.wwn, equal_to(wwn))
     assert_that(len(sg.initiator_uid_list), equal_to(0))
     assert_that(len(sg.ports), equal_to(0))
     assert_that(len(sg.fc_ports), equal_to(0))
     assert_that(len(sg.iscsi_ports), equal_to(0))
     assert_that(len(sg.hba_sp_pairs), equal_to(0))
Example #41
0
 def test_properties(self):
     mv = VNXMirrorView.get(t_cli(), 'mv_sync_2')
     image = mv.get_image('50:06:01:60:88:60:05:FE')
     assert_that(image.uid, equal_to('50:06:01:60:88:60:05:FE'))
     assert_that(image.existed, equal_to(True))
     assert_that(image.is_image_primary, equal_to(True))
     assert_that(image.logical_unit_uid, equal_to(
         '60:06:01:60:41:C4:3D:00:6E:1C:50:9D:05:95:E5:11'))
     assert_that(image.image_condition, equal_to('Primary Image'))
     assert_that(image.preferred_sp, equal_to(VNXSPEnum.SP_A))
Example #42
0
 def test_create_mount_point_success(self):
     lun = VNXLun(name='l1', cli=t_cli())
     m2 = lun.create_mount_point(name='m2')
     assert_that(lun.snapshot_mount_points, instance_of(VNXLunList))
     assert_that(str(lun), contains_string('"VNXLunList": ['))
     for smp in lun.snapshot_mount_points:
         assert_that(smp, instance_of(VNXLun))
         pl = smp.primary_lun
         assert_that(pl, instance_of(VNXLun))
         assert_that(pl._get_name(), equal_to('l1'))
     assert_that(m2.attached_snapshot, none())
Example #43
0
 def test_properties(self):
     ms = VNXMigrationSession(0, t_cli())
     assert_that(ms.source_lu_id, equal_to(0))
     assert_that(ms.source_lu_name, equal_to('LUN 0'))
     assert_that(ms.dest_lu_id, equal_to(1))
     assert_that(ms.dest_lu_name, equal_to('LUN 1'))
     assert_that(ms.migration_rate, equal_to(VNXMigrationRate.HIGH))
     assert_that(ms.percent_complete, equal_to(50.0))
     assert_that(ms.time_remaining, equal_to('0 second(s)'))
     assert_that(ms.current_state, equal_to('MIGRATING'))
     assert_that(ms.existed, equal_to(True))
Example #44
0
 def test_properties(self):
     mv = VNXMirrorView.get(t_cli(), 'mv_sync_2')
     image = mv.get_image('50:06:01:60:88:60:05:FE')
     assert_that(image.uid, equal_to('50:06:01:60:88:60:05:FE'))
     assert_that(image.existed, equal_to(True))
     assert_that(image.is_image_primary, equal_to(True))
     assert_that(
         image.logical_unit_uid,
         equal_to('60:06:01:60:41:C4:3D:00:6E:1C:50:9D:05:95:E5:11'))
     assert_that(image.image_condition, equal_to('Primary Image'))
     assert_that(image.preferred_sp, equal_to(VNXSPEnum.SP_A))
Example #45
0
 def test_properties(self):
     ms = VNXMigrationSession(0, t_cli())
     assert_that(ms.source_lu_id, equal_to(0))
     assert_that(ms.source_lu_name, equal_to('LUN 0'))
     assert_that(ms.dest_lu_id, equal_to(1))
     assert_that(ms.dest_lu_name, equal_to('LUN 1'))
     assert_that(ms.migration_rate, equal_to(VNXMigrationRate.HIGH))
     assert_that(ms.percent_complete, equal_to(50.0))
     assert_that(ms.time_remaining, equal_to('0 second(s)'))
     assert_that(ms.current_state, equal_to('MIGRATING'))
     assert_that(ms.existed, equal_to(True))
Example #46
0
 def test_create_mount_point_success(self):
     lun = VNXLun(name='l1', cli=t_cli())
     m2 = lun.create_mount_point(name='m2')
     assert_that(lun.snapshot_mount_points, instance_of(VNXLunList))
     assert_that(str(lun), contains_string('"VNXLunList": ['))
     for smp in lun.snapshot_mount_points:
         assert_that(smp, instance_of(VNXLun))
         pl = smp.primary_lun
         assert_that(pl, instance_of(VNXLun))
         assert_that(pl._get_name(), equal_to('l1'))
     assert_that(m2.attached_snapshot, none())
Example #47
0
    def test_sp_properties(self):
        sp = VNXStorageProcessor(t_cli(), VNXSPEnum.SP_A, '1.1.1.2')
        assert_that(sp.cabinet, equal_to('DPE9'))
        assert_that(sp.signature, equal_to(4022290))
        assert_that(sp.name, equal_to('A'))
        assert_that(sp.enum, equal_to(VNXSPEnum.SP_A))

        sp = VNXStorageProcessor(t_cli(), VNXSPEnum.SP_B, '1.1.1.3')
        assert_that(sp.cabinet, equal_to('DPE9'))
        assert_that(sp.signature, equal_to(4022287))
        assert_that(sp.name, equal_to('B'))
        assert_that(sp.revision, equal_to('05.33.008.3.297'))
        assert_that(sp.serial, equal_to('FCNJT152200015'))
        assert_that(sp.memory_size, equal_to(32768))
        assert_that(sp.enum, equal_to(VNXSPEnum.SP_B))
        assert_that(sp.statistics_logging, equal_to(True))
        assert_that(sp.system_fault_led, equal_to(False))
        assert_that(sp.read_cache_enabled, equal_to(True))
        assert_that(sp.write_cache_enabled, equal_to(True))
        assert_that(sp.max_requests, none())
        assert_that(sp.average_requests, none())
        assert_that(sp.hard_errors, none())
        assert_that(sp.total_reads, equal_to(7978))
        assert_that(sp.total_writes, equal_to(6364257))
        assert_that(sp.prct_busy, equal_to(1.91))
        assert_that(sp.prct_idle, equal_to(98.0))
        assert_that(str(sp.timestamp), equal_to('2016-04-26 09:59:16'))
        assert_that(sp.day_of_the_week, equal_to('Tuesday'))
        assert_that(sp.read_requests, equal_to(7978))
        assert_that(sp.write_requests, equal_to(6364257))
        assert_that(sp.blocks_read, equal_to(262334))
        assert_that(sp.blocks_written, equal_to(198312227))
        assert_that(sp.sum_queue_lengths_by_arrivals, equal_to(8059572))
        assert_that(sp.arrivals_to_non_zero_queue, equal_to(1321389))
        assert_that(sp.hw_flush_on, equal_to(False))
        assert_that(sp.idle_flush_on, equal_to(False))
        assert_that(sp.lw_flush_off, equal_to(False))
        assert_that(sp.write_cache_flushes, equal_to(468636))
        assert_that(sp.write_cache_blocks_flushed, equal_to(477297069))
        assert_that(sp.controller_busy_ticks, equal_to(46703))
        assert_that(sp.controller_idle_ticks, equal_to(2394689))
Example #48
0
    def test_sp_properties(self):
        sp = VNXStorageProcessor(t_cli(), VNXSPEnum.SP_A, '1.1.1.2')
        assert_that(sp.cabinet, equal_to('DPE9'))
        assert_that(sp.signature, equal_to(4022290))
        assert_that(sp.name, equal_to('A'))
        assert_that(sp.enum, equal_to(VNXSPEnum.SP_A))

        sp = VNXStorageProcessor(t_cli(), VNXSPEnum.SP_B, '1.1.1.3')
        assert_that(sp.cabinet, equal_to('DPE9'))
        assert_that(sp.signature, equal_to(4022287))
        assert_that(sp.name, equal_to('B'))
        assert_that(sp.revision, equal_to('05.33.008.3.297'))
        assert_that(sp.serial, equal_to('FCNJT152200015'))
        assert_that(sp.memory_size, equal_to(32768))
        assert_that(sp.enum, equal_to(VNXSPEnum.SP_B))
        assert_that(sp.statistics_logging, equal_to(True))
        assert_that(sp.system_fault_led, equal_to(False))
        assert_that(sp.read_cache_enabled, equal_to(True))
        assert_that(sp.write_cache_enabled, equal_to(True))
        assert_that(sp.max_requests, none())
        assert_that(sp.average_requests, none())
        assert_that(sp.hard_errors, none())
        assert_that(sp.total_reads, equal_to(7978))
        assert_that(sp.total_writes, equal_to(6364257))
        assert_that(sp.prct_busy, equal_to(1.91))
        assert_that(sp.prct_idle, equal_to(98.0))
        assert_that(str(sp.timestamp), equal_to('2016-04-26 09:59:16'))
        assert_that(sp.day_of_the_week, equal_to('Tuesday'))
        assert_that(sp.read_requests, equal_to(7978))
        assert_that(sp.write_requests, equal_to(6364257))
        assert_that(sp.blocks_read, equal_to(262334))
        assert_that(sp.blocks_written, equal_to(198312227))
        assert_that(sp.sum_queue_lengths_by_arrivals, equal_to(8059572))
        assert_that(sp.arrivals_to_non_zero_queue, equal_to(1321389))
        assert_that(sp.hw_flush_on, equal_to(False))
        assert_that(sp.idle_flush_on, equal_to(False))
        assert_that(sp.lw_flush_off, equal_to(False))
        assert_that(sp.write_cache_flushes, equal_to(468636))
        assert_that(sp.write_cache_blocks_flushed, equal_to(477297069))
        assert_that(sp.controller_busy_ticks, equal_to(46703))
        assert_that(sp.controller_idle_ticks, equal_to(2394689))
Example #49
0
 def test_get_port(self):
     port = VNXSPPort.get(t_cli(), VNXSPEnum.SP_A, 0)
     assert_that(port.sp, equal_to(VNXSPEnum.SP_A))
     assert_that(port.port_id, equal_to(0))
     assert_that(port.wwn, equal_to(
         '50:06:01:60:B6:E0:16:81:50:06:01:60:36:E0:16:81'))
     assert_that(port.link_status, equal_to('Up'))
     assert_that(port.port_status, equal_to('Online'))
     assert_that(port.switch_present, equal_to(True))
     assert_that(port.speed_value, equal_to('8Gbps'))
     assert_that(port.registered_initiators, equal_to(3))
     assert_that(port.logged_in_initiators, equal_to(1))
     assert_that(port.not_logged_in_initiators, equal_to(2))
Example #50
0
 def test_properties(self):
     sp = VNXNetworkAdmin(VNXSPEnum.SP_A, t_cli())
     with sp.with_no_poll():
         assert_that(sp.name, equal_to('vnx2_1_52'))
         assert_that(sp.sp, equal_to(VNXSPEnum.SP_A))
         assert_that(sp.link_status, equal_to('Link-Up'))
         assert_that(sp.subnet_mask, equal_to('255.255.255.0'))
         assert_that(sp.ip, equal_to('192.168.1.52'))
         assert_that(sp.ip_mode, equal_to('Manual'))
         assert_that(sp.gateway, equal_to('192.168.1.1'))
         assert_that(sp.virtual_port_id, equal_to(0))
         assert_that(sp.ipv6_enabled, equal_to(False))
         assert_that(sp.port_id, equal_to(0))
         assert_that(sp.vlan_id, equal_to(None))
Example #51
0
 def test_properties(self):
     snap = VNXSnap('gan_snap', t_cli())
     assert_that(snap.name, equal_to('gan_snap'))
     assert_that(snap.description, equal_to('gan snap'))
     assert_that(snap.creation_time, equal_to('05/24/13 20:06:12'))
     assert_that(snap.last_modify_time, equal_to('07/23/14 12:28:42'))
     assert_that(snap.last_modified_by, equal_to('N/A'))
     assert_that(snap.source_luns, equal_to([57]))
     assert_that(snap.source_cg, equal_to('N/A'))
     assert_that(snap.primary_luns, equal_to([57]))
     assert_that(snap.state, equal_to('Ready'))
     assert_that(snap.status, equal_to('OK(0x0)'))
     assert_that(snap.allow_read_write, equal_to(True))
     assert_that(snap.modified, equal_to(True))
     assert_that(snap.attached_luns, equal_to([]))
     assert_that(snap.allow_auto_delete, equal_to(True))
     assert_that(snap.expiration_date, equal_to('Never'))
     assert_that(snap.existed, equal_to(True))
Example #52
0
 def test_properties(self):
     f = VNXPoolFeature(t_cli())
     assert_that(f.is_virtual_provisioning_supported, equal_to(False))
     assert_that(f.max_pools, equal_to(40))
     assert_that(f.max_disks_per_pool, equal_to(746))
     assert_that(f.max_disks_for_all_pools, equal_to(746))
     assert_that(f.max_disks_per_operation, equal_to(120))
     assert_that(f.max_pool_luns, equal_to(2100))
     assert_that(f.min_pool_lun_size_blocks, equal_to(1))
     assert_that(f.max_pool_lun_size_blocks, equal_to(549755813888))
     assert_that(f.max_pool_lun_size_gbs, equal_to(262144.0))
     assert_that(f.total_number_of_pools, equal_to(4))
     assert_that(f.total_pool_luns, equal_to(3))
     assert_that(f.total_thin_luns, equal_to(2))
     assert_that(f.total_non_thin_luns, equal_to(1))
     assert_that(f.number_of_disks_used_in_pools, equal_to(15))
     assert_that(f.available_disk_indices, has_items('0_0_B8', '0_0_B9'))
     assert_that(f.background_operation_state, equal_to('None'))
     assert_that(f.background_rate, equal_to('Medium'))
Example #53
0
 def test_lun_properties(self):
     wwn = '60:06:01:60:12:60:3D:00:95:63:38:87:9D:69:E5:11'
     l = VNXLun(lun_id=3, cli=t_cli())
     assert_that(l.state, equal_to('Ready'))
     assert_that(l.wwn, equal_to(wwn))
     assert_that(l.status, equal_to('OK(0x0)'))
     assert_that(l.operation, equal_to('None'))
     assert_that(l.total_capacity_gb, equal_to(500.0))
     assert_that(l.current_owner, equal_to(VNXSPEnum.SP_A))
     assert_that(l.default_owner, equal_to(VNXSPEnum.SP_A))
     assert_that(l.attached_snapshot, none())
     assert_that(l.lun_id, equal_to(3))
     assert_that(l.name, equal_to('File_CS0_21132_0_d7'))
     assert_that(l.pool_name, equal_to('Pool4File'))
     assert_that(l.is_thin_lun, equal_to(True))
     assert_that(l.is_compressed, equal_to(False))
     assert_that(l.is_dedup, equal_to(False))
     assert_that(l.initial_tier, equal_to('Optimize Pool'))
     assert_that(l.tiering_policy, none())
     assert_that(l.is_private, equal_to(False))
     assert_that(l.user_capacity_gbs, equal_to(500.0))
     assert_that(l.consumed_capacity_gbs, equal_to(512.249))
     assert_that(len(l.snapshot_mount_points), equal_to(0))
     assert_that(l.primary_lun, none())
Example #54
0
    def test_mirror_view_not_installed(self):
        mv_list = VNXMirrorView.get(t_cli())
        assert_that(len(mv_list), equal_to(0))

        mv = VNXMirrorView.get(t_cli(), 'mv_sync_2')
        assert_that(mv.existed, equal_to(False))
Example #55
0
 def test_get_all(self):
     mv_list = VNXMirrorView.get(t_cli())
     assert_that(len(mv_list), equal_to(4))
Example #56
0
 def f():
     snap = VNXSnap(cli=t_cli(), name='s3')
     snap.remove()
Example #57
0
 def test_modify_snap(self):
     snap = VNXSnap(cli=t_cli(), name='s1')
     snap.modify(new_name='s2', rw=True)
     assert_that(snap._name, equal_to('s2'))