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 )
def test_irepl_over_existing_second_replica__ticket_1705(self): # local setup filename = "secondreplicatest.txt" filepath = create_local_testfile(filename) # assertions assertiCmd(s.adminsession, "ils -L " + filename, "ERROR", "does not exist") # should not be listed assertiCmd(s.adminsession, "iput -R " + self.testresc + " " + filename) # put file assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmd(s.adminsession, "irepl " + filename) # replicate to default resource assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmd(s.adminsession, "irepl " + filename) # replicate overtop default resource assertiCmdFail( s.adminsession, "ils -L " + filename, "LIST", [" 2 ", " & " + filename]) # should not have a replica 2 assertiCmd(s.adminsession, "irepl -R " + self.testresc + " " + filename) # replicate overtop test resource assertiCmdFail( s.adminsession, "ils -L " + filename, "LIST", [" 2 ", " & " + filename]) # should not have a replica 2 # local cleanup os.remove(filepath)
def test_local_iput_with_force_and_destination_resource__ticket_1706(self): # local setup filename = "iputwithforceanddestination.txt" filepath = create_local_testfile(filename) doublefile = "doublefile.txt" os.system("cat %s %s > %s" % (filename, filename, doublefile)) doublesize = str(os.stat(doublefile).st_size) # assertions assertiCmd(s.adminsession, "ils -L " + filename, "ERROR", "does not exist") # should not be listed assertiCmd(s.adminsession, "iput " + filename) # put file assertiCmd(s.adminsession, "irepl -R " + self.testresc + " " + filename) # replicate to test resource assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) assertiCmd(s.adminsession, "iput -f -R %s %s %s" % (self.testresc, doublefile, filename)) # overwrite test repl with different data assertiCmd( s.adminsession, "ils -L " + filename, "LIST", [" 0 ", " " + filename]) # default resource should have dirty copy assertiCmdFail(s.adminsession, "ils -L " + filename, "LIST", [" 0 ", " " + doublesize + " ", " " + filename ]) # default resource should not have doublesize file assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 1 ", " " + doublesize + " ", "& " + filename ]) # targeted resource should have new double clean copy # local cleanup os.remove(filepath) os.remove(doublefile)
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)
def test_ssl_iput_small_and_large_files(self): # set up client and server side for ssl handshake # server side certificate setup os.system("openssl genrsa -out server.key 2> /dev/null") os.system("openssl req -batch -new -key server.key -out server.csr") os.system( "openssl req -batch -new -x509 -key server.key -out server.crt -days 365" ) os.system("mv server.crt chain.pem") os.system("openssl dhparam -2 -out dhparams.pem 100 2> /dev/null" ) # normally 2048, but smaller size here for speed # server side environment variables os.environ['irodsSSLCertificateChainFile'] = get_irods_top_level_dir( ) + "/tests/pydevtest/chain.pem" os.environ['irodsSSLCertificateKeyFile'] = get_irods_top_level_dir( ) + "/tests/pydevtest/server.key" os.environ['irodsSSLDHParamsFile'] = get_irods_top_level_dir( ) + "/tests/pydevtest/dhparams.pem" # client side environment variables os.environ['irodsSSLVerifyServer'] = "none" # add client irodsEnv settings clientEnvFile = s.adminsession.sessionDir + "/.irodsEnv" os.system("cp %s %sOrig" % (clientEnvFile, clientEnvFile)) os.system("echo \"irodsClientServerPolicy 'CS_NEG_REQUIRE'\" >> %s" % clientEnvFile) # server reboot to pick up new irodsEnv settings os.system(get_irods_top_level_dir() + "/iRODS/irodsctl restart") # do the encrypted put filename = "encryptedfile.txt" filepath = create_local_testfile(filename) assertiCmd(s.adminsession, "iinit rods") # reinitialize # small file assertiCmd(s.adminsession, "iput " + filename) # encrypted put - small file assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # should be listed # large file largefilename = "BIGencryptedfile.txt" output = commands.getstatusoutput('dd if=/dev/zero of=' + largefilename + ' bs=1M count=60') assert output[0] == 0, "dd did not successfully exit" #os.system("ls -al "+largefilename) assertiCmd(s.adminsession, "iput " + largefilename) # encrypted put - large file assertiCmd(s.adminsession, "ils -L " + largefilename, "LIST", largefilename) # should be listed # reset client environment to not require SSL os.system("mv %sOrig %s" % (clientEnvFile, clientEnvFile)) # clean up os.system("rm server.key server.csr chain.pem dhparams.pem") os.remove(filename) os.remove(largefilename)
def test_irepl_invalid_input(self): # local setup filename = "somefile.txt" filepath = create_local_testfile(filename) # assertions assertiCmd(s.adminsession,"ils -L "+filename,"STDERR","does not exist") # should not be listed assertiCmd(s.adminsession,"iput "+filename) # put file assertiCmd(s.adminsession,"ils -L "+filename,"STDOUT",filename) # for debugging assertiCmd(s.adminsession,"irepl -R nonresc "+filename,"STDERR","SYS_INVALID_INPUT_PARAM") # replicate to bad resource assertiCmd(s.adminsession,"irm -f "+filename) # cleanup file # local cleanup os.remove(filepath)
def test_ssl_iput_small_and_large_files(self): # set up client and server side for ssl handshake # server side certificate setup os.system("openssl genrsa -out server.key 2> /dev/null") os.system("openssl req -batch -new -key server.key -out server.csr") os.system("openssl req -batch -new -x509 -key server.key -out server.crt -days 365") os.system("mv server.crt chain.pem") os.system("openssl dhparam -2 -out dhparams.pem 100 2> /dev/null") # normally 2048, but smaller size here for speed # server side environment variables os.environ['irodsSSLCertificateChainFile'] = get_irods_top_level_dir() + "/tests/pydevtest/chain.pem" os.environ['irodsSSLCertificateKeyFile'] = get_irods_top_level_dir() + "/tests/pydevtest/server.key" os.environ['irodsSSLDHParamsFile'] = get_irods_top_level_dir() + "/tests/pydevtest/dhparams.pem" # client side environment variables os.environ['irodsSSLVerifyServer'] = "none" # add client irodsEnv settings clientEnvFile = s.adminsession.sessionDir+"/irods_environment.json" os.system("cp %s %sOrig" % (clientEnvFile, clientEnvFile)) env = {} env['irods_client_server_policy'] = 'CS_NEG_REQUIRE' mod_json_file(clientEnvFile, env) # server reboot to pick up new irodsEnv settings os.system(get_irods_top_level_dir() + "/iRODS/irodsctl restart") # do the encrypted put filename = "encryptedfile.txt" filepath = create_local_testfile(filename) assertiCmd(s.adminsession,"iinit rods") # reinitialize # small file assertiCmd(s.adminsession,"iput "+filename) # encrypted put - small file assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # should be listed # large file largefilename = "BIGencryptedfile.txt" output = commands.getstatusoutput( 'dd if=/dev/zero of='+largefilename+' bs=1M count=60' ) assert output[0] == 0, "dd did not successfully exit" #os.system("ls -al "+largefilename) assertiCmd(s.adminsession,"iput "+largefilename) # encrypted put - large file assertiCmd(s.adminsession,"ils -L "+largefilename,"LIST",largefilename) # should be listed # reset client environment to not require SSL os.system("mv %sOrig %s" % (clientEnvFile, clientEnvFile)) # clean up os.system("rm server.key server.csr chain.pem dhparams.pem") os.remove(filename) os.remove(largefilename)
def test_irepl_over_existing_second_replica__ticket_1705(self): # local setup filename = "secondreplicatest.txt" filepath = create_local_testfile(filename) # assertions assertiCmd(s.adminsession,"ils -L "+filename,"ERROR","does not exist") # should not be listed assertiCmd(s.adminsession,"iput -R "+self.testresc+" "+filename) # put file assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmd(s.adminsession,"irepl "+filename) # replicate to default resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmd(s.adminsession,"irepl "+filename) # replicate overtop default resource assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should not have a replica 2 assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename) # replicate overtop test resource assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should not have a replica 2 # local cleanup os.remove(filepath)
def test_irepl_update_replicas(self): # local setup filename = "updatereplicasfile.txt" filepath = create_local_testfile(filename) hostname = get_hostname() doublefile = "doublefile.txt" os.system("cat %s %s > %s" % (filename, filename, doublefile)) doublesize = str(os.stat(doublefile).st_size) # assertions assertiCmd(s.adminsession,"iadmin mkresc thirdresc unixfilesystem %s:/tmp/thirdrescVault" % hostname, "LIST", "Creating") # create third resource assertiCmd(s.adminsession,"iadmin mkresc fourthresc unixfilesystem %s:/tmp/fourthrescVault" % hostname, "LIST", "Creating") # create fourth resource assertiCmd(s.adminsession,"ils -L "+filename,"ERROR","does not exist") # should not be listed assertiCmd(s.adminsession,"iput "+filename) # put file assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename) # replicate to test resource assertiCmd(s.adminsession,"irepl -R thirdresc "+filename) # replicate to third resource assertiCmd(s.adminsession,"irepl -R fourthresc "+filename) # replicate to fourth resource assertiCmd(s.adminsession,"iput -f -R "+self.testresc+" "+doublefile+" "+filename) # repave overtop test resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 0 "," & "+filename]) # should have a dirty copy assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 1 "," & "+filename]) # should have a clean copy assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should have a dirty copy assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 3 "," & "+filename]) # should have a dirty copy assertiCmd(s.adminsession,"irepl -U "+filename) # update last replica assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 0 "," & "+filename]) # should have a dirty copy assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 1 "," & "+filename]) # should have a clean copy assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should have a dirty copy assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 3 "," & "+filename]) # should have a clean copy assertiCmd(s.adminsession,"irepl -aU "+filename) # update all replicas assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 0 "," & "+filename]) # should have a clean copy assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 1 "," & "+filename]) # should have a clean copy assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should have a clean copy assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 3 "," & "+filename]) # should have a clean copy assertiCmd(s.adminsession,"irm -f "+filename) # cleanup file assertiCmd(s.adminsession,"iadmin rmresc thirdresc") # remove third resource assertiCmd(s.adminsession,"iadmin rmresc fourthresc") # remove third resource # local cleanup os.remove(filepath) os.remove(doublefile)
def test_local_iput_with_force_and_destination_resource__ticket_1706(self): # local setup filename = "iputwithforceanddestination.txt" filepath = create_local_testfile(filename) doublefile = "doublefile.txt" os.system("cat %s %s > %s" % (filename, filename, doublefile)) doublesize = str(os.stat(doublefile).st_size) # assertions assertiCmd(s.adminsession,"ils -L "+filename,"ERROR","does not exist") # should not be listed assertiCmd(s.adminsession,"iput "+filename) # put file assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename) # replicate to test resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) assertiCmd(s.adminsession,"iput -f -R %s %s %s" % (self.testresc, doublefile, filename) ) # overwrite test repl with different data assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 0 "," "+filename]) # default resource should have dirty copy assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 0 "," "+doublesize+" "," "+filename]) # default resource should not have doublesize file assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 1 "," "+doublesize+" ","& "+filename]) # targeted resource should have new double clean copy # local cleanup os.remove(filepath) os.remove(doublefile)
def test_irepl_over_existing_bad_replica__ticket_1705(self): # local setup filename = "reploverwritebad.txt" filepath = create_local_testfile(filename) doublefile = "doublefile.txt" os.system("cat %s %s > %s" % (filename, filename, doublefile)) doublesize = str(os.stat(doublefile).st_size) # assertions assertiCmd(s.adminsession, "ils -L " + filename, "ERROR", "does not exist") # should not be listed assertiCmd(s.adminsession, "iput " + filename) # put file assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmd(s.adminsession, "irepl -R " + self.testresc + " " + filename) # replicate to test resource assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmd(s.adminsession, "iput -f %s %s" % (doublefile, filename)) # overwrite default repl with different data assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 0 ", " & " + filename ]) # default resource should have clean copy assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 0 ", " " + doublesize + " ", " & " + filename ]) # default resource should have new double clean copy assertiCmdFail( s.adminsession, "ils -L " + filename, "LIST", [" 1 " + self.testresc, " " + doublesize + " ", " " + filename ]) # test resource should not have doublesize file assertiCmd(s.adminsession, "irepl -R " + self.testresc + " " + filename) # replicate back onto test resource assertiCmd( s.adminsession, "ils -L " + filename, "LIST", [" 1 " + self.testresc, " " + doublesize + " ", " & " + filename ]) # test resource should have new clean doublesize file assertiCmdFail( s.adminsession, "ils -L " + filename, "LIST", [" 2 ", " & " + filename]) # should not have a replica 2 # local cleanup os.remove(filepath) os.remove(doublefile)
def test_irepl_over_existing_third_replica__ticket_1705(self): # local setup filename = "thirdreplicatest.txt" filepath = create_local_testfile(filename) hostname = get_hostname() # assertions assertiCmd( s.adminsession, "iadmin mkresc thirdresc unixfilesystem %s:/tmp/thirdrescVault" % hostname, "LIST", "Creating") # create third resource assertiCmd(s.adminsession, "ils -L " + filename, "ERROR", "does not exist") # should not be listed assertiCmd(s.adminsession, "iput " + filename) # put file assertiCmd(s.adminsession, "irepl -R " + self.testresc + " " + filename) # replicate to test resource assertiCmd(s.adminsession, "irepl -R thirdresc " + filename) # replicate to third resource assertiCmd(s.adminsession, "irepl " + filename) # replicate overtop default resource assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmd(s.adminsession, "irepl -R " + self.testresc + " " + filename) # replicate overtop test resource assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmd(s.adminsession, "irepl -R thirdresc " + filename) # replicate overtop third resource assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmdFail( s.adminsession, "ils -L " + filename, "LIST", [" 3 ", " & " + filename]) # should not have a replica 3 assertiCmdFail( s.adminsession, "ils -L " + filename, "LIST", [" 4 ", " & " + filename]) # should not have a replica 4 assertiCmd(s.adminsession, "irm -f " + filename) # cleanup file assertiCmd(s.adminsession, "iadmin rmresc thirdresc") # remove third resource # local cleanup os.remove(filepath)
def test_irepl_over_existing_bad_replica__ticket_1705(self): # local setup filename = "reploverwritebad.txt" filepath = create_local_testfile(filename) doublefile = "doublefile.txt" os.system("cat %s %s > %s" % (filename, filename, doublefile)) doublesize = str(os.stat(doublefile).st_size) # assertions assertiCmd(s.adminsession,"ils -L "+filename,"ERROR","does not exist") # should not be listed assertiCmd(s.adminsession,"iput "+filename) # put file assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename) # replicate to test resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmd(s.adminsession,"iput -f %s %s" % (doublefile, filename) ) # overwrite default repl with different data assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 0 "," & "+filename]) # default resource should have clean copy assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 0 "," "+doublesize+" "," & "+filename]) # default resource should have new double clean copy assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 1 "+self.testresc," "+doublesize+" "," "+filename]) # test resource should not have doublesize file assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename) # replicate back onto test resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",[" 1 "+self.testresc," "+doublesize+" "," & "+filename]) # test resource should have new clean doublesize file assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should not have a replica 2 # local cleanup os.remove(filepath) os.remove(doublefile)
def test_irepl_over_existing_third_replica__ticket_1705(self): # local setup filename = "thirdreplicatest.txt" filepath = create_local_testfile(filename) hostname = get_hostname() # assertions assertiCmd(s.adminsession,"iadmin mkresc thirdresc unixfilesystem %s:/tmp/thirdrescVault" % hostname, "LIST", "Creating") # create third resource assertiCmd(s.adminsession,"ils -L "+filename,"ERROR","does not exist") # should not be listed assertiCmd(s.adminsession,"iput "+filename) # put file assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename) # replicate to test resource assertiCmd(s.adminsession,"irepl -R thirdresc "+filename) # replicate to third resource assertiCmd(s.adminsession,"irepl "+filename) # replicate overtop default resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename) # replicate overtop test resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmd(s.adminsession,"irepl -R thirdresc "+filename) # replicate overtop third resource assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename) # for debugging assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 3 "," & "+filename]) # should not have a replica 3 assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 4 "," & "+filename]) # should not have a replica 4 assertiCmd(s.adminsession,"irm -f "+filename) # cleanup file assertiCmd(s.adminsession,"iadmin rmresc thirdresc") # remove third resource # local cleanup os.remove(filepath)
def test_irepl_update_replicas(self): # local setup filename = "updatereplicasfile.txt" filepath = create_local_testfile(filename) hostname = get_hostname() doublefile = "doublefile.txt" os.system("cat %s %s > %s" % (filename, filename, doublefile)) doublesize = str(os.stat(doublefile).st_size) # assertions assertiCmd( s.adminsession, "iadmin mkresc thirdresc unixfilesystem %s:/tmp/thirdrescVault" % hostname, "LIST", "Creating") # create third resource assertiCmd( s.adminsession, "iadmin mkresc fourthresc unixfilesystem %s:/tmp/fourthrescVault" % hostname, "LIST", "Creating") # create fourth resource assertiCmd(s.adminsession, "ils -L " + filename, "ERROR", "does not exist") # should not be listed assertiCmd(s.adminsession, "iput " + filename) # put file assertiCmd(s.adminsession, "irepl -R " + self.testresc + " " + filename) # replicate to test resource assertiCmd(s.adminsession, "irepl -R thirdresc " + filename) # replicate to third resource assertiCmd(s.adminsession, "irepl -R fourthresc " + filename) # replicate to fourth resource assertiCmd(s.adminsession, "iput -f -R " + self.testresc + " " + doublefile + " " + filename) # repave overtop test resource assertiCmd(s.adminsession, "ils -L " + filename, "LIST", filename) # for debugging assertiCmdFail(s.adminsession, "ils -L " + filename, "LIST", [" 0 ", " & " + filename]) # should have a dirty copy assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 1 ", " & " + filename]) # should have a clean copy assertiCmdFail(s.adminsession, "ils -L " + filename, "LIST", [" 2 ", " & " + filename]) # should have a dirty copy assertiCmdFail(s.adminsession, "ils -L " + filename, "LIST", [" 3 ", " & " + filename]) # should have a dirty copy assertiCmd(s.adminsession, "irepl -U " + filename) # update last replica assertiCmdFail(s.adminsession, "ils -L " + filename, "LIST", [" 0 ", " & " + filename]) # should have a dirty copy assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 1 ", " & " + filename]) # should have a clean copy assertiCmdFail(s.adminsession, "ils -L " + filename, "LIST", [" 2 ", " & " + filename]) # should have a dirty copy assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 3 ", " & " + filename]) # should have a clean copy assertiCmd(s.adminsession, "irepl -aU " + filename) # update all replicas assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 0 ", " & " + filename]) # should have a clean copy assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 1 ", " & " + filename]) # should have a clean copy assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 2 ", " & " + filename]) # should have a clean copy assertiCmd(s.adminsession, "ils -L " + filename, "LIST", [" 3 ", " & " + filename]) # should have a clean copy assertiCmd(s.adminsession, "irm -f " + filename) # cleanup file assertiCmd(s.adminsession, "iadmin rmresc thirdresc") # remove third resource assertiCmd(s.adminsession, "iadmin rmresc fourthresc") # remove third resource # local cleanup os.remove(filepath) os.remove(doublefile)