def test_lun_modify_sp_with_enum(self): lun = UnityLun(_id='sv_4', cli=t_rest()) resp = lun.modify(sp=NodeEnum.SPB) assert_that(resp.is_ok(), equal_to(True))
def test_lun_modify_wipe_host_access(self): lun = UnityLun(_id='sv_4', cli=t_rest()) resp = lun.modify(host_access=[]) lun.update() assert_that(resp.is_ok(), equal_to(True))
def test_get_lun_sv2_nested_property_update_property(self): lun = UnityLun(_id='sv_2', cli=t_rest()) sr = lun.storage_resource assert_that(sr._cli, equal_to(t_rest())) assert_that(sr.size_total, equal_to(107374182400))
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_lun_attch_to_same_host(self): host = UnityHost(_id="Host_1", cli=t_rest()) lun = UnityLun(_id='sv_4', cli=t_rest()) resp = lun.attach_to(host, access_mask=HostLUNAccessEnum.BOTH) assert_that(resp.is_ok(), equal_to(True))
def test_lun_detach_from_host(self): host = UnityHost(_id="Host_1", cli=t_rest()) lun = UnityLun(_id='sv_4', cli=t_rest()) resp = lun.detach_from(host) assert_that(resp.is_ok(), equal_to(True))
def test_get_attached_cg_snap_hlu(self): host = UnityHost(cli=t_rest(), _id='Host_22') snap = UnitySnap(cli=t_rest(), _id='85899345930') lun = UnityLun(cli=t_rest(), _id='sv_3338') assert_that(host.get_hlu(snap, lun), equal_to(2))
def test_has_alu_true(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun1 = UnityLun(cli=t_rest(), _id="sv_2") has = host.has_alu(lun1) assert_that(has, equal_to(True))
def test_detach_alu(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun = UnityLun(cli=t_rest(), _id="sv_4") resp = host.detach_alu(lun) assert_that(resp.is_ok(), equal_to(True))
def test_attach_alu(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun = UnityLun(cli=t_rest(), _id="sv_4") hlu = host.attach_alu(lun) assert_that(hlu, equal_to(None))
def test_detach_attached_hlu(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun = UnityLun(cli=t_rest(), _id="sv_2") resp = host.detach_alu(lun) assert_that(resp, equal_to(None))
def test_get_hlu_not_found(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun = UnityLun(cli=t_rest(), _id="sv_4") hlu = host.get_hlu(lun) assert_that(hlu, equal_to(None))
def test_has_alu_false(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun2 = UnityLun(cli=t_rest(), _id="sv_4") has = host.has_alu(lun2) assert_that(has, equal_to(False))
def test_lun_delete_has_thinclone(self): lun = UnityLun(_id='sv_5605', cli=t_rest()) resp = lun.delete(force_snap_delete=True, force_vvol_delete=True) lun.update() assert_that(resp.is_ok(), equal_to(True)) assert_that(resp.job.existed, equal_to(False))
def test_get_hlu_of_cg_member(self): host = UnityHost(cli=t_rest(), _id='Host_22') lun = UnityLun(cli=t_rest(), _id='sv_3338') assert_that(host.get_hlu(lun), equal_to(3))
def test_lun_attach_to_new_host(self): host = UnityHost(_id="Host_10", cli=t_rest()) lun = UnityLun(_id='sv_4', cli=t_rest()) resp = lun.attach_to(host) assert_that(resp.is_ok(), equal_to(True))
def test_get_one_host_lun(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun1 = UnityLun(cli=t_rest(), _id="sv_2") which = host._get_host_lun(lun1) assert_that(len(which), equal_to(1)) assert_that(which[0].lun.id, equal_to(lun1.id))