def test_thin_clone(self): snap = UnitySnap(_id='38654705847', cli=t_rest(version='4.2.0')) policy = UnityIoLimitPolicy(_id='qp_2', cli=t_rest()) clone = snap.thin_clone(name='test_thin_clone', description='This is description.', io_limit_policy=policy) assert_that(clone.id, equal_to('sv_4678'))
def test_create_iops_policy(self): policy = UnityIoLimitPolicy.create(t_rest(), 'max_iops_4321', max_iops=4321, description='storops') assert_that(policy.name, equal_to('max_iops_4321')) assert_that(policy.is_paused, equal_to(False)) setting = policy.io_limit_rule_settings[0] assert_that(setting.max_iops, equal_to(4321)) assert_that(setting.name, equal_to('max_iops_4321_rule'))
def create_io_limit_policy(self, name, max_iops=None, max_kbps=None, policy_type=None, is_shared=None, description=None, max_iops_density=None, max_kbps_density=None): return UnityIoLimitPolicy.create( self._cli, name, max_iops=max_iops, max_kbps=max_kbps, policy_type=policy_type, is_shared=is_shared, description=description, max_iops_density=max_iops_density, max_kbps_density=max_kbps_density)
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'))
def test_get_properties(self): rule = UnityIoLimitPolicy('qp_2', cli=t_rest()) assert_that(rule.description, contains_string('Absolute bandwidth')) assert_that(rule.existed, equal_to(True)) assert_that(rule.get_id(), equal_to('qp_2')) assert_that(rule.is_shared, equal_to(False)) lun_list = rule.luns assert_that(len(lun_list), equal_to(1)) assert_that(rule.name, equal_to('Limit_2_MBPS')) assert_that(rule.state, equal_to(IOLimitPolicyStateEnum.ACTIVE)) settings = rule.io_limit_rule_settings assert_that(len(settings), equal_to(1)) setting = settings[0] assert_that(setting.burst_frequency, equal_to('01:00:00.000')) assert_that(setting.burst_time, equal_to('00:05:00.000')) assert_that(setting.get_id(), equal_to('qr_2')) assert_that(setting.max_kbps, equal_to(2048)) assert_that(setting.name, equal_to('Limit_2_MBPS_rule'))
def test_remove_from_storage(self): policy = UnityIoLimitPolicy('qp_5', t_rest()) lun1 = UnityLun('sv_2024', t_rest()) lun2 = UnityLun('sv_2025', t_rest()) resp = policy.remove_from_storage(lun1, lun2) assert_that(resp.is_ok(), equal_to(True))
def f(): policy = UnityIoLimitPolicy('qp_8', t_rest()) policy.delete()
def f(): UnityIoLimitPolicy.create(t_rest(), 'test1', max_kbps=1)
def test_modify_policy(self): policy = UnityIoLimitPolicy('qp_4', t_rest()) policy.modify(name="new_name", policy_type=IOLimitPolicyTypeEnum.DENSITY_BASED, max_iops_density=100, max_kbps_density=1024)
def f(): UnityIoLimitPolicy.create(t_rest(), 'float_type_kbps', max_kbps=1.0)