Beispiel #1
0
 def test_create_vmfs_vmware_iscsi_paramters(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     vmfs = pool.create_vmfs(
         vmfs_name="VMFS datastore 2", size_gb=100,
         major_version=ESXFilesystemMajorVersionEnum.VMFS_5,
         block_size=ESXFilesystemBlockSizeEnum._2MB)
     assert_that(vmfs, instance_of(UnityLun))
Beispiel #2
0
 def test_create_filesystem_success(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     fs = pool.create_filesystem(
         'nas_2', 'fs3', 3 * 1024 ** 3,
         proto=FSSupportedProtocolEnum.CIFS,
         tiering_policy=TieringPolicyEnum.AUTOTIER_HIGH)
     assert_that(fs.get_id(), equal_to('fs_12'))
Beispiel #3
0
 def test_create_with_snap_schedule(self):
     cli = t_rest()
     schedule = UnitySnapSchedule(_id='snapSch_1', cli=cli)
     pool = UnityPool('pool_1', cli=cli)
     lun = pool.create_lun('lun-with-snap-schedule', snap_schedule=schedule)
     assert_that(lun.name, equal_to('lun-with-snap-schedule'))
     assert_that(lun.snap_schedule.get_id(), equal_to('snapSch_1'))
Beispiel #4
0
 def f():
     cli = t_rest(version='5.0.0')
     pool = UnityPool('pool_1', cli=cli)
     pool.is_all_flash = False
     pool.create_lun('lun_3',
                     is_compression=True,
                     is_advanced_dedup_enabled=True)
Beispiel #5
0
 def test_create_lun_with_muitl_property(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     lun = pool.create_lun("LunName", 100,
                           description="Hello World", is_thin=True,
                           is_repl_dst=True,
                           tiering_policy=TieringPolicyEnum.AUTOTIER_HIGH)
     assert_that(lun, instance_of(UnityLun))
Beispiel #6
0
 def f():
     pool = UnityPool(_id='pool_1', cli=t_rest())
     nas_server = UnityNasServer.get(cli=t_rest(), _id='nas_1')
     pool.create_nfs_share(
         nas_server,
         name='job_share_failed',
         size=1)
Beispiel #7
0
 def test_create_lun_with_snap_schedule(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     schedule = UnitySnapSchedule(_id='snapSch_1', cli=t_rest())
     lun = pool.create_lun(
         lun_name='lun-with-snap-schedule',
         snap_schedule=schedule)
     assert_that(lun.get_id(), equal_to('sv_16455'))
Beispiel #8
0
    def test_create_lun_with_same_name(self):
        pool = UnityPool(_id='pool_1', cli=t_rest())

        def f():
            pool.create_lun("openstack_lun")

        assert_that(f, raises(UnityLunNameInUseError))
Beispiel #9
0
 def test_create_nfs_share_success(self):
     pool = UnityPool(_id='pool_5', cli=t_rest())
     nas_server = UnityNasServer.get(cli=t_rest(), _id='nas_6')
     job = pool.create_nfs_share(
         nas_server,
         name='513dd8b0-2c22-4da0-888e-494d320303b6',
         size=4294967296)
     assert_that(JobStateEnum.COMPLETED, equal_to(job.state))
Beispiel #10
0
 def test_create_with_dedup_enabled_compression_enabled(self):
     cli = t_rest(version='5.0.0')
     pool = UnityPool('pool_1', cli=cli)
     lun = pool.create_lun('lun_1',
                           is_compression=True,
                           is_advanced_dedup_enabled=True)
     assert_that(lun.name, equal_to('lun_1'))
     assert_that(lun.is_data_reduction_enabled, equal_to(True))
     assert_that(lun.is_advanced_dedup_enabled, equal_to(True))
Beispiel #11
0
 def test_is_advanced_dedup_supported(self, unity_version, unity_model,
                                      pool_id, is_all_flash, expected):
     with mock.patch.object(UnitySystem, 'model', create=True,
                            return_value=unity_model,
                            new_callable=mock.PropertyMock):
         cli = t_rest(unity_version)
         pool = UnityPool(_id=pool_id, cli=cli)
         pool.is_all_flash = is_all_flash
         assert_that(pool.is_advanced_dedup_supported(), equal_to(expected))
Beispiel #12
0
 def test_migrate_deduplicated_lun_success(self):
     with mock.patch.object(UnitySystem,
                            'model',
                            create=True,
                            return_value='Unity 650F',
                            new_callable=mock.PropertyMock):
         lun = UnityLun('sv_5620', cli=t_rest('4.5'))
         dest_pool = UnityPool('pool_5', cli=t_rest('4.5'))
         r = lun.migrate(dest_pool)
         assert_that(r, equal_to(True))
Beispiel #13
0
 def test_create_with_io_limit(self):
     cli = t_rest()
     policy = UnityIoLimitPolicy('qp_4', cli=cli)
     pool = UnityPool('pool_1', cli=cli)
     lun = pool.create_lun('Himalia', io_limit_policy=policy)
     assert_that(lun.name, equal_to('Himalia'))
     assert_that(lun.io_limit_policy.get_id(), equal_to('qp_4'))
     rule = lun.io_limit_rule
     assert_that(rule, instance_of(UnityIoLimitRuleSetting))
     assert_that(rule.max_kbps_density, equal_to(1100))
     assert_that(rule.name, equal_to('Density_1100_KBPS_rule'))
Beispiel #14
0
 def test_migrate_lun_source_thin_dest_thick(self):
     lun = UnityLun('sv_2', cli=t_rest())
     dest_pool = UnityPool('pool_4', cli=t_rest())
     # If dest LUN is thick (is_thin == False), is_compressed and
     # is_advanced_dedup_enabled parameters will be changed to
     # False in lun.migrate()
     r = lun.migrate(dest_pool,
                     is_thin=False,
                     is_compressed=True,
                     is_advanced_dedup_enabled=True)
     assert_that(r, equal_to(True))
Beispiel #15
0
 def test_migrate_lun_source_deduplicated_dest_thin(self):
     lun = UnityLun('sv_5621', cli=t_rest('4.5'))
     dest_pool = UnityPool('pool_5', cli=t_rest('4.5'))
     # If dest LUN is not compressed (is_compressed == False),
     # is_advanced_dedup_enabled parameter will be changed to
     # False in lun.migrate()
     r = lun.migrate(dest_pool,
                     is_thin=True,
                     is_compressed=False,
                     is_advanced_dedup_enabled=True)
     assert_that(r, equal_to(True))
Beispiel #16
0
 def test_tier_properties(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     tier = next(t for t in pool.tiers if t.name == 'Performance')
     assert_that(tier.raid_type, equal_to(RaidTypeEnum.RAID5))
     assert_that(tier.stripe_width, equal_to(RaidStripeWidthEnum._5))
     assert_that(tier.tier_type, equal_to(TierTypeEnum.PERFORMANCE))
     assert_that(tier.size_total, equal_to(1180847570944))
     assert_that(tier.size_used, equal_to(3489660928))
     assert_that(tier.size_free, equal_to(1177357910016))
     assert_that(tier.size_moving_down, equal_to(0))
     assert_that(tier.size_moving_up, equal_to(0))
     assert_that(tier.size_moving_within, equal_to(0))
     assert_that(tier.disk_count, equal_to(5))
Beispiel #17
0
 def test_pool_fast_vp_properties(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     fast = pool.pool_fast_vp
     assert_that(fast.status, equal_to(FastVPStatusEnum.ACTIVE))
     assert_that(fast.relocation_rate,
                 equal_to(FastVPRelocationRateEnum.MEDIUM))
     assert_that(fast.type, equal_to(PoolDataRelocationTypeEnum.SCHEDULED))
     assert_that(fast.is_schedule_enabled, equal_to(True))
     assert_that(str(fast.relocation_duration_estimate),
                 equal_to('0:00:00'))
     assert_that(fast.size_moving_down, equal_to(0))
     assert_that(fast.size_moving_up, equal_to(0))
     assert_that(fast.size_moving_within, equal_to(0))
     assert_that(fast.percent_complete, equal_to(0))
     assert_that(fast.data_relocated, equal_to(0))
     assert_that(str(fast.last_start_time),
                 equal_to('2016-03-13 22:00:00+00:00'))
     assert_that(str(fast.last_end_time),
                 equal_to('2016-03-14 06:00:00+00:00'))
Beispiel #18
0
    def test_create_nfs_share_success_all_params(self):
        pool = UnityPool(_id='pool_5', cli=t_rest())
        nas_server = UnityNasServer.get(cli=t_rest(), _id='nas_6')
        size = 3 * 1024 ** 3

        job = pool.create_nfs_share(
            nas_server,
            name='513dd8b0-2c22-4da0-888e-494d320303b7',
            size=size, is_thin=True,
            tiering_policy=TieringPolicyEnum.AUTOTIER_HIGH,
            default_access=NFSShareDefaultAccessEnum.READ_WRITE,
            min_security=NFSShareSecurityEnum.KERBEROS,
            no_access_hosts_string='Host_1',
            read_only_hosts_string='Host_2',
            read_write_hosts_string='Host_3',
            read_only_root_hosts_string='Host_5,Host_4',
            root_access_hosts_string='Host_6',
            anonymous_uid=10001,
            anonymous_gid=10002,
            export_option=20001)
        assert_that(JobStateEnum.COMPLETED, equal_to(job.state))
Beispiel #19
0
 def test_migrate_lun_source_compressed_dest_not_flash(self):
     lun = UnityLun('sv_18', cli=t_rest())
     dest_pool = UnityPool('pool_4', cli=t_rest())
     r = lun.migrate(dest_pool)
     assert_that(r, equal_to(False))
Beispiel #20
0
 def test_migrate_compressed_lun_success(self):
     lun = UnityLun('sv_18', cli=t_rest())
     dest_pool = UnityPool('pool_5', cli=t_rest())
     r = lun.migrate(dest_pool)
     assert_that(r, equal_to(True))
Beispiel #21
0
 def test_migrate_lun_cancelled(self):
     lun = UnityLun('sv_2', cli=t_rest())
     dest_pool = UnityPool('pool_8', cli=t_rest())
     r = lun.migrate(dest_pool)
     assert_that(r, equal_to(False))
Beispiel #22
0
 def test_create_lun_on_spb(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     sp = UnityStorageProcessor(_id='spb', cli=t_rest())
     lun = pool.create_lun("LunName", 100, sp=sp)
     assert_that(lun, instance_of(UnityLun))
Beispiel #23
0
 def test_create_vmfs(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     vmfs = pool.create_vmfs(vmfs_name="VMFS datastore", size_gb=100)
     assert_that(vmfs, instance_of(UnityLun))
Beispiel #24
0
 def test_create_lun(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     lun = pool.create_lun("LunName", 100)
     assert_that(lun, instance_of(UnityLun))
Beispiel #25
0
 def test_create_lun_with_compression_enabled(self):
     pool = UnityPool(_id='pool_1', cli=t_rest(version='4.3'))
     lun = pool.create_lun("LunName", 100,
                           is_compression=True)
     assert_that(lun, instance_of(UnityLun))
Beispiel #26
0
 def test_migrate_lun_has_thin_clone(self):
     lun = UnityLun('sv_2', cli=t_rest())
     dest_pool = UnityPool('pool_6', cli=t_rest())
     r = lun.migrate(dest_pool)
     assert_that(r, equal_to(False))
Beispiel #27
0
 def test_migrate_lun_pool_does_not_exist(self):
     lun = UnityLun('sv_2', cli=t_rest())
     dest_pool = UnityPool('pool_does_not_exist', cli=t_rest())
     assert_that(
         calling(lun.migrate).with_args(dest_pool),
         raises(UnityMigrationSourceDestNotExistsError))
Beispiel #28
0
 def test_properties(self):
     pool = UnityPool(_id='pool_1', cli=t_rest())
     self.verify_pool_1(pool)
Beispiel #29
0
 def test_migrate_lun_timeout(self):
     lun = UnityLun('sv_2', cli=t_rest())
     dest_pool = UnityPool('pool_5', cli=t_rest())
     assert_that(
         calling(lun.migrate).with_args(dest_pool, timeout=10),
         raises(UnityMigrationTimeoutException))
Beispiel #30
0
 def test_is_compression_supported(self, unity_version, pool_id,
                                   is_all_flash, expected):
     cli = t_rest(unity_version)
     pool = UnityPool(_id=pool_id, cli=cli)
     pool.is_all_flash = is_all_flash
     assert_that(pool.is_compression_supported(), equal_to(expected))