本文整理汇总了Python中pydevtest_common.assertiCmdFail函数的典型用法代码示例。如果您正苦于以下问题:Python assertiCmdFail函数的具体用法?Python assertiCmdFail怎么用?Python assertiCmdFail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assertiCmdFail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_iadmin_mkuser
def test_iadmin_mkuser(self):
# A few examples of valid and invalid usernames
valid = ['bob',
'jim-bob',
'boB',
'123.456',
'___haysoos___']
invalid = ['bo',
'.bob',
'bob.',
'jim--bob',
'jamesbond..007',
'________________________________longer_than_NAME_LEN________________________________________________']
# Test valid names
for name in valid:
assertiCmd(s.adminsession,"iadmin mkuser "+name+" rodsuser") # should be accepted
assertiCmd(s.adminsession,"iadmin lu","LIST",name+"#"+s.adminsession.getZoneName()) # should be listed
assertiCmd(s.adminsession,"iadmin rmuser "+name) # remove user
assertiCmdFail(s.adminsession,"iadmin lu","LIST",name+"#"+s.adminsession.getZoneName()) # should be gone
# Test invalid names
for name in invalid:
assertiCmd(s.adminsession,"iadmin mkuser "+name+" rodsuser","ERROR","SYS_INVALID_INPUT_PARAM") # should be rejected
# Invalid names with special characters
assertiCmd(s.adminsession,r"iadmin mkuser hawai\'i rodsuser","ERROR","SYS_INVALID_INPUT_PARAM") # should be rejected
assertiCmd(s.adminsession,r"iadmin mkuser \\\/\!\*\?\|\$ rodsuser","ERROR","SYS_INVALID_INPUT_PARAM") # should be rejected
示例2: test_modify_resource_comment
def test_modify_resource_comment(self):
mycomment = "thisisacomment with some spaces"
assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment '" + mycomment + "'")
assertiCmd(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment 'none'")
assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
示例3: 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
示例4: test_set_resource_comment_to_emptystring_ticket_2434
def test_set_resource_comment_to_emptystring_ticket_2434(self):
mycomment = "notemptystring"
assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment '" + mycomment + "'")
assertiCmd(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment ''")
assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
示例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
示例6: 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
示例7: 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
示例8: test_imeta_set_single_object_triple_to_double_empty_unit
def test_imeta_set_single_object_triple_to_double_empty_unit(self, user=None):
if user is None:
user = s.sessions[1].get_username()
set_and_check_avu(user, 'att0', 'val0', 'unt0')
set_and_check_avu(user, 'att0', 'val1', '""')
assertiCmdFail(s.adminsession, 'imeta ls -u ' + user + ' att0', 'STDOUT', 'units: unt0')
示例9: test_create_and_remove_unixfilesystem_resource_without_spaces
def test_create_and_remove_unixfilesystem_resource_without_spaces(self):
testresc1 = "testResc1"
assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should not be listed
output = commands.getstatusoutput("hostname")
hostname = output[1]
assertiCmd(s.adminsession,"iadmin mkresc "+testresc1+" unixfilesystem "+hostname+":/tmp/pydevtest_"+testresc1, "LIST", "Creating") # unix
assertiCmd(s.adminsession,"iadmin lr","LIST",testresc1) # should be listed
assertiCmd(s.adminsession,"iadmin rmresc "+testresc1) # good remove
assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should be gone
示例10: test_mso_http
def test_mso_http(self):
test_file_path = "/"+s.adminsession.getZoneName()+"/home/"+s.adminsession.getUserName()+"/"+s.adminsession.sessionId
assertiCmd( s.adminsession, 'ireg -D mso -R archiveResc "//http://people.renci.org/~jasonc/irods/http_mso_test_file.txt" '+test_file_path+'/test_file.txt')
assertiCmd( s.adminsession, 'iget -f '+test_file_path+'/test_file.txt')
assertiCmdFail( s.adminsession, 'ils -L '+test_file_path+'/test_file.txt', 'STDOUT', ' -99 ')
os.remove( 'test_file.txt' )
# unregister the object
assertiCmd( s.adminsession, 'irm -U '+test_file_path+'/test_file.txt')
assertiCmd( s.adminsession, 'ils -L', 'STDOUT', 'tempZone')
示例11: 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
示例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')
示例13: test_create_and_remove_coordinating_resource
def test_create_and_remove_coordinating_resource(self):
testresc1 = "testResc1"
assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should not be listed
output = commands.getstatusoutput("hostname")
hostname = output[1]
assertiCmd(s.adminsession,"iadmin mkresc "+testresc1+" replication", "LIST", "Creating") # replication
assertiCmd(s.adminsession,"iadmin lr","LIST",testresc1) # should be listed
assertiCmd(s.adminsession,"iadmin lr "+testresc1,"LIST",["resc_net","EMPTY_RESC_HOST"]) # should have empty host
assertiCmd(s.adminsession,"iadmin lr "+testresc1,"LIST",["resc_def_path","EMPTY_RESC_PATH"]) # should have empty path
assertiCmd(s.adminsession,"iadmin rmresc "+testresc1) # good remove
assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should be gone
示例14: test_local_iget_with_overwrite
def test_local_iget_with_overwrite(self):
# local setup
localfile = "local.txt"
# assertions
assertiCmd(s.adminsession,"iget "+self.testfile+" "+localfile) # iget
assertiCmdFail(s.adminsession,"iget "+self.testfile+" "+localfile) # already exists
assertiCmd(s.adminsession,"iget -f "+self.testfile+" "+localfile) # already exists, so force
output = commands.getstatusoutput( 'ls '+localfile )
print " output: ["+output[1]+"]"
assert output[1] == localfile
# local cleanup
output = commands.getstatusoutput( 'rm '+localfile )
示例15: test_local_iput_onto_specific_resource
def test_local_iput_onto_specific_resource(self):
# local setup
datafilename = "anotherfile.txt"
f = open(datafilename,'wb')
f.write("TESTFILE -- ["+datafilename+"]")
f.close()
# assertions
assertiCmdFail(s.adminsession,"ils -L "+datafilename,"LIST",datafilename) # should not be listed
assertiCmd(s.adminsession,"iput -R "+self.testresc+" "+datafilename) # iput
assertiCmd(s.adminsession,"ils -L "+datafilename,"LIST",datafilename) # should be listed
assertiCmd(s.adminsession,"ils -L "+datafilename,"LIST",self.testresc) # should be listed
# local cleanup
output = commands.getstatusoutput( 'rm '+datafilename )