示例#1
0
 def test_create_success(self):
     mover = self.get_mover_1()
     share = VNXNfsShare.create(cli=t_nas(), mover=mover, 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))
示例#2
0
 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)
示例#3
0
 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))
示例#4
0
 def f():
     VNXFileSystem.create(t_nas(),
                          'test18',
                          size_kb=1,
                          pool=0,
                          mover=1,
                          is_vdm=True)
示例#5
0
文件: test_vdm.py 项目: crook/storops
 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))
示例#6
0
 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'))
示例#7
0
 def f():
     domain = CifsDomain('test.dev')
     VNXCifsServer.create(t_nas(),
                          'test',
                          1,
                          domain=domain,
                          interfaces='10.110.24.194')
示例#8
0
 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'))
示例#9
0
 def test_get_by_mover(self):
     mover = self.get_mover_1()
     shares = VNXCifsShareList(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))
示例#10
0
 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'))
示例#11
0
 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))
示例#12
0
 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))
示例#13
0
 def test_create_success(self):
     mover = self.get_mover_1()
     share = VNXNfsShare.create(cli=t_nas(), mover=mover, 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))
示例#14
0
 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))
示例#15
0
 def f():
     mover = self.get_mover_1()
     VNXCifsShare.create(t_nas(),
                         'test_zhuanc',
                         'CIFS',
                         mover,
                         path='/test_zhuanc')
示例#16
0
 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))
示例#17
0
 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'))
示例#18
0
 def f():
     host_config = NfsHostConfig(root_hosts=['1.1.1.1', '2.2.2.2'],
                                 ro_hosts=['3.3.3.3'],
                                 rw_hosts=['4.4.4.4', '5.5.5.5'],
                                 access_hosts=['6.6.6.6'])
     mover = self.get_mover_1()
     share = VNXNfsShare(cli=t_nas(), mover=mover, path='/not_found')
     share.modify(ro=False, host_config=host_config)
示例#19
0
 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))
示例#20
0
 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))
示例#21
0
 def f():
     host_config = NfsHostConfig(
         root_hosts=['1.1.1.1', '2.2.2.2'],
         ro_hosts=['3.3.3.3'],
         rw_hosts=['4.4.4.4', '5.5.5.5'],
         access_hosts=['6.6.6.6'])
     mover = self.get_mover_1()
     share = VNXNfsShare(cli=t_nas(), mover=mover, path='/not_found')
     share.modify(ro=False, host_config=host_config)
示例#22
0
 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'))
示例#23
0
 def test_create_with_host_config(self):
     mover = self.get_mover_1()
     host_config = NfsHostConfig(
         root_hosts=['1.1.1.1', '2.2.2.2'],
         ro_hosts=['3.3.3.3'],
         rw_hosts=['4.4.4.4', '5.5.5.5'],
         access_hosts=['6.6.6.6'])
     share = VNXNfsShare.create(cli=t_nas(), mover=mover, path='/FFF',
                                host_config=host_config)
     assert_that(share.fs_id, equal_to(247))
     assert_that(share.path, equal_to('/FFF'))
     assert_that(share.existed, equal_to(True))
     assert_that(share.access_hosts, has_item('6.6.6.6'))
示例#24
0
 def test_create_with_host_config(self):
     mover = self.get_mover_1()
     host_config = NfsHostConfig(root_hosts=['1.1.1.1', '2.2.2.2'],
                                 ro_hosts=['3.3.3.3'],
                                 rw_hosts=['4.4.4.4', '5.5.5.5'],
                                 access_hosts=['6.6.6.6'])
     share = VNXNfsShare.create(cli=t_nas(),
                                mover=mover,
                                path='/FFF',
                                host_config=host_config)
     assert_that(share.fs_id, equal_to(247))
     assert_that(share.path, equal_to('/FFF'))
     assert_that(share.existed, equal_to(True))
     assert_that(share.access_hosts, has_item('6.6.6.6'))
示例#25
0
 def f():
     VNXFsSnap.create(t_nas(), 'Tan_Manual_CheckPoint', 228, 61)
示例#26
0
文件: test_vdm.py 项目: crook/storops
 def test_get_by_name_not_found(self):
     dm = VNXVdm(name='not_found', cli=t_nas())
     assert_that(dm.existed, equal_to(False))
示例#27
0
文件: test_vdm.py 项目: crook/storops
 def test_get_by_id_2(self):
     dm = VNXVdm(vdm_id=2, cli=t_nas())
     self.verify_vdm_2(dm)
示例#28
0
文件: test_vdm.py 项目: crook/storops
 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)
示例#29
0
文件: test_vdm.py 项目: crook/storops
 def f():
     dm = VNXVdm(name='myvdm', cli=t_nas())
     dm.detach_nfs_interface('1.1.1.3-0')
示例#30
0
 def test_get_cifs_share(self):
     mover = self.get_mover_1()
     share = VNXCifsShare(name='zhuanc_cifs_100g', mover=mover, cli=t_nas())
     self.verify_share_zhuanc(share)
示例#31
0
 def test_create(self):
     snap = VNXFsSnap.create(t_nas(), 'test', 222, 61)
     assert_that(snap.name, equal_to('test'))
     assert_that(snap.fs_id, equal_to(222))
     assert_that(snap.snap_id, equal_to(242))
示例#32
0
 def test_get_by_pool_id(self):
     pool = VNXNasPool.get(pool_id=63, cli=t_nas())
     self.verify_pool_vnx_sg_test(pool)
示例#33
0
 def test_get_all(self):
     pool_list = VNXNasPool.get(cli=t_nas())
     assert_that(len(pool_list), equal_to(6))
示例#34
0
文件: test_vdm.py 项目: crook/storops
 def f():
     dm = VNXVdm(vdm_id=5, cli=t_nas())
     dm.delete()
示例#35
0
文件: test_vdm.py 项目: crook/storops
 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))
示例#36
0
 def f():
     cifs = VNXCifsServer('test1', t_nas())
     cifs.delete(1)
示例#37
0
 def get_mover_1(self):
     mover = VNXMover(mover_id=1, cli=t_nas())
     return mover
示例#38
0
 def test_get_by_share_name(self):
     shares = VNXCifsShareList(cli=t_nas(), share_name='zhuanc_cifs_100g')
     assert_that(len(shares), equal_to(1))
     self.verify_share_zhuanc(shares[0])
示例#39
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'))
示例#40
0
 def test_get_not_found(self):
     mover = self.get_mover_1()
     cifs = VNXCifsShare(name='not_exists', mover=mover, cli=t_nas())
     assert_that(cifs.existed, equal_to(False))
示例#41
0
 def test_get_by_id(self):
     snap = VNXFsSnap(snap_id=230, cli=t_nas())
     self.verify_snap_230(snap)
示例#42
0
 def test_create_success(self):
     fs = VNXFileSystem(name='zzz', cli=t_nas())
     mover = self.get_mover_1()
     share = VNXCifsShare.create(t_nas(), fs, 'CIFS', mover)
     assert_that(share.path, equal_to('\zzz'))
示例#43
0
 def f():
     domain = CifsDomain('test.dev')
     VNXCifsServer.create(t_nas(), 'test', 1, domain=domain)
示例#44
0
 def test_remove_success(self):
     share = VNXCifsShare(name='zzz', mover=self.get_mover_1(), cli=t_nas())
     resp = share.remove()
     assert_that(resp.is_ok(), equal_to(True))
示例#45
0
 def f():
     share = VNXCifsShare(name='yyy',
                          mover=self.get_mover_1(),
                          cli=t_nas())
     share.remove('CIFS')
示例#46
0
文件: test_vdm.py 项目: crook/storops
 def test_get_by_id_invalid(self):
     dm = VNXVdm.get(vdm_id=1, cli=t_nas())
     assert_that(dm.existed, equal_to(False))
示例#47
0
 def test_get_all(self):
     shares = VNXCifsShareList(cli=t_nas())
     assert_that(len(shares), equal_to(16))
     share = next(s for s in shares if s.name == 'zhuanc_cifs_100g')
     self.verify_share_zhuanc(share)
示例#48
0
文件: test_vdm.py 项目: crook/storops
 def test_get_by_name(self):
     dm = VNXVdm.get(name='VDM_ESA', cli=t_nas())
     self.verify_vdm_2(dm)
示例#49
0
 def test_get_by_id_not_found(self):
     snap = VNXFsSnap(snap_id=111, cli=t_nas())
     assert_that(snap.existed, equal_to(False))
示例#50
0
文件: test_vdm.py 项目: crook/storops
 def f():
     VNXVdm.create(t_nas(), 3, 'myVdm')
示例#51
0
 def test_remove(self):
     snap = VNXFsSnap(name='test', cli=t_nas())
     resp = snap.remove()
     assert_that(resp.is_ok(), equal_to(True))
示例#52
0
文件: test_vdm.py 项目: crook/storops
 def test_delete_vdm(self):
     dm = VNXVdm(vdm_id=3, cli=t_nas())
     resp = dm.delete()
     assert_that(resp.is_ok(), equal_to(True))
示例#53
0
 def test_get_all(self):
     cifs_list = VNXCifsServer.get(t_nas())
     assert_that(len(cifs_list), greater_than_or_equal_to(1))
     cifs = next(cifs for cifs in cifs_list if cifs.name == 'CIFS')
     self.verify_pie_cifs(cifs)
示例#54
0
文件: test_vdm.py 项目: crook/storops
 def test_attach_interface_success(self):
     dm = VNXVdm(name='myvdm', cli=t_nas())
     dm.attach_nfs_interface('1.1.1.1-0')
示例#55
0
 def test_get_all_by_mover(self):
     cifs_list = VNXCifsServer.get(t_nas(), mover_id=1)
     cifs = next(cifs for cifs in cifs_list if cifs.name == 'CIFS')
     self.verify_pie_cifs(cifs)
示例#56
0
 def test_get_by_name(self):
     pool = VNXNasPool.get(name='vnx-sg_test', cli=t_nas())
     self.verify_pool_vnx_sg_test(pool)
示例#57
0
 def test_get_all_by_mover_not_found(self):
     cifs_list = VNXCifsServer.get(t_nas(), mover_id=1, is_vdm=True)
     assert_that(len(cifs_list), equal_to(0))
示例#58
0
 def test_get_by_name_not_found(self):
     pool = VNXNasPool(name='not_found', cli=t_nas())
     assert_that(pool.existed, equal_to(False))
示例#59
0
 def test_get_by_name(self):
     cifs = VNXCifsServer.get(t_nas(), 'CIFS')
     self.verify_pie_cifs(cifs)