def test_get_interfaces(self): dm = VNXVdm(name='VDM_ESA', cli=t_nas()) ifs = dm.get_interfaces() assert_that(len(ifs), equal_to(1)) interface = ifs[0] assert_that(interface.name, equal_to('10-110-24-195')) assert_that(interface.share_type, equal_to(VNXShareType.NFS))
def get_mover(self, name=None, mover_id=None, is_vdm=False): if is_vdm: ret = VNXVdm.get(cli=self._file_cli, name=name, vdm_id=mover_id) else: ret = VNXMover.get(cli=self._file_cli, name=name, mover_id=mover_id) return ret
def mover(self): if self._mover is not None: ret = self._mover elif self.is_vdm: ret = VNXVdm(vdm_id=self.mover_id, cli=self._cli) else: ret = VNXMover(mover_id=self.mover_id, cli=self._cli) return ret
def test_get_by_name(self): dm = VNXVdm.get(name='VDM_ESA', cli=t_nas()) self.verify_vdm_2(dm)
def f(): dm = VNXVdm(name='myvdm', cli=t_nas()) dm.detach_nfs_interface('1.1.1.3-0')
def test_attach_interface_success(self): dm = VNXVdm(name='myvdm', cli=t_nas()) dm.attach_nfs_interface('1.1.1.1-0')
def f(): dm = VNXVdm(vdm_id=5, cli=t_nas()) dm.delete()
def test_create_vdm(self): dm = VNXVdm.create(t_nas(), 2, 'myVdm') assert_that(dm.name, equal_to('myVdm')) assert_that(dm.vdm_id, equal_to(3)) assert_that(dm.mover_id, equal_to(2)) assert_that(dm.root_fs_id, equal_to(245))
def test_get_by_id_2(self): dm = VNXVdm(vdm_id=2, cli=t_nas()) self.verify_vdm_2(dm)
def test_get_all(self): vdm_list = VNXVdm.get(t_nas()) assert_that(len(vdm_list), greater_than_or_equal_to(1)) dm = next(dm for dm in vdm_list if dm.vdm_id == 2) self.verify_vdm_2(dm)
def test_get_by_id_invalid(self): dm = VNXVdm.get(vdm_id=1, cli=t_nas()) assert_that(dm.existed, equal_to(False))
def test_detach_interface(self): dm = VNXVdm(name='myvdm', cli=t_nas()) dm.detach_nfs_interface('1.1.1.1-0')
def f(): dm = VNXVdm(vdm_id=5, cli=t_nas()) dm.remove()
def test_get_by_name_not_found(self): dm = VNXVdm(name='not_found', cli=t_nas()) assert_that(dm.existed, equal_to(False))
def f(): VNXVdm.create(t_nas(), 3, 'myVdm')
def test_delete_vdm(self): dm = VNXVdm(vdm_id=3, cli=t_nas()) resp = dm.delete() assert_that(resp.is_ok(), equal_to(True))