def test_create_cg_with_hosts(self): lun1 = UnityLun(cli=t_rest(), _id='sv_3338') host1 = UnityHost(cli=t_rest(), _id='Host_14') host2 = UnityHost(cli=t_rest(), _id='Host_15') cg = UnityConsistencyGroup.create( t_rest(), 'Muse', lun_add=[lun1], hosts=[host1, host2]) hosts = cg.block_host_access assert_that(len(hosts), equal_to(2)) for mask in hosts.access_mask: assert_that(mask, equal_to(HostLUNAccessEnum.BOTH))
def test_create_cg_with_initial_member(self): lun1 = UnityLun(cli=t_rest(), _id='sv_3339') lun2 = UnityLun(cli=t_rest(), _id='sv_3340') cg = UnityConsistencyGroup.create(t_rest(), 'Muse', lun_add=[lun1, lun2]) assert_that(cg.name, equal_to('Muse')) members = cg.luns assert_that(len(members), equal_to(2)) lun_id_list = map(lambda lun: lun.get_id(), members) assert_that(lun_id_list, has_items('sv_3339', 'sv_3340'))
def create_cg(self, name, description=None, lun_add=None, hosts=None): return UnityConsistencyGroup.create(self._cli, name, description=description, lun_add=lun_add, hosts=hosts)
def f(): UnityConsistencyGroup.create(t_rest(), 'in_use')
def test_create_empty_cg(self): cg = UnityConsistencyGroup.create(t_rest(), 'Goddess') assert_that(cg.name, equal_to('Goddess')) assert_that(cg.type, equal_to(self.cg_type))