コード例 #1
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_modify_read_write_hosts(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_5')
     resp = share.modify(read_write_hosts=['Host_7'])
     assert_that(resp.is_ok(), equal_to(True))
     share.update()
     assert_that(share.read_write_hosts, instance_of(UnityHostList))
     assert_that(share.read_write_hosts[0].get_id(), equal_to('Host_7'))
コード例 #2
0
 def test_host_access_properties(self):
     nfs = UnityNfsShare('NFSShare_5', cli=t_rest())
     assert_that(nfs.read_write_hosts, only_contains(host('Host_7')))
     assert_that(nfs.read_only_hosts, none())
     assert_that(nfs.root_access_hosts, none())
     assert_that(nfs.no_access_hosts, none())
コード例 #3
0
 def test_snap_based_share_properties(self):
     share = UnityNfsShare.get(t_rest(), _id='NFSShare_2')
     assert_that(share.type, equal_to(NFSTypeEnum.NFS_SNAPSHOT))
     assert_that(share.filesystem, instance_of(UnityFileSystem))
     assert_that(share.snap, instance_of(UnitySnap))
コード例 #4
0
 def test_add_read_write_snap_share(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_30')
     resp = share.allow_read_write_access('2.2.2.2', True)
     assert_that(resp.is_ok(), equal_to(True))
コード例 #5
0
 def test_delete_access_host_not_found(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_4')
     resp = share.delete_access(['Host_99'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #6
0
 def test_delete_access_success(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_7')
     resp = share.delete_access(['Host_1', 'Host_14', 'Host_15'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #7
0
 def test_add_ip_access_existed(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_5')
     h1 = UnityHost(_id='Host_1', cli=t_rest())
     resp = share.allow_read_only_access([h1, '1.1.1.1'],
                                         force_create_host=True)
     assert_that(resp.is_ok(), equal_to(True))
コード例 #8
0
 def test_delete_snap_based_share(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_11')
     resp = share.delete()
     assert_that(resp.is_ok(), equal_to(True))
コード例 #9
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_delete_access_success(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_7')
     resp = share.delete_access(['Host_1', 'Host_14', 'Host_15'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #10
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_add_ip_access_existed(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_5')
     h1 = UnityHost(_id='Host_1', cli=t_rest())
     resp = share.allow_read_only_access([h1, '1.1.1.1'],
                                         force_create_host=True)
     assert_that(resp.is_ok(), equal_to(True))
コード例 #11
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_modify_multiple_hosts(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_5')
     host7 = UnityHost(_id='Host_7', cli=t_rest())
     resp = share.modify(read_only_hosts=host7,
                         read_write_hosts=['Host_1', 'Host_2'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #12
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_delete_snap_based_share(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_11')
     resp = share.delete()
     assert_that(resp.is_ok(), equal_to(True))
コード例 #13
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_delete_nfs_share_async(self):
     share = UnityNfsShare(_id='NFSShare_6', cli=t_rest())
     resp = share.delete(async=True)
     job = resp.job
     assert_that(job.existed, equal_to(True))
     assert_that(str(job.est_remain_time), equal_to('0:00:01'))
コード例 #14
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def f():
     share = UnityNfsShare(_id='NFSShare_31', cli=t_rest())
     share.create_snap('share_snap')
コード例 #15
0
 def f():
     UnityNfsShare.create(t_rest(),
                          'ns1',
                          'fs_9',
                          share_access=NFSShareDefaultAccessEnum.ROOT)
コード例 #16
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def f():
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_7')
     share.delete_access(['9.9.9.9'])
コード例 #17
0
 def f():
     share = UnityNfsShare(_id='NFSShare_31', cli=t_rest())
     share.create_snap('share_snap')
コード例 #18
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_delete_access_host_not_found(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_4')
     resp = share.delete_access(['Host_99'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #19
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_delete_nfs_share_success(self):
     share = UnityNfsShare(_id='NFSShare_4', cli=t_rest())
     resp = share.delete()
     assert_that(resp.is_ok(), equal_to(True))
コード例 #20
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_clear_access(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_7')
     resp = share.clear_access()
     assert_that(resp.is_ok(), equal_to(True))
コード例 #21
0
 def test_share_in_tenant_allow_access_to_ip(self):
     share = UnityNfsShare(_id='NFSShare_32', cli=t_rest())
     resp = share.allow_read_only_access('192.168.112.23')
     assert_that(resp.is_ok(), equal_to(True))
コード例 #22
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_add_read_write_snap_share(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_30')
     resp = share.allow_read_write_access('2.2.2.2', True)
     assert_that(resp.is_ok(), equal_to(True))
コード例 #23
0
 def f():
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_7')
     share.delete_access(['9.9.9.9'])
コード例 #24
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_delete_access_snap_share(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_31')
     resp = share.delete_access(['1.1.1.1', '1.1.1.3'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #25
0
 def test_clear_access(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_7')
     resp = share.clear_access()
     assert_that(resp.is_ok(), equal_to(True))
コード例 #26
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_snap_based_share_properties(self):
     share = UnityNfsShare.get(t_rest(), _id='NFSShare_2')
     assert_that(share.type, equal_to(NFSTypeEnum.NFS_SNAPSHOT))
     assert_that(share.filesystem, instance_of(UnityFileSystem))
     assert_that(share.snap, instance_of(UnitySnap))
コード例 #27
0
 def test_delete_access_snap_share(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_31')
     resp = share.delete_access(['1.1.1.1', '1.1.1.3'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #28
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def f():
     UnityNfsShare.create(t_rest(), 'ns1', 'fs_8')
コード例 #29
0
 def test_tenant_properties(self):
     nfs = UnityNfsShare('NFSShare_32', cli=t_rest())
     assert_that(nfs.tenant.id, equal_to('tenant_1'))
コード例 #30
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def test_create_nfs_share_success(self):
     share = UnityNfsShare.create(
         t_rest(), 'ns1', 'fs_9',
         share_access=NFSShareDefaultAccessEnum.READ_WRITE)
     assert_that(share.name, equal_to('ns1'))
     assert_that(share.id, equal_to('NFSShare_4'))
コード例 #31
0
 def f():
     UnityNfsShare.create(t_rest(), 'ns1', 'fs_8')
コード例 #32
0
ファイル: test_nfs_share.py プロジェクト: crook/storops
 def f():
     UnityNfsShare.create(
         t_rest(), 'ns1', 'fs_9',
         share_access=NFSShareDefaultAccessEnum.ROOT)
コード例 #33
0
 def test_delete_nfs_share_success(self):
     share = UnityNfsShare(_id='NFSShare_4', cli=t_rest())
     resp = share.delete()
     assert_that(resp.is_ok(), equal_to(True))
コード例 #34
0
 def test_create_nfs_share_success(self):
     share = UnityNfsShare.create(
         t_rest(), 'ns1', 'fs_9',
         share_access=NFSShareDefaultAccessEnum.READ_WRITE)
     assert_that(share.name, equal_to('ns1'))
     assert_that(share.id, equal_to('NFSShare_4'))
コード例 #35
0
 def test_delete_nfs_share_async(self):
     share = UnityNfsShare(_id='NFSShare_6', cli=t_rest())
     resp = share.delete(async_mode=True)
     job = resp.job
     assert_that(job.existed, equal_to(True))
     assert_that(str(job.est_remain_time), equal_to('0:00:01'))
コード例 #36
0
 def test_modify_snap_nfs_share_no_param(self):
     share = UnityNfsShare(cli=t_rest(), _id='SMBShare_52')
     share.modify()
コード例 #37
0
 def test_modify_multiple_hosts(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_5')
     host7 = UnityHost(_id='Host_7', cli=t_rest())
     resp = share.modify(read_only_hosts=host7,
                         read_write_hosts=['Host_1', 'Host_2'])
     assert_that(resp.is_ok(), equal_to(True))
コード例 #38
0
ファイル: test_host.py プロジェクト: zhangdaolong/storops
 def test_ip_list_of_host_list(self):
     share = UnityNfsShare(cli=t_rest(), _id='NFSShare_31')
     assert_that(share.read_write_hosts.ip_list, only_contains('1.1.1.1'))
     assert_that(share.read_only_hosts.ip_list, equal_to([]))
     assert_that(share.root_access_hosts, none())