def test_get_all(self): fs_list = VNXFileSystemList(t_nas()) assert_that(len(fs_list), equal_to(25)) root_fs_1 = [fs for fs in fs_list if fs.name == 'root_fs_1'][0] self.verify_root_fs_1(root_fs_1) fs_src0 = [fs for fs in fs_list if fs.name == 'fs_src0'][0] self.verify_fs_src0(fs_src0)
def test_create_filesystem(self): ret = VNXFileSystem.create(t_nas(), 'test14', size_kb=1024 * 5, pool=61, mover=1) assert_that(ret, instance_of(VNXFileSystem))
def test_create_nfs_share(self): dm = VNXMover(mover_id=1, cli=t_nas()) share = dm.create_nfs_share(path='/EEE') assert_that(share.path, equal_to('/EEE')) assert_that(share.mover_id, equal_to(1)) assert_that(share.existed, equal_to(True)) assert_that(share.fs_id, equal_to(243))
def f(): VNXFileSystem.create(t_nas(), 'test18', size_kb=1, pool=0, mover=1, is_vdm=True)
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 test_get_by_mover(self): mover = self.get_mover_1() shares = VNXCifsShare.get(cli=t_nas(), mover=mover) for share in shares: assert_that(share.mover.get_mover_id(), equal_to(mover.get_mover_id())) assert_that(share.mover.is_vdm, equal_to(mover.is_vdm))
def f(): domain = CifsDomain('test.dev') VNXCifsServer.create(t_nas(), 'test', 1, domain=domain, interfaces='10.110.24.194')
def test_create_cifs_server_invalid_domain_name(self): try: domain = CifsDomain('test_domain') VNXCifsServer.create(t_nas(), 'test', 1, domain=domain) self.fail('should raise an exception.') except VNXBackendError as ex: assert_that(ex.message, contains_string('not facet-valid'))
def f(): mover = self.get_mover_1() VNXCifsShare.create(t_nas(), 'test_zhuanc', 'CIFS', mover, path='/test_zhuanc')
def test_create_cifs_server_stand_alone(self): cifs = VNXCifsServer.create(t_nas(), 's2', 1, workgroup='work', interfaces='10.110.24.194', local_admin_password='******') assert_that(cifs.workgroup, equal_to('WORK')) assert_that(cifs.name, equal_to('S2'))
def test_create_cifs_default_mover(self): cifs = VNXCifsServer.create(t_nas(), 's2', workgroup='work', interfaces='10.110.24.194', local_admin_password='******') assert_that(cifs.existed, equal_to(True)) assert_that(cifs.workgroup, equal_to('WORK')) assert_that(cifs.name, equal_to('S2'))
def test_create_cifs_server_w2k(self): domain = CifsDomain('test.dev') cifs = VNXCifsServer.create(t_nas(), 's8', 1, domain=domain, interfaces='10.110.24.194') assert_that(cifs.domain, equal_to('TEST.DEV')) assert_that(cifs.type, equal_to('W2K')) assert_that(cifs.comp_name, equal_to('S8')) assert_that(cifs.domain_joined, equal_to(False))
def test_delete_vdm(self): dm = VNXVdm(vdm_id=3, cli=t_nas()) resp = dm.delete() assert_that(resp.is_ok(), equal_to(True))
def f(): VNXVdm.create(t_nas(), 3, 'myVdm')
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_name(self): dm = VNXVdm.get(name='VDM_ESA', cli=t_nas()) self.verify_vdm_2(dm)
def test_get_by_name_not_found(self): dm = VNXVdm(name='not_found', cli=t_nas()) assert_that(dm.existed, equal_to(False))
def test_get_by_pool_id(self): pool = VNXNasPool.get(pool_id=63, cli=t_nas()) self.verify_pool_vnx_sg_test(pool)
def test_get_by_name(self): cifs = VNXCifsServer.get(t_nas(), 'CIFS') self.verify_pie_cifs(cifs)
def test_get_all(self): pool_list = VNXNasPool.get(cli=t_nas()) assert_that(len(pool_list), equal_to(6))
def f(): dm = VNXVdm(vdm_id=5, cli=t_nas()) dm.delete()
def f(): dm = VNXVdm(name='myvdm', cli=t_nas()) dm.detach_nfs_interface('1.1.1.3-0')
def test_get_by_name_not_found(self): cifs = VNXCifsServer('not_found', t_nas()) assert_that(cifs.existed, equal_to(False)) assert_that(cifs._get_name(), equal_to('not_found'))
def f(): domain = CifsDomain('test.dev') VNXCifsServer.create(t_nas(), 'test', 1, domain=domain)
def test_attach_interface_success(self): dm = VNXVdm(name='myvdm', cli=t_nas()) dm.attach_nfs_interface('1.1.1.1-0')
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_name(self): pool = VNXNasPool.get(name='vnx-sg_test', cli=t_nas()) self.verify_pool_vnx_sg_test(pool)
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_get_by_name_not_found(self): pool = VNXNasPool(name='not_found', cli=t_nas()) assert_that(pool.existed, equal_to(False))
def test_get_by_id_2(self): dm = VNXVdm(vdm_id=2, cli=t_nas()) self.verify_vdm_2(dm)