d = self.do_cli("create-alias", "tahoe")
d.addCallback(lambda res: self.do_cli("mkdir", "tahoe:test/" + artonwall_arg))
d.addCallback(lambda res: self.do_cli("cp", "-r", "tahoe:test", "tahoe:test2"))
- d.addCallback(lambda res: self.do_cli("ls", "tahoe:test2"))
+ d.addCallback(lambda res: self.do_cli("ls", "tahoe:test2/test"))
def _check((rc, out, err)):
try:
unicode_to_output(u"\u00C4rtonwall")
self.childuris[k] = to_str(childdata[uri_key])
d.addCallback(_process_directory_json)
# Now build a local directory to copy into place, like the following:
- # source1/
- # source1/mutable1
- # source1/mutable2
- # source1/imm1
- # source1/imm3
+ # test2/
+ # test2/mutable1
+ # test2/mutable2
+ # test2/imm1
+ # test2/imm3
def _build_local_directory(ignored):
- source1_path = os.path.join(self.basedir, "source1")
- fileutil.make_dirs(source1_path)
+ test2_path = os.path.join(self.basedir, "test2")
+ fileutil.make_dirs(test2_path)
for fn in ("mutable1", "mutable2", "imm1", "imm3"):
- fileutil.write(os.path.join(source1_path, fn), fn * 1000)
- self.source1_path = source1_path
+ fileutil.write(os.path.join(test2_path, fn), fn * 1000)
+ self.test2_path = test2_path
d.addCallback(_build_local_directory)
d.addCallback(lambda ignored:
- self.do_cli("cp", "-r", self.source1_path, "tahoe:test2"))
+ self.do_cli("cp", "-r", self.test2_path, "tahoe:"))
# We expect that mutable1 and mutable2 are overwritten in-place,
# so they'll retain their URIs but have different content.
fileutil.write(os.path.join(test_dir_path, f), f * 10000)
d.addCallback(lambda ignored:
- self.do_cli("cp", "-r", test_dir_path, "tahoe:test"))
+ self.do_cli("cp", "-r", test_dir_path, "tahoe:"))
d.addCallback(_check_error_message)
d.addCallback(lambda ignored:
self.do_cli("ls", "--json", "tahoe:test"))
open(os.path.join(sdn2, "rfile5"), "wb").write("rfile5")
# from disk into tahoe
- d.addCallback(run, "cp", "-r", dn, "tahoe:dir1")
+ d.addCallback(run, "cp", "-r", dn, "tahoe:")
d.addCallback(run, "ls")
d.addCallback(_check_ls, ["dir1"])
d.addCallback(run, "ls", "dir1")
def _check_cp_r_out((out,err)):
def _cmp(name):
old = open(os.path.join(dn, name), "rb").read()
- newfn = os.path.join(dn_copy, name)
+ newfn = os.path.join(dn_copy, "dir1", name)
self.failUnless(os.path.exists(newfn))
new = open(newfn, "rb").read()
self.failUnlessEqual(old, new)
d.addCallback(run, "cp", "-r", "--caps-only", "tahoe:dir1", dn_copy2)
def _check_capsonly((out,err)):
# these should all be LITs
- x = open(os.path.join(dn_copy2, "subdir2", "rfile4")).read()
+ x = open(os.path.join(dn_copy2, "dir1", "subdir2", "rfile4")).read()
y = uri.from_string_filenode(x)
self.failUnlessEqual(y.data, "rfile4")
d.addCallback(_check_capsonly)
d.addCallback(run, "cp", "-r", "tahoe:dir1", "tahoe:dir1-copy")
d.addCallback(run, "ls")
d.addCallback(_check_ls, ["dir1", "dir1-copy"])
- d.addCallback(run, "ls", "dir1-copy")
+ d.addCallback(run, "ls", "dir1-copy/dir1")
d.addCallback(_check_ls, ["rfile1", "rfile2", "rfile3", "subdir2"],
["rfile4", "rfile5"])
- d.addCallback(run, "ls", "tahoe:dir1-copy/subdir2")
+ d.addCallback(run, "ls", "tahoe:dir1-copy/dir1/subdir2")
d.addCallback(_check_ls, ["rfile4", "rfile5"],
["rfile1", "rfile2", "rfile3"])
- d.addCallback(run, "get", "dir1-copy/subdir2/rfile4")
+ d.addCallback(run, "get", "dir1-copy/dir1/subdir2/rfile4")
d.addCallback(_check_stdout_against, data="rfile4")
# and copy it a second time, which ought to overwrite the same files