def test_sp_to_node_enum(self): sp = UnityStorageProcessor(_id='spa', cli=t_rest()) assert_that(sp.to_node_enum(), equal_to(NodeEnum.SPA)) sp = UnityStorageProcessor(_id='spb', cli=t_rest()) assert_that(sp.to_node_enum(), equal_to(NodeEnum.SPB)) sp = UnityStorageProcessor(_id='wrong', cli=t_rest()) assert_that(sp.to_node_enum(), equal_to(NodeEnum.UNKNOWN))
def create(cls, cli, name, sp, pool, is_repl_dst=None, multi_proto=None): sp = UnityStorageProcessor.get(cli, sp) pool_clz = storops.unity.resource.pool.UnityPool pool = pool_clz.get(cli, pool) resp = cli.post(cls().resource_class, name=name, homeSP=sp, pool=pool, isReplicationDestination=is_repl_dst, isMultiProtocolEnabled=multi_proto) resp.raise_if_err() return cls(_id=resp.resource_id, cli=cli)
def test_lun_modify_sp(self): lun = UnityLun(_id='sv_4', cli=t_rest()) sp = UnityStorageProcessor(_id='spb', cli=t_rest()) lun.modify(sp=sp) lun.update() assert_that(sp.to_node_enum(), equal_to(NodeEnum.SPB))
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 test_lun_modify_sp(self): lun = UnityLun(_id='sv_4', cli=t_rest()) sp = UnityStorageProcessor(_id='spb', cli=t_rest()) lun.modify(sp=sp) lun.update() assert_that(sp.to_node_enum(), equal_to(NodeEnum.SPB))