Beispiel #1
0
 def test_has_exceptions(self):
     job = UnityJob(_id='B-3', cli=t_rest())
     assert_that(len(job.exceptions), equal_to(1))
     exception = job.exceptions[0]
     assert_that(exception, instance_of(UnityFileSystemSizeTooSmallError))
     assert_that(str(exception), contains_string('too small'))
     assert_that(job.has_exception(), equal_to(True))
Beispiel #2
0
 def test_create_nfs_share_async(self):
     pool = UnityPool.get(cli=t_rest(), _id='pool_5')
     nas_server = UnityNasServer.get(cli=t_rest(), _id='nas_6')
     job = UnityJob.create_nfs_share(
         cli=t_rest(), pool=pool, nas_server=nas_server,
         name='513dd8b0-2c22-4da0-888e-494d320303b6',
         size=4294967296)
     assert_that(JobStateEnum.COMPLETED, equal_to(job.state))
Beispiel #3
0
 def test_wait_job(self):
     job_id = 'N-3078'
     job = UnityJob(_id=job_id, cli=t_rest())
     new_job = self.jh.wait_job(job, 10, 3)
     assert_that(new_job.id, equal_to(job_id))
     assert_that(new_job.state.index, equal_to(4))
     ret = job_id in self.jh.jobs
     assert_that(ret, equal_to(False))
Beispiel #4
0
    def test_create_nfs_share_async_all_params(self):
        pool = UnityPool.get(cli=t_rest(), _id='pool_5')
        nas_server = UnityNasServer.get(cli=t_rest(), _id='nas_6')
        size = 3 * 1024**3

        job = UnityJob.create_nfs_share(
            cli=t_rest(),
            pool=pool,
            nas_server=nas_server,
            name='513dd8b0-2c22-4da0-888e-494d320303b7',
            size=size,
            is_thin=True,
            tiering_policy=TieringPolicyEnum.AUTOTIER_HIGH,
            default_access=NFSShareDefaultAccessEnum.READ_WRITE,
            min_security=NFSShareSecurityEnum.KERBEROS,
            no_access_hosts_string='Host_1',
            read_only_hosts_string='Host_2',
            read_write_hosts_string='Host_3',
            read_only_root_hosts_string='Host_5,Host_4',
            root_access_hosts_string='Host_6',
            anonymous_uid=10001,
            anonymous_gid=10002,
            export_option=20001)
        assert_that(JobStateEnum.COMPLETED, equal_to(job.state))
Beispiel #5
0
 def test_job():
     return UnityJob(_id='N-345', cli=t_rest())
Beispiel #6
0
 def test_normal_without_error(self):
     job = UnityJob(_id='N-345', cli=t_rest())
     assert_that(job.messages, has_item('Success'))
     assert_that(len(job.exceptions), equal_to(0))
Beispiel #7
0
 def test_batch_without_error(self):
     job = UnityJob(_id='B-693', cli=t_rest())
     assert_that(job.messages, has_item('Success'))
     assert_that(len(job.exceptions), equal_to(0))
     assert_that(job.has_exception(), equal_to(False))
Beispiel #8
0
 def test_messages(self):
     job = UnityJob(_id='B-3', cli=t_rest())
     assert_that(len(job.messages), equal_to(1))
     assert_that(job.messages[0], contains_string('too small'))
Beispiel #9
0
 def f():
     job = UnityJob(_id=job_id, cli=t_rest())
     self.jh.wait_job(job, 10, 3)