Ticket #761: tests.txt

File tests.txt, 8.6 KB (added by kevan, at 2009-09-06T09:02:02Z)
Line 
1Sun Sep  6 01:39:54 PDT 2009  Kevan Carstensen <kevan@isnotajoke.com>
2  * Add tests for using 'tahoe cp' with dircaps
3
4New patches:
5
6[Add tests for using 'tahoe cp' with dircaps
7Kevan Carstensen <kevan@isnotajoke.com>**20090906083954
8 Ignore-this: 644c64891a48971a1e0ccbb30175628d
9] hunk ./src/allmydata/test/test_cli.py 938
10         d.addCallback(lambda res: self.do_cli("cp", "--recursive",
11                                               dn, "tahoe:"))
12         return d
13+
14+    def test_copy_using_filecap(self):
15+        self.basedir = "cli/Cp/test_copy_using_filecap"
16+        self.set_up_grid()
17+        self.do_cli("create-alias", "tahoe")
18+        fn1 = os.path.join(self.basedir, "Metallica")
19+        fn2 = os.path.join(self.basedir, "Not Metallica")
20+        DATA1 = "puppies" * 10000
21+        open(fn1, "wb").write(DATA1)
22+        d = self.do_cli("put", fn1)
23+        def _put_file((rc, out, err)):
24+            self.failUnlessEqual(rc, 0)
25+            # keep track of the filecap
26+            self.filecap = out
27+        d.addCallback(_put_file)
28+        # Let's try copying this to the disk using the filecap
29+        d.addCallback(lambda res: self.do_cli("cp", self.filecap, fn2))
30+        def _copy_file((rc, out, err)):
31+            self.failUnlessEqual(rc, 0)
32+            results = open(fn2, "r").read()
33+            self.failUnlessEqual(results, DATA1)
34+        # Test with ./ (see #761)
35+        d.addCallback(lambda res: self.do_cli("cp", self.filecap, "./"))
36+        def _resp((rc, out, err)):
37+            self.failUnlessEqual(rc, 1)
38+            self.failUnlessIn("error: you must specify a destination filename",
39+                              err)
40+        d.addCallback(_resp)
41+        # Create a directory, linked at tahoe:test
42+        d.addCallback(lambda res: self.do_cli("mkdir", "tahoe:test"))
43+        def _get_dir((rc, out, err)):
44+            self.failUnlessEqual(rc, 0)
45+            self.dircap = out
46+        d.addCallback(_get_dir)
47+        # Upload a file to the directory
48+        d.addCallback(lambda res:
49+            self.do_cli("put", fn1, "tahoe:test/test_file"))
50+        d.addCallback(lambda (rc, out, err):
51+            self.failUnlessEqual(rc, 0))
52+        d.addCallback(lambda res:
53+            self.do_cli("cp",  self.dircap + "/test_file", "./"))
54+        def _get_resp((rc, out, err)):
55+            self.failUnlessEqual(rc, 0)
56+            results = open("test_file", "r").read()
57+            self.failUnlessEqual(results, DATA1)
58+        d.addCallback(_get_resp)
59+        return d
60 
61 class Backup(GridTestMixin, CLITestMixin, StallMixin, unittest.TestCase):
62 
63
64Context:
65
66[new approach for debian packaging, sharing pieces across distributions. Still experimental, still only works for sid.
67warner@lothar.com**20090818190527
68 Ignore-this: a75eb63db9106b3269badbfcdd7f5ce1
69]
70[new experimental deb-packaging rules. Only works for sid so far.
71Brian Warner <warner@lothar.com>**20090818014052
72 Ignore-this: 3a26ad188668098f8f3cc10a7c0c2f27
73]
74[setup.py: read _version.py and pass to setup(version=), so more commands work
75Brian Warner <warner@lothar.com>**20090818010057
76 Ignore-this: b290eb50216938e19f72db211f82147e
77 like "setup.py --version" and "setup.py --fullname"
78]
79[test/check_speed.py: fix shbang line
80Brian Warner <warner@lothar.com>**20090818005948
81 Ignore-this: 7f3a37caf349c4c4de704d0feb561f8d
82]
83[setup: remove bundled version of darcsver-1.2.1
84zooko@zooko.com**20090816233432
85 Ignore-this: 5357f26d2803db2d39159125dddb963a
86 That version of darcsver emits a scary error message when the darcs executable or the _darcs subdirectory is not found.
87 This error is hidden (unless the --loud option is passed) in darcsver >= 1.3.1.
88 Fixes #788.
89]
90[de-Service-ify Helper, pass in storage_broker and secret_holder directly.
91Brian Warner <warner@lothar.com>**20090815201737
92 Ignore-this: 86b8ac0f90f77a1036cd604dd1304d8b
93 This makes it more obvious that the Helper currently generates leases with
94 the Helper's own secrets, rather than getting values from the client, which
95 is arguably a bug that will likely be resolved with the Accounting project.
96]
97[immutable.Downloader: pass StorageBroker to constructor, stop being a Service
98Brian Warner <warner@lothar.com>**20090815192543
99 Ignore-this: af5ab12dbf75377640a670c689838479
100 child of the client, access with client.downloader instead of
101 client.getServiceNamed("downloader"). The single "Downloader" instance is
102 scheduled for demolition anyways, to be replaced by individual
103 filenode.download calls.
104]
105[tests: double the timeout on test_runner.RunNode.test_introducer since feisty hit a timeout
106zooko@zooko.com**20090815160512
107 Ignore-this: ca7358bce4bdabe8eea75dedc39c0e67
108 I'm not sure if this is an actual timing issue (feisty is running on an overloaded VM if I recall correctly), or it there is a deeper bug.
109]
110[stop making History be a Service, it wasn't necessary
111Brian Warner <warner@lothar.com>**20090815114415
112 Ignore-this: b60449231557f1934a751c7effa93cfe
113]
114[Overhaul IFilesystemNode handling, to simplify tests and use POLA internally.
115Brian Warner <warner@lothar.com>**20090815112846
116 Ignore-this: 1db1b9c149a60a310228aba04c5c8e5f
117 
118 * stop using IURI as an adapter
119 * pass cap strings around instead of URI instances
120 * move filenode/dirnode creation duties from Client to new NodeMaker class
121 * move other Client duties to KeyGenerator, SecretHolder, History classes
122 * stop passing Client reference to dirnode/filenode constructors
123   - pass less-powerful references instead, like StorageBroker or Uploader
124 * always create DirectoryNodes by wrapping a filenode (mutable for now)
125 * remove some specialized mock classes from unit tests
126 
127 Detailed list of changes (done one at a time, then merged together)
128 
129 always pass a string to create_node_from_uri(), not an IURI instance
130 always pass a string to IFilesystemNode constructors, not an IURI instance
131 stop using IURI() as an adapter, switch on cap prefix in create_node_from_uri()
132 client.py: move SecretHolder code out to a separate class
133 test_web.py: hush pyflakes
134 client.py: move NodeMaker functionality out into a separate object
135 LiteralFileNode: stop storing a Client reference
136 immutable Checker: remove Client reference, it only needs a SecretHolder
137 immutable Upload: remove Client reference, leave SecretHolder and StorageBroker
138 immutable Repairer: replace Client reference with StorageBroker and SecretHolder
139 immutable FileNode: remove Client reference
140 mutable.Publish: stop passing Client
141 mutable.ServermapUpdater: get StorageBroker in constructor, not by peeking into Client reference
142 MutableChecker: reference StorageBroker and History directly, not through Client
143 mutable.FileNode: removed unused indirection to checker classes
144 mutable.FileNode: remove Client reference
145 client.py: move RSA key generation into a separate class, so it can be passed to the nodemaker
146 move create_mutable_file() into NodeMaker
147 test_dirnode.py: stop using FakeClient mockups, use NoNetworkGrid instead. This simplifies the code, but takes longer to run (17s instead of 6s). This should come down later when other cleanups make it possible to use simpler (non-RSA) fake mutable files for dirnode tests.
148 test_mutable.py: clean up basedir names
149 client.py: move create_empty_dirnode() into NodeMaker
150 dirnode.py: get rid of DirectoryNode.create
151 remove DirectoryNode.init_from_uri, refactor NodeMaker for customization, simplify test_web's mock Client to match
152 stop passing Client to DirectoryNode, make DirectoryNode.create_with_mutablefile the normal DirectoryNode constructor, start removing client from NodeMaker
153 remove Client from NodeMaker
154 move helper status into History, pass History to web.Status instead of Client
155 test_mutable.py: fix minor typo
156]
157[docs: edits for docs/running.html from Sam Mason
158zooko@zooko.com**20090809201416
159 Ignore-this: 2207e80449943ebd4ed50cea57c43143
160]
161[docs: install.html: instruct Debian users to use this document and not to go find the DownloadDebianPackages page, ignore the warning at the top of it, and try it
162zooko@zooko.com**20090804123840
163 Ignore-this: 49da654f19d377ffc5a1eff0c820e026
164 http://allmydata.org/pipermail/tahoe-dev/2009-August/002507.html
165]
166[docs: relnotes.txt: reflow to 63 chars wide because google groups and some web forms seem to wrap to that
167zooko@zooko.com**20090802135016
168 Ignore-this: 53b1493a0491bc30fb2935fad283caeb
169]
170[docs: about.html: fix English usage noticed by Amber
171zooko@zooko.com**20090802050533
172 Ignore-this: 89965c4650f9bd100a615c401181a956
173]
174[docs: fix mis-spelled word in about.html
175zooko@zooko.com**20090802050320
176 Ignore-this: fdfd0397bc7cef9edfde425dddeb67e5
177]
178[TAG allmydata-tahoe-1.5.0
179zooko@zooko.com**20090802031303
180 Ignore-this: 94e5558e7225c39a86aae666ea00f166
181]
182Patch bundle hash:
1831c32631c50a22f7e12962d1f59d6b511982c03f0