def test_get_hlu(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun = UnityLun(cli=t_rest(), _id="sv_2") # UnityResourceList will return the found UnityResource # When '_id' as filter. host_lun = UnityHostLunList.get(cli=t_rest(), _id="Host_10_sv_2_prod") assert_that(host_lun, instance_of(UnityHostLun)) hlu = host.get_hlu(lun) assert_that(hlu, equal_to(host_lun.hlu)) # Be caureful, this will return UnityResourceList when 'id' as filter host_lun2 = UnityHostLunList.get(cli=t_rest(), id="Host_10_sv_2_prod") assert_that(host_lun2, instance_of(UnityHostLunList)) assert_that(len(host_lun2), equal_to(1)) assert_that(host_lun, equal_to(host_lun2[0]))
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_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_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_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_get_hlu(self): host = UnityHost(cli=t_rest(), _id='Host_10') lun = UnityLun(cli=t_rest(), _id="sv_2") host_lun = UnityHostLunList.get(_id="Host_10_sv_2_prod", cli=t_rest()) hlu = host.get_hlu(lun) assert_that(hlu, equal_to(host_lun.hlu))