当前位置: 首页>>代码示例>>Python>>正文


Python pydevtest_common.assertiCmd函数代码示例

本文整理汇总了Python中pydevtest_common.assertiCmd函数的典型用法代码示例。如果您正苦于以下问题:Python assertiCmd函数的具体用法?Python assertiCmd怎么用?Python assertiCmd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assertiCmd函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_local_imkdir

 def test_local_imkdir(self):
     # local setup
     mytestdir = "testingimkdir"
     # assertions
     assertiCmdFail(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should not be listed
     assertiCmd(s.adminsession, "imkdir " + mytestdir)  # imkdir
     assertiCmd(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should be listed
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py

示例2: test_icp_r

    def test_icp_r(self):
        base_name_source = "test_icp_r_dir_source"
        user_session = s.sessions[1]
        file_names = set(self.iput_r_large_collection(user_session, base_name_source, file_count=1000, file_size=100)[1])

        base_name_target = "test_icp_r_dir_target"
        assertiCmd(user_session, "icp -r " + base_name_source + " " + base_name_target, "EMPTY")
        assertiCmd(user_session, "ils", "LIST", base_name_target)
        rods_files_source = set(runCmd_ils_to_entries(user_session.runCmd("ils", [base_name_source])))
        self.assertTrue(file_names == rods_files_source,
                        msg="Files missing from rods source:\n" + str(file_names-rods_files_source) + "\n\n" + \
                            "Extra files in rods source:\n" + str(rods_files_source-file_names))

        rods_files_target = set(runCmd_ils_to_entries(user_session.runCmd("ils", [base_name_target])))
        self.assertTrue(file_names == rods_files_target,
                        msg="Files missing from rods target:\n" + str(file_names-rods_files_target) + "\n\n" + \
                            "Extra files in rods target:\n" + str(rods_files_target-file_names))     

        vault_files_post_icp_source = set(os.listdir(os.path.join(get_vault_session_path(user_session),
                                                                  base_name_source)))

        self.assertTrue(file_names == vault_files_post_icp_source,
                        msg="Files missing from vault:\n" + str(file_names-vault_files_post_icp_source) + "\n\n" + \
                            "Extra files in vault:\n" + str(vault_files_post_icp_source-file_names))


        vault_files_post_icp_target = set(os.listdir(os.path.join(get_vault_session_path(user_session),
                                                                  base_name_target)))
        self.assertTrue(file_names == vault_files_post_icp_target,
                        msg="Files missing from vault:\n" + str(file_names-vault_files_post_icp_target) + "\n\n" + \
                            "Extra files in vault:\n" + str(vault_files_post_icp_target-file_names))
开发者ID:SyBernot,项目名称:irods,代码行数:31,代码来源:test_icommands_recursive.py

示例3: test_issue_2420

    def test_issue_2420(self):
        # manipulate the core.re to enable host access control
        corefile = get_irods_config_dir() + "/core.re"
        backupcorefile = corefile + "--" + self._testMethodName
        shutil.copy(corefile, backupcorefile)
        os.system(
            '''sed -e '/^acAclPolicy {msiAclPolicy("STRICT"); }/iacAclPolicy {ON($userNameClient == "quickshare") { } }' /etc/irods/core.re > /tmp/irods/core.re''')
        time.sleep(1)  # remove once file hash fix is commited #2279
        os.system("cp /tmp/irods/core.re /etc/irods/core.re")
        time.sleep(1)  # remove once file hash fix is commited #2279

        # restart the server to reread the new core.re
        os.system(get_irods_top_level_dir() + "/iRODS/irodsctl stop")
        os.system(get_irods_top_level_dir() + "/iRODS/irodsctl start")

        assertiCmd(s.adminsession, "ils", "LIST", "tempZone")

        # look for the error "unable to read session variable $userNameClient."
        p = subprocess.Popen(
            ['grep "unable to read session variable $userNameClient."  ../../iRODS/server/log/rodsLog.*'], shell=True, stdout=subprocess.PIPE)
        result = p.communicate()[0]

        # restore the original core.re
        shutil.copy(backupcorefile, corefile)
        os.remove(backupcorefile)

        # check the results for the error
        assert(-1 == result.find("userNameClient"))
开发者ID:bpow,项目名称:irods,代码行数:28,代码来源:iadmin_suite.py

示例4: test_server_config_environment_variables

    def test_server_config_environment_variables(self):
        # set log level to get all the things
        os.environ['spLogLevel'] = '11'

        # set a random environment value to find in the log
        svr_cfg_file = get_irods_config_dir() + "/server_config.json"
        os.system("cp %s %sOrig" % (svr_cfg_file, svr_cfg_file))

        with open(svr_cfg_file) as f:
            svr_cfg = json.load(f)
        the_value = 'THIS_IS_THE_VALUE'
        svr_cfg['environment_variables']['foo_bar'] = the_value
        mod_json_file(svr_cfg_file, svr_cfg)

        # bounce the server to get the new env variable
        os.system(get_irods_top_level_dir() + "/iRODS/irodsctl stop")
        os.system(get_irods_top_level_dir() + "/iRODS/irodsctl start")

        assertiCmd(s.adminsession, "ils", "LIST", "tempZone")

        # look for the error "unable to read session variable $userNameClient."
        p = subprocess.Popen(
            ['grep "' + the_value + '"  ../../iRODS/server/log/rodsLog.*'], shell=True, stdout=subprocess.PIPE)
        result = p.communicate()[0]

        del os.environ['spLogLevel']
        os.system("mv %sOrig %s" % (svr_cfg_file, svr_cfg_file))

        os.system(get_irods_top_level_dir() + "/iRODS/irodsctl stop")
        os.system(get_irods_top_level_dir() + "/iRODS/irodsctl start")

        # check the results for the error
        assert(-1 != result.find(the_value))
开发者ID:bpow,项目名称:irods,代码行数:33,代码来源:iadmin_suite.py

示例5: test_local_imkdir_with_trailing_slash

 def test_local_imkdir_with_trailing_slash(self):
     # local setup
     mytestdir = "testingimkdirwithslash"
     # assertions
     assertiCmdFail(s.adminsession, "ils -L " + mytestdir + "/", "LIST", mytestdir)  # should not be listed
     assertiCmd(s.adminsession, "imkdir " + mytestdir + "/")  # imkdir
     assertiCmd(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should be listed
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py

示例6: test_local_imkdir_with_trailing_slash_already_exists

 def test_local_imkdir_with_trailing_slash_already_exists(self):
     # local setup
     mytestdir = "testingimkdirwithslash"
     # assertions
     assertiCmd(s.adminsession, "imkdir " + mytestdir + "/")  # imkdir
     assertiCmdFail(s.adminsession, "imkdir " + mytestdir)  # should fail, already exists
     assertiCmdFail(s.adminsession, "imkdir " + mytestdir + "/")  # should fail, already exists
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py

示例7: test_local_imkdir_with_parent

 def test_local_imkdir_with_parent(self):
     # local setup
     mytestdir = "parent/testingimkdirwithparent"
     # assertions
     assertiCmdFail(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should not be listed
     assertiCmd(s.adminsession, "imkdir -p " + mytestdir)  # imkdir with parent
     assertiCmd(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should be listed
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py

示例8: test_iput_overwrite_others_file__ticket_2086

    def test_iput_overwrite_others_file__ticket_2086(self):
        # pre state
        assertiCmd(s.adminsession,"ils -L","LIST",self.testfile) # should be listed

        # local setup
        filename = "overwritefile.txt"
        filepath = create_local_testfile(filename)

        # alice tries to put
        homepath = "/home/"+s.adminsession.getUserName()+"/"+s.adminsession.sessionId+"/"+self.testfile
        logicalpath = "/"+s.adminsession.getZoneName()+homepath
        assertiCmd(s.sessions[1],"iput "+filepath+" "+logicalpath,"ERROR","CAT_NO_ACCESS_PERMISSION") # iput

        # check physicalpaths (of all replicas)
        cmdout = s.adminsession.runCmd('ils',['-L'])
        print "[ils -L]:"
        print "["+cmdout[0]+"]"
        lines = cmdout[0].splitlines()
        for l in cmdout[0].splitlines():
            if "demoResc" in l:
                if "/session-" in l:
                    physicalpath = l.split()[2]
                    # check file is on disk
                    print "[ls -l "+physicalpath+"]:"
                    os.system("ls -l "+physicalpath)
                    assert os.path.exists(physicalpath)

        # local cleanup
        output = commands.getstatusoutput( 'rm '+filepath )
开发者ID:SyBernot,项目名称:irods,代码行数:29,代码来源:resource_suite.py

示例9: test_curl_post

 def test_curl_post(self):
     rule_file = self.rules_dir + "curlPost.r"
     print "-- running "+rule_file
     
     # will have to dynamically pass form_data to the rule once that's fixed
     form_data = "Sent from iRODS"
     c.assertiCmd(s.adminsession,"irule -F "+rule_file, "LIST", form_data)
开发者ID:DICE-UNC,项目名称:irods_microservice_plugins_curl,代码行数:7,代码来源:test_irods_microservice_plugins_curl.py

示例10: test_irm_specific_replica

 def test_irm_specific_replica(self):
     assertiCmd(s.adminsession,"ils -L "+self.testfile,"LIST",self.testfile) # should be listed
     assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+self.testfile) # creates replica
     assertiCmd(s.adminsession,"ils -L "+self.testfile,"LIST",self.testfile) # should be listed twice
     assertiCmd(s.adminsession,"irm -n 0 "+self.testfile) # remove original from grid
     assertiCmd(s.adminsession,"ils -L "+self.testfile,"LIST",["1 "+self.testresc,self.testfile]) # replica 1 should be there
     assertiCmdFail(s.adminsession,"ils -L "+self.testfile,"LIST",["0 "+s.adminsession.getDefResource(),self.testfile]) # replica 0 should be gone
     trashpath = "/"+s.adminsession.getZoneName()+"/trash/home/"+s.adminsession.getUserName()+"/"+s.adminsession.sessionId
     assertiCmdFail(s.adminsession,"ils -L "+trashpath+"/"+self.testfile,"LIST",["0 "+s.adminsession.getDefResource(),self.testfile]) # replica should not be in trash
开发者ID:SyBernot,项目名称:irods,代码行数:9,代码来源:resource_suite.py

示例11: test_local_iput_physicalpath_no_permission

 def test_local_iput_physicalpath_no_permission(self):
     # local setup
     datafilename = "newfile.txt"
     f = open(datafilename,'wb')
     f.write("TESTFILE -- ["+datafilename+"]")
     f.close()
     # assertions
     assertiCmd(s.adminsession,"iput -p /newfileinroot.txt "+datafilename,"ERROR",["UNIX_FILE_CREATE_ERR","Permission denied"]) # should fail to write
     # local cleanup
     output = commands.getstatusoutput( 'rm '+datafilename )
开发者ID:SyBernot,项目名称:irods,代码行数:10,代码来源:resource_suite.py

示例12: test_imeta_set_single_object_abandoned_avu_triple_to_double_empty_unit

    def test_imeta_set_single_object_abandoned_avu_triple_to_double_empty_unit(self):
        user = s.sessions[1].get_username()

        set_and_check_avu(user, 'att0', 'val0', 'unt0')

        assertiCmd(s.adminsession, 'imeta rm -u %s %s %s %s' % (user, 'att0', 'val0', 'unt0'))

        set_and_check_avu(user, 'att0', 'val0', '""')

        assertiCmdFail(s.adminsession, 'imeta ls -u ' + user + ' att0', 'STDOUT', 'units: unt0')
开发者ID:hurngchunlee,项目名称:irods,代码行数:10,代码来源:test_imeta_set.py

示例13: setUp

    def setUp(self):
        ResourceBase.__init__(self)
        s.twousers_up()
        self.run_resource_setup()

        usernames = [ss.get_username() for ss in s.sessions]
        assertiCmd(s.adminsession, 'iadmin lu', 'STDOUT_MULTILINE', usernames)

        for u in usernames:
            assertiCmd(s.adminsession, 'imeta ls -u ' + u, 'STDOUT', 'None')
开发者ID:hurngchunlee,项目名称:irods,代码行数:10,代码来源:test_imeta_set.py

示例14: test_local_iget

 def test_local_iget(self):
     # local setup
     localfile = "local.txt"
     # assertions
     assertiCmd(s.adminsession,"iget "+self.testfile+" "+localfile) # iget
     output = commands.getstatusoutput( 'ls '+localfile )
     print "  output: ["+output[1]+"]"
     assert output[1] == localfile
     # local cleanup
     output = commands.getstatusoutput( 'rm '+localfile )
开发者ID:SyBernot,项目名称:irods,代码行数:10,代码来源:resource_suite.py

示例15: test_iscan_local_file

 def test_iscan_local_file(self):
     assertiCmd( s.sessions[1], 'iscan non_existent_file', 'STDERR', 'ERROR: scanObj: non_existent_file does not exist' )
     existent_file = os.path.join( s.sessions[1]._session_dir, 'existent_file' )
     pydevtest_common.touch( existent_file )
     assertiCmd( s.sessions[1], 'iscan ' + existent_file, 'STDOUT', existent_file + ' is not registered in iRODS' )
     assertiCmd( s.sessions[1], 'iput ' + existent_file );
     output = getiCmdOutput( s.sessions[1], '''iquest "SELECT DATA_PATH WHERE DATA_NAME = 'existent_file'"''' )[0]
     data_path = output.strip().strip('-').strip()[12:]
     assertiCmd( s.sessions[1], 'iscan ' + data_path );
     assertiCmd( s.sessions[1], 'irm -f existent_file' );
开发者ID:hurngchunlee,项目名称:irods,代码行数:10,代码来源:test_iscan.py


注:本文中的pydevtest_common.assertiCmd函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。