def test_picklable(self): cli = t_rest() lun = UnityLun(_id='sv_16455', cli=cli) lun.update() lun_new = pickle.loads(pickle.dumps(lun)) assert_that(lun_new.name, equal_to(lun.name))
def test_delete_portal(self): portal = UnityIscsiPortal.get(cli=t_rest(), _id='if_4') portal.delete()
def test_get_list(self): rule_list = UnityIoLimitPolicyList.get(cli=t_rest()) assert_that(len(rule_list), equal_to(6))
def test_modify_when_peer_not_exist(self): port = UnityEthernetPort(cli=t_rest(), _id='spa_eth4') port.modify(mtu=1500)
def f(): UnityIscsiPortal.create(cli=t_rest(), ethernet_port='spa_eth2', ip='10.244.213.244', netmask="255.255.255.0", gateway="10.244.213.1")
def test_modify_mtu_to_same_value(self): port = UnityEthernetPort(cli=t_rest(), _id='spb_eth3') port.modify(mtu=1500)
def test_modify_speed_to_same_value(self): port = UnityEthernetPort(cli=t_rest(), _id='spb_eth3') port.modify(speed=EPSpeedValuesEnum.AUTO)
def test_get_all(self): pools = UnityPoolList(cli=t_rest()) assert_that(len(pools), equal_to(2)) pool = next(pool for pool in pools if pool.id == 'pool_1') self.verify_pool_1(pool)
def test_get_nested_resource_filter_by_non_id(self): pools = UnityPoolList(cli=t_rest()) pool = next(pool for pool in pools if pool.id == 'pool_1') tier = next(t for t in pool.tiers if t.name == 'Performance') unit = next(u for u in tier.pool_units if u.description == '123') assert_that(unit.id, equal_to('rg_2'))
def test_get_all_and_property_query(self): sp_list = UnityStorageProcessorList(cli=t_rest()) assert_that(len(sp_list), equal_to(2)) assert_that(sp_list.name, only_contains('SP A', 'SP B'))
def f(): sp_list = UnityStorageProcessorList(cli=t_rest()) return sp_list.not_found
def test_thinclone_of_thick_lun_not_allowed(self): lun = UnityLun(cli=t_rest(version='4.3'), _id='sv_59') assert_that( calling(lun.thin_clone).with_args('not-allowed'), raises(UnityThinCloneNotAllowedError))
def test_thinclone_of_member_snap_not_support(self): lun = UnityLun(cli=t_rest(version='4.3'), _id='sv_58') assert_that( calling(lun.thin_clone).with_args('not-support'), raises(UnityCGMemberActionNotSupportError))
def test_create_snap_of_member_snap_not_support(self): lun = UnityLun(cli=t_rest(), _id='sv_58') assert_that( calling(lun.create_snap).with_args(name='not-support'), raises(UnityCGMemberActionNotSupportError))
def test_properties(self): pool = UnityPool(_id='pool_1', cli=t_rest()) self.verify_pool_1(pool)
def test_delete_pool(self): cli = t_rest() pool = UnityPool.get(cli=cli, _id='pool_4') resp = pool.delete() assert_that(resp.is_ok(), equal_to(True))
def test_modify_mtu(self): port = UnityEthernetPort(cli=t_rest(), _id='spa_eth3') port.modify(mtu=9000)
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))
def test_modify_speed(self): port = UnityEthernetPort(cli=t_rest(), _id='spa_eth3') port.modify(speed=100)
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))
def do(): port = UnityEthernetPort(cli=t_rest(), _id='spb_eth3') port.modify(speed=40000)
def test_create_lun_with_compression_enabled_v4_2(self): pool = UnityPool(_id='pool_1', cli=t_rest(version='4.2')) lun = pool.create_lun("LunName", 100, is_compression=True) assert_that(lun, instance_of(UnityLun))
def test_get_peer(self, port_id, peer_id): port = UnityEthernetPort(cli=t_rest(), _id=port_id) peer = port.get_peer() assert_that(peer.get_id(), equal_to(peer_id))
def test_create_lun_with_dedup_enabled(self): pool = UnityPool(_id='pool_1', cli=t_rest(version='5.0')) lun = pool.create_lun("LunName", 100, is_compression=True, is_advanced_dedup_enabled=True) assert_that(lun, instance_of(UnityLun))
def test_modify_portal(self): portal = UnityIscsiPortal(cli=t_rest(), _id='if_4') portal.modify(ip="10.244.21.11", netmask="255.255.252.0", vlan=111, gateway="10.244.21.1")
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))
def test_get_properties(self): rule = UnityIoLimitRule('qr_1', cli=t_rest()) assert_that(rule.get_id(), equal_to('qr_1')) assert_that(rule.max_iops, equal_to(1000)) assert_that(rule.io_limit_policy.get_id(), equal_to('qp_1')) assert_that(rule.name, equal_to('Limit_1000_IOPS_rule'))
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))
def f(): UnityIoLimitPolicy.create(t_rest(), 'test1', max_kbps=1)
def test_remove_snap_schedule(self): cli = t_rest() lun = UnityLun(_id='sv_16455', cli=cli) resp = lun.remove_snap_schedule() assert_that(resp.is_ok(), equal_to(True))