Commit Graph

274 Commits

Author SHA1 Message Date
Zooko O'Whielacronx
4706859967 setup: ignore _darcs in the "test-clean" test and make the "clean" step remove all .egg's in the root dir 2009-12-06 10:48:35 -08:00
Brian Warner
96834da0a2 Simplify immutable download API: use just filenode.read(consumer, offset, size)
* remove Downloader.download_to_data/download_to_filename/download_to_filehandle
* remove download.Data/FileName/FileHandle targets
* remove filenode.download/download_to_data/download_to_filename methods
* leave Downloader.download (the whole Downloader will go away eventually)
* add util.consumer.MemoryConsumer/download_to_data, for convenience
  (this is mostly used by unit tests, but it gets used by enough non-test
   code to warrant putting it in allmydata.util)
* update tests
* removes about 180 lines of code. Yay negative code days!

Overall plan is to rewrite immutable/download.py and leave filenode.read() as
the sole read-side API.
2009-12-01 17:53:30 -05:00
Brian Warner
9901a08fd3 Add dirnodes to backupdb and "tahoe backup", closes #606.
* backups now share dirnodes with any previous backup, in any location,
  so renames and moves are handled very efficiently
* "tahoe backup" no longer bothers reading the previous snapshot
* if you switch grids, you should delete ~/.tahoe/private/backupdb.sqlite,
  to force new uploads of all files and directories
2009-11-26 15:42:57 -08:00
Brian Warner
41bcc9f39e PipelineError: fix str() on python2.4 . Closes #842. 2009-11-24 13:25:12 -08:00
Brian Warner
ea373de042 move dirnode.CachingDict to dictutil.AuxValueDict, generalize method names,
improve tests. Let dirnode _pack_children accept either dict or AuxValueDict.
2009-10-17 11:00:05 -07:00
Zooko O'Whielacronx
00a44c057a docs: a few licensing clarifications requested by Ubuntu 2009-09-26 20:32:26 -07:00
Zooko O'Whielacronx
aaaa633f18 setup: remove a convenience copy of figleaf, to ease inclusion into Ubuntu Karmic Koala
We need to carefully document the licence of figleaf in order to get Tahoe-LAFS into Ubuntu Karmic Koala.  However, figleaf isn't really a part of Tahoe-LAFS per se -- this is just a "convenience copy" of a development tool.  The quickest way to make Tahoe-LAFS acceptable for Karmic then, is to remove figleaf from the Tahoe-LAFS tarball itself.  People who want to run figleaf on Tahoe-LAFS (as everyone should want) can install figleaf themselves.  I haven't tested this -- there may be incompatibilities between upstream figleaf and the copy that we had here...
2009-09-23 22:32:15 -07:00
Zooko O'Whielacronx
9f0da4012e docs: Shawn Willden grants permission for his contributions under GPL2+|TGPPL1+ 2009-09-21 09:46:51 -07:00
Zooko O'Whielacronx
603e08c4a9 doc: licensing cleanups
Use nice utf-8 © instead of "(c)". Remove licensing statements on utility modules that have been assigned to allmydata.com by their original authors. (Nattraverso was not assigned to allmydata.com -- it was LGPL'ed -- but I checked and src/allmydata/util/iputil.py was completely rewritten and doesn't contain any line of code from nattraverso.)  Add notes to misc/debian/copyright about licensing on files that aren't just allmydata.com-licensed.
2009-09-20 10:16:31 -07:00
Zooko O'Whielacronx
2a63fc9159 docs: update relnotes.txt, relnotes-short.txt, and others documentation bits for v1.5.0 release! 2009-08-01 19:57:10 -07:00
Zooko O'Whielacronx
b76ca4549a iputil: added "openbsd3" => "bsd" and "openbsd4" => "bsd" per tdelaet's report; should fix ticket #768 2009-07-20 06:13:14 -07:00
Zooko O'Whielacronx
7607268a58 trivial: remove obsolete comment text 2009-07-20 06:08:43 -07:00
Zooko O'Whielacronx
2f704ed001 dirnode: finish renaming "iv" to "salt" in the code and the hash tag 2009-07-12 17:13:20 -07:00
Zooko O'Whielacronx
786ed012b3 directories: make the IV for the writecaps in directory entries be computed from the secure hash of the writecap itself
This makes encoding of directory entries deterministic, and it is also a tad faster on Macbook Pro than getting a random IV with os.urandom(16).
2009-07-04 19:48:15 -07:00
Zooko O'Whielacronx
fcedca966e tests: raise the timeout on pollmixin from 100s to 1000s -- it looks like it may have triggered too eagerly on Zandr's 266 MHz armel 2009-07-08 21:47:29 -07:00
Zooko O'Whielacronx
efafcfb91a directories: keep track of your position as you decode netstring after netstring from an input buffer instead of copying the trailing part
This makes decoding linear in the number of netstrings instead of O(N^2).
2009-07-04 19:51:09 -07:00
Brian Warner
c6ae255847 remove trailing whitespace 2009-06-29 13:03:58 -07:00
Brian Warner
dddc2d0378 remove trailing whitespace from some util classes 2009-06-29 13:03:41 -07:00
midnightmagic
96cda877ff Basically just a trivial platform detection patch for NetBSD. 2009-06-17 16:36:47 -07:00
Brian Warner
aa23ff9180 rrefutil: add trap_deafref utility, to make the callRemote-plus-ignore-DeadReferenceError-plug-log-other-errors pattern easier 2009-06-22 19:08:26 -07:00
Brian Warner
699510c8f1 PollMixin: snoop trial's error observer to halt the test early if an error is seen. This turns a lot of timeouts into fast failures. 2009-06-22 19:07:31 -07:00
Zooko O'Whielacronx
cc2953e663 util: hooray! A clean implementation of this simple utility! Black Dew pointed out that the inverse of time.gmtime() is hidden in the "calendar" module. 2009-06-13 09:01:12 -07:00
Zooko O'Whielacronx
45928315f6 util: Brian's horrible hack to figure out how much localtime and utctime differ. Now we'll see if it works on Windows. 2009-06-12 13:45:56 -07:00
Zooko O'Whielacronx
4a30c5899c util: oops, time.tzset() doesn't work on Windows -- hopefully the new "London" unit test passes on Windows when we skip tzset() on platforms that don't have it 2009-06-11 17:09:20 -07:00
Zooko O'Whielacronx
8978cb0738 util: fix time_format.iso_utc_time_to_seconds() so that it works even in London 2009-06-11 15:11:29 -07:00
Brian Warner
1863aee0aa switch to using RemoteException instead of 'wrapped' RemoteReferences. Should fix #653, the rref-EQ problem 2009-05-21 17:46:32 -07:00
Brian Warner
c9803d5217 switch all foolscap imports to use foolscap.api or foolscap.logging 2009-05-21 17:38:23 -07:00
Brian Warner
e76c6b606f util/pipeline.py: new utility class to manage size-limited work pipelines, for #392 2009-05-18 16:43:26 -07:00
Zooko O'Whielacronx
9729753692 dirnode: add 'tahoe'/'linkcrtime' and 'tahoe'/'linkmotime' to take the place of what 'mtime'/'ctime' originally did, and make the 'tahoe' subdict be unwritable through the set_children API
Also add extensive documentation in docs/frontends/webapi.txt about the behaviors of these values.  See ticket #628.
2009-04-11 15:52:05 -07:00
Zooko O'Whielacronx
3ac5f427ba trivial: source code metadata 2009-04-03 16:33:15 -07:00
Zooko O'Whielacronx
b12a7f9ee8 leases, time_format: modify time stamping in lease description
* emit lease expiry date in ISO-8601'ish format as well as Brian's format
 * rename iso_utc_time_to_localseconds() to iso_utc_time_to_seconds()
 * add iso_utc_date()
 * simplify the body of iso_utc_time_to_seconds()
2009-04-03 15:59:04 -07:00
Brian Warner
01e2032669 hashutil: add constant-time comparison function, to avoid timing attacks when python's short-circuiting data-dependent == operator is used to, say, check a write-enabler 2009-03-22 20:20:55 -07:00
Brian Warner
66fe8ca24c parse_date: insist that it returns an int 2009-03-19 11:44:43 -07:00
Brian Warner
babcf632da util/time_format: new routine to parse dates like 2009-03-18, switch expirer to use it. I'd prefer to use 18-Mar-2009, but it is surprisingly non-trivial to build a parser that will take UTC dates instead of local dates 2009-03-18 17:58:14 -07:00
Brian Warner
406fdba61f add utility function to parse durations, for lease-expiration config 2009-03-17 00:01:17 -07:00
Brian Warner
8c3013c4f7 rrefutil: add check_remote utility function 2009-02-27 00:59:57 -07:00
Brian Warner
1b3e635936 rrefutil: add trap_remote utility and friends 2009-02-27 00:55:24 -07:00
Brian Warner
89f041ac83 fileutil: add move_into_place(), to perform the standard unix trick of atomically replacing a file, with a fallback for windows 2009-02-18 23:13:10 -07:00
Brian Warner
191fd8556a tests: fix no_network framework to work with upload/download and checker 2009-02-16 17:19:47 -07:00
Brian Warner
e1380b132b util/statistics: add tests, fix mean_repair_cost 2009-02-15 16:23:26 -07:00
Shawn Willden
51ab76875b More lossmodel work, on repair. 2009-01-15 20:56:48 -07:00
Shawn Willden
21832280da Statistics module
Added a statistics module for calculating various facets of
share survival statistics.
2009-01-13 20:12:35 -07:00
Brian Warner
4aee51ff6f figleaf_htmlizer: fix order of summary counters 2009-02-13 09:57:53 -07:00
Brian Warner
aee319e236 figleaf_htmlizer: oops, re-ignore files that aren't under root, like code in auto-built eggs 2009-02-13 00:00:22 -07:00
Brian Warner
30724593fc figleaf_htmlizer: emit stats to stdout, so buildbot can see it 2009-02-12 15:10:20 -07:00
Brian Warner
781c271b82 figleaf_htmlizer: render changes in coverage relative to a previous test run using --old-coverage 2009-02-12 15:04:12 -07:00
Brian Warner
125bf09528 figleaf_htmlizer: more rearranging, behavior should still be unchanged 2009-02-11 20:05:15 -07:00
Brian Warner
e02ecec1ad figleaf_htmlizer: break it up into subfunctions, behavior should still be unchanged 2009-02-11 19:56:07 -07:00
Brian Warner
6bde1b0345 figleaf_htmlizer: rewrite in class form, behavior should be the same as before 2009-02-11 19:40:50 -07:00
Brian Warner
6db747b1f0 figleaf_htmlizer: rewrite with twisted.python.usage, remove logging: should behave the same as before 2009-02-11 19:16:43 -07:00
Brian Warner
f3ed579e74 figleaf_htmlizer: expand tabs, fix to 4-space indents. No functional changes. 2009-02-11 19:05:42 -07:00
Zooko O'Whielacronx
9247dc70e5 trivial: whitespace 2009-01-18 10:54:58 -07:00
Zooko O'Whielacronx
e449052a17 util: dictutil: add DictOfSets.union(key, values) and DictOfSets.update(otherdictofsets) 2009-01-12 10:55:39 -07:00
Zooko O'Whielacronx
c01cfc0035 util: log: allow empty msgs (because downloader is using the "format" alternative with no "msg" argument) 2009-01-07 11:54:11 -07:00
Zooko O'Whielacronx
2122ba78b3 util: deferredutil: undo my recent patch to use our own implementation of gatherResults
It seems to cause lots of failures on some builders.
2009-01-07 11:00:05 -07:00
Zooko O'Whielacronx
79535e4f5b util: deferredutil: implement our own gatherResults instead of using Twisted's
Because we want to maintain backwards compatibility to Twisted 2.4.0.
2009-01-07 10:32:07 -07:00
Zooko O'Whielacronx
78306cf7fa trivial: M-x whitespace-cleanup 2009-01-07 10:25:28 -07:00
Zooko O'Whielacronx
8e92dd1231 trivial: whitespace cleanup 2009-01-06 11:20:58 -07:00
Zooko O'Whielacronx
d4a5f9131b util: base32: require str-not-unicode inputs -- effectively rolls back [3306] and [3307] 2009-01-06 10:41:22 -07:00
Zooko O'Whielacronx
5d5e89d96d util: add gatherResults which is a deferred-list-like thing that doesn't wrap failures in a FirstError 2009-01-04 10:52:02 -07:00
Zooko O'Whielacronx
b8904e023c trivial: remove unused import -- thanks, pyflakes 2008-12-31 15:25:56 -07:00
Zooko O'Whielacronx
c00d20361f rrefutil: generically wrap any errback from callRemote() in a ServerFailure instance
This facilitates client code to easily catch ServerFailures without also catching exceptions arising from client-side code.
See also:
http://foolscap.lothar.com/trac/ticket/105 # make it easy to distinguish server-side failures/exceptions from client-side
2008-12-31 14:28:30 -07:00
Zooko O'Whielacronx
ce5effbedf util/base32: the identity trans table needn't have any contents -- we are using string.translate solely to delete known chars 2008-12-22 17:48:08 -07:00
Zooko O'Whielacronx
3a26a4bd58 util/base32: allow unicode inputs to a2b() or could_be_base32_encoded(), and encode them with utf-8 before processing them 2008-12-22 17:47:13 -07:00
Zooko O'Whielacronx
dde2376c4e util/base32: loosen the precondition forbidding unicode and requiring str -- now it requires either unicode or str
Hopefully this will make it so that tests pass with François Deppierraz's patch to fix the tahoe cli's handling of unicode argument.
2008-12-22 16:22:37 -07:00
Zooko O'Whielacronx
f1fbd4feae dirnode: don't check MAC on entries in dirnodes
In an ancient version of directories, we needed a MAC on each entry.  In modern times, the entire dirnode comes with a digital signature, so the MAC on each entry is redundant.
With this patch, we no longer check those MACs when reading directories, but we still produce them so that older readers will accept directories that we write.
2008-12-21 17:35:18 -07:00
Zooko O'Whielacronx
2b2c2a566b util: logging: refactor some common logging behavior into mixins 2008-12-16 17:38:07 -07:00
Zooko O'Whielacronx
5fb44a3e79 pyutil: assertutil: copy in simplified assertutil from pyutil 2008-12-16 17:37:45 -07:00
Zooko O'Whielacronx
e29e4c04d9 pyutil: assertutil: simplify handling of exception during formatting of precondition message, and reduce dependency to just the Python Standard Library's logging module 2008-12-10 07:10:57 -07:00
Brian Warner
39a41f1d85 util/abbreviate: add abbreviated-size parser 2008-12-01 17:24:12 -07:00
Brian Warner
bf06492a90 #538: fetch version and attach to the rref. Make IntroducerClient demand v1 support. 2008-11-21 20:07:27 -07:00
Brian Warner
7391f63fc1 util/abbreviate: little utility to abbreviate seconds and bytes 2008-11-18 20:11:42 -07:00
Brian Warner
fc7cd23bd1 limiter.py: fix stack blowout by inserting an eventual-send between _done and maybe_start_task. This was causing failures during a 'tahoe manifest' of a large set of directories 2008-11-14 21:11:44 -07:00
Zooko O'Whielacronx
9c35ca76a4 util: copy in pyutil.fileutil.ReopenableNamedTemporaryFile 2008-11-04 17:47:15 -07:00
Zooko O'Whielacronx
cef24792e7 util: copy in nummedobj from pyutil 2008-11-04 13:55:50 -07:00
Zooko O'Whielacronx
fb85a6280f util: copy in dictutil from pyutil 2008-11-04 13:53:27 -07:00
Brian Warner
c205a54965 util/cachedir.py: add a cache-directory manager class, which expires+deletes unused files after a while 2008-10-30 13:01:20 -07:00
Brian Warner
b73c380cdb move testutil into test/common_util.py, since it doesn't count as 'code under test' for our pyflakes numbers 2008-10-28 21:28:31 -07:00
Brian Warner
294e3fb682 util: move PollMixin to a separate file (pollmixin.py), so testutil can be moved into test/ 2008-10-28 21:15:48 -07:00
Brian Warner
2d4e895096 iputil.py: avoid a DNS lookup at startup (which may timeout tests when run on a partially-offline host) by using 198.41.0.4 instead of A.ROOT-SERVERS.NET 2008-10-28 13:36:46 -07:00
Zooko O'Whielacronx
57d9f6beb6 repairer: fix flaw in testutil.flip_one_bit() that Brian pointed out 2008-10-16 12:48:48 -07:00
Zooko O'Whielacronx
8a6d1e5da6 repairer: test all different kinds of corruption that can happen to share files on disk 2008-10-14 16:09:20 -07:00
Brian Warner
b0a00e0f33 util/time_format.py: accept space separator, add unit tests 2008-10-13 15:52:58 -07:00
Brian Warner
93725a6935 util/limiter: add a repr 2008-10-07 13:19:45 -07:00
Brian Warner
1e3500ae5f testutil.PollMixin: set default timeout (to 100s), emit a more helpful error when the timeout is hit 2008-09-29 22:23:09 -07:00
Brian Warner
98c8e25709 netstring: add required_trailer= argument 2008-09-26 09:57:54 -07:00
Brian Warner
e8cf581e3f move netstring() and split_netstring() into a separate util.netstring module 2008-09-25 21:38:24 -07:00
Brian Warner
0a59991ce6 various: use util.log.err instead of twisted.log.err, so we get both Incidents and trial-test-flunking 2008-09-20 10:35:45 -07:00
Brian Warner
8854d0c1b5 util.log: send log.err to Twisted too, so that Trial tests are flunked 2008-09-20 10:34:27 -07:00
Brian Warner
bab799297f testutil.PollMixin: use a custom exception (and convert it) to avoid the ugly 'stash' cycle 2008-09-02 20:32:51 -07:00
Zooko O'Whielacronx
9d14341c7d test: add testutil.flip_one_bit which flips a randomly chosen bit of the input string 2008-07-28 16:42:17 -07:00
Brian Warner
dba0ad3d28 test_mutable.py: add more tests of post-mapupdate corruption, to support #474 testing 2008-06-24 11:08:10 -07:00
Brian Warner
fe44b8fb4b util.dictutil: move DictOfSets out to a separate utility module 2008-05-21 09:43:49 -07:00
Brian Warner
1121df6664 testutil.shouldFail: mention the 'which' string in substring failures too 2008-05-16 16:08:38 -07:00
Brian Warner
d76cf6f748 limiter: fix bug that ignores the limit= argument 2008-05-07 18:35:53 -07:00
Brian Warner
c7e441309d add a basic concurrency limiter utility 2008-05-07 16:53:30 -07:00
ben
c85869fc08 support freebsd 6 2008-04-28 00:41:40 -07:00
Brian Warner
81ab1ec785 testutil: factor stall() out into a common location 2008-04-22 16:47:15 -07:00
Brian Warner
b6b3b6b1bd testutil: minor reformatting 2008-04-17 19:56:45 -07:00
Zooko O'Whielacronx
bdda08df8c copy pyutil.time_format into src/allmydata/util
time_format() provides a good format for logging timestamps
2007-08-14 09:33:49 -07:00