Commit Graph

2992 Commits

Author SHA1 Message Date
robk-tahoe
0a2f32649f fuse/tests: slew of changes to fuse 'runtests'
This patch makes a significant number of changes to the fuse 'runtests' script
which stem from my efforts to integrate the third fuse implementation into this
framework.  Perhaps not all were necessary to that end, and I beg nejucomo's
forebearance if I got too carried away.

- cleaned up the blank lines; imho blank lines should be empty

- made the unmount command switch based on platform, since macfuse just uses
'umount' not the 'fusermount' command (which doesn't exist)

- made the expected working dir for runtests the contrib/fuse dir, not the 
top-level tahoe source tree - see also discussion of --path-to-tahoe below

- significantly reworked the ImplProcManager class.  rather than subclassing
for each fuse implementation to be tested, the new version is based on 
instantiating objects and providing relevant config info to the constructor.
this was motivated by a desire to eliminate the duplication of similar but
subtly different code between instances, framed by consideration of increasing
the number of platforms and implementations involved. each implementation to
test is thus reduced to the pertinent import and an entry in the 
'implementations' table defining how to handle that implementation. this also
provides a way to specify which sets of tests to run for each implementation,
more on that below.


- significantly reworked the command line options parsing, using twisted.usage;

what used to be a single optional argument is now represented by the 
--test-type option which allows one to choose between running unittests, the
system tests, or both.

the --implementations option allows for a specific (comma-separated) list of
implemenations to be tested, or the default 'all'

the --tests option allows for a specific (comma-separated) list of tests sets
to be run, or the default 'all'.  note that only the intersection of tests
requested on the command line and tests relevant to each implementation will
be run. see below for more on tests sets.

the --path-to-tahoe open allows for the path to the 'tahoe' executable to be
specified. it defaults to '../../bin/tahoe' which is the location of the tahoe
script in the source tree relative to the contrib/fuse dir by default.

the --tmp-dir option controls where temporary directories (and hence 
mountpoints) are created during the test.  this defaults to /tmp - a change
from the previous behaviour of using the system default dir for calls to 
tempfile.mkdtemp(), a behaviour which can be obtained by providing an empty
value, e.g. "--tmp-dir=" 

the --debug-wait flag causes the test runner to pause waiting upon user
input at various stages through the testing, which facilitates debugging e.g.
by allowing the user to open a browser and explore or modify the contents of
the ephemeral grid after it has been instantiated but before tests are run,
or make environmental adjustments before actually triggering fuse mounts etc.
note that the webapi url for the first client node is printed out upon its
startup to facilitate this sort of debugging also.


- the default tmp dir was changed, and made configurable. previously the 
default behaviour of tempfile.mkdtemp() was used.  it turns out that, at least
on the mac, that led to temporary directories to be created in a location
which ultimately led to mountpoint paths longer than could be handled by 
macfuse - specifically mounted filesystems could not be unmounted and would
'leak'. by changing the default location to be rooted at /tmp this leads to
mountpoint paths short enough to be supported without problems.

- tests are now grouped into 'sets' by method name prefix.  all the existing
tests have been moved into the 'read' set, i.e. with method names starting
'test_read_'. this is intended to facilitate the fact that some implementations
are read-only, and some support write, so the applicability of tests will vary
by implementation. the 'implementations' table, which governs the configuration
of the ImplProcManager responsible for a given implementation, provides a list
of 'test' (i.e test set names) which are applicable to that implementation.
note no 'write' tests yet exist, this is merely laying the groundwork.

- the 'expected output' of the tahoe command, which is checked for 'surprising'
output by regex match, can be confused by spurious output from libraries.
specfically, testing on the mac produced a warning message about zope interface
resolution various multiple eggs.  the 'check_tahoe_output()' function now has
a list of 'ignorable_lines' (each a regex) which will be discarded before the
remainder of the output of the tahoe script is matched against expectation.

- cleaned up a typo, and a few spurious imports caught by pyflakes
2008-09-24 11:36:01 -07:00
robk-tahoe
4f04bf99a5 fuse/impl_{a,b}: improve node-url handling
specifically change the expectation of the code to be such that the node-url
(self.url) always includes the trailing slash to be a correctly formed url

moreover read the node-url from the 'node.url' file found in the node 'basedir'
and only if that doesn't exist, then fall back to reading the 'webport' file
from therein and assuming localhost.  This then supports the general tahoe 
pattern that tools needing only a webapi server can be pointed at a directory
containing the node.url file, which can optionally point to another server,
rather than requiring a complete node dir and locally running node instance.
2008-09-24 11:28:54 -07:00
robk-tahoe
97229238b0 fuse/impl_b: tweaks from testing on hardy
from testing on linux (specifically ubuntu hardy) the libfuse dll has a
different name, specifically libfuse.so.2. this patch tries libfuse.so
and then falls back to trying .2 if the former fails.

it also changes the unmount behaviour, to simply return from the handler's
loop_forever() loop upon being unmounted, rather than raising an EOFError,
since none of the client code I looked at actually handled that exception,
but did seem to expect to fall off of main() when loop_forever() returned.
Additionally, from my testing unmount typically led to an OSError from the
fuse fd read, rather than an empty read, as the code seemed to expect.

also removed a spurious import pyflakes quibbled about.
2008-09-24 11:07:38 -07:00
robk-tahoe
5882ce99f4 setup: fix site-dirs to find system installed twisted on mac.
zooko helped me unravel a build weirdness today.  somehow the system installed
twisted (/System/Library) was pulling in parts of the other twisted (/Library)
which had been installed by easy_install, and exploding. 

getting rid of the latter helped, but it took this change to get the tahoe
build to stop trying to rebuild twisted and instead use the one that was 
already installed. c.f. tkt #229
2008-09-24 10:42:55 -07:00
robk-tahoe
ed9873c2a9 CLI: rework webopen, and moreover its tests w.r.t. path handling
in the recent reconciliation of webopen patches, I wound up adjusting
webopen to 'pass through' the state of the trailing slash on the given
argument to the resultant url passed to the browser.  this change 
removes the requirement that arguments must be directories, and allows
webopen to be used with files.  it also broke the tests that assumed
that webopen would always normalise the url to have a trailing slash.

in fixing the tests, I realised that, IMHO, there's something deeply
awry with the way tahoe handles paths; specifically in the combination
of '/' being the name of the root path within an alias, but a leading
slash on paths, e.g. 'alias:/path', is catagorically incorrect. i.e.
 'tahoe:' == 'tahoe:/' == '/' 
but 'tahoe:/foo' is an invalid path, and must be 'tahoe:foo'

I wound up making the internals of webopen simply spot a 'path' of
'/' and smash it to '', which 'fixes' webopen to match the behaviour
of tahoe's path handling elsewhere, but that special case sort of
points to the weirdness.

(fwiw, I personally found the fact that the leading / in a path was
disallowed to be weird - I'm just used to seeing paths qualified by
the leading / I guess - so in a debate about normalising path handling
I'd vote to include the /)
2008-09-24 09:45:23 -07:00
robk-tahoe
2c9a854f10 CLI: reconcile webopen changes
I think this is largely attributable to a cleanup patch I'd made
which never got committed upstream somehow, but at any rate various
conflicting changes to webopen had been made. This cleans up the
conflicts therein, and hopefully brings 'tahoe webopen' in line with
other cli commands.
2008-09-24 08:20:02 -07:00
robk-tahoe
8f28d64d77 cli: cleanup webopen command
moved the body of webopen out of cli.py into tahoe_webopen.py

made its invocation consistent with the other cli commands, most
notably replacing its 'vdrive path' with the same alias parsing,
allowing usage such as 'tahoe webopen private:Pictures/xti'
2008-06-18 13:19:40 -07:00
robk-tahoe
0042881736 macapp: changed to remove 'Tahoe' from .app name
Change the build product from 'Allmydata Tahoe' to 'Allmydata'
more inkeeping with the branding of the Allmydata product
2008-06-10 17:31:45 -07:00
Brian Warner
53f53b7c82 add --syslog argument to 'tahoe start' and 'tahoe restart', used to pass --syslog to twistd for non-Tahoe nodes (like cpu-watcher) 2008-09-24 18:03:02 -07:00
Brian Warner
1f9af40fd4 misc/make-canary-files.py: tool to create 'canary files', explained in the docstring 2008-09-24 17:47:16 -07:00
Brian Warner
54fce5c066 webapi: survive slashes in filenames better: make t=info and t=delete to work, and let t=rename fix the problem 2008-09-24 13:35:05 -07:00
Zooko O'Whielacronx
7339e09c72 setup: when detecting platform, ask the Python Standard Library's platform.dist() before executing lsb_release, and cache the result in global (module) variables
This should make it sufficiently fast, while still giving a better answer on Ubuntu than platform.dist() currently does, and also falling back to lsb_release if platform.dist() says that it doesn't know.
2008-09-24 11:09:22 -07:00
Brian Warner
dd9171eb72 node.py: add BASEDIR/keepalive_timeout and BASEDIR/disconnect_timeout, to set/enable the foolscap timers, for #521 2008-09-24 10:51:12 -07:00
Zooko O'Whielacronx
69bc4624c3 setup: stop catching EnvironmentError when attempting to copy ./_auto_deps.py to ./src/allmydata/_auto_deps.py
It is no longer the case that we can run okay without _auto_deps.py being in place in ./src/allmydata, so if that cp fails then the build should fail.
2008-09-23 17:04:02 -07:00
Zooko O'Whielacronx
ff08bab0c4 immutable: remove unused imports (thanks, pyflakes) 2008-09-23 12:26:10 -07:00
Zooko O'Whielacronx
fa302544fa immutable: refactor immutable filenodes and comparison thereof
* the two kinds of immutable filenode now have a common base class
* they store only an instance of their URI, not both an instance and a string
* they delegate comparison to that instance
2008-09-23 11:52:49 -07:00
Zooko O'Whielacronx
2ef977d85a setup: try parsing /etc/lsb-release first, then invoking lsb_release, because the latter takes half-a-second on my workstation, which is too long
Also because in some cases the former will work and the latter won't.
This patch also tightens the regexes so it won't match random junk.
2008-09-23 10:14:31 -07:00
Zooko O'Whielacronx
37dd91238b setup: fix a cut-and-paste error in the fallback to parsing /etc/lsb-release 2008-09-23 09:55:51 -07:00
Zooko O'Whielacronx
8a35d2ed83 setup: if executing lsb_release doesn't work, fall back to parsing /etc/lsb-release before falling back to platform.dist()
An explanatio of why we do it this way is in the docstring.
2008-09-23 09:28:58 -07:00
Zooko O'Whielacronx
e2b1ce13f5 setup: if invoking lsb_release doesn't work (which it doesn't on our etch buildslave), then fall back to the Python Standard Library's platform.dist() function 2008-09-23 08:48:20 -07:00
Zooko O'Whielacronx
8874e27da0 setup: fix bug in recent patch to use allmydata.get_package_versions() to tell the foolscap app-version-tracking what's what 2008-09-22 17:13:47 -07:00
Zooko O'Whielacronx
992339b97e setup: when using the foolscap "what versions are here?" feature, use allmydata.get_package_versions() instead of specifically importing allmydata, pycryptopp, and zfec 2008-09-22 17:03:51 -07:00
Zooko O'Whielacronx
5075c12725 setup: simplify the implementation of allmydata.get_package_versions() and add "platform" which is a human-oriented summary of the underlying operating system and machine 2008-09-22 16:53:54 -07:00
Brian Warner
d4b522bedf misc/make_umid: change docs, make elisp code easier to grab 2008-09-20 11:39:33 -07:00
Brian Warner
c6999d219e use foolscap's new app_versions API, require foolscap-0.3.1 2008-09-20 11:38:53 -07:00
Brian Warner
063f85d157 BASEDIR/nickname is now UTF-8 encoded 2008-09-20 11:37:13 -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
1023a68741 logging.txt: explain how to put log.err at the end of Deferred chains, explain FLOGTOTWISTED=1 2008-09-20 10:35:00 -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
a997d65d74 setup.py trial: improve --verbose suggestion a bit 2008-09-19 12:39:22 -07:00
Brian Warner
0799e09910 test_cli: disable generate-keypair test on OS-X, pycryptopp still has a bug 2008-09-19 12:38:55 -07:00
Brian Warner
1c89208884 NEWS: finish editing for the upcoming 1.3.0 release 2008-09-19 12:30:53 -07:00
Brian Warner
3dd131b5dc NEWS: more edits, almost done 2008-09-18 18:00:36 -07:00
Brian Warner
890763de78 NEWS: describe all changes since the last release. Still needs editing. 2008-09-18 17:27:55 -07:00
Brian Warner
6607fdc586 CLI: add 'tahoe admin generate-keypair' command 2008-09-18 17:11:33 -07:00
Brian Warner
99d5a8d8b9 web: add 'more info' pages for files and directories, move URI/checker-buttons/deep-size/etc off to them 2008-09-17 22:00:41 -07:00
Brian Warner
dde7d67498 setup.py: remove unused 'Extension' import 2008-09-17 16:08:29 -07:00
Brian Warner
050bee8fdc setup.py,Makefile: move the 'chmod +x bin/tahoe' into setup.py 2008-09-17 16:07:56 -07:00
Brian Warner
add26fdcd3 docs/install.html: reference InstallDetails instead of debian-specific stuff 2008-09-17 15:57:42 -07:00
Brian Warner
09603212ca Makefile,docs: tahoe-deps.tar.gz now lives in separate source/deps/ directory on http://allmydata.org 2008-09-17 13:44:52 -07:00
Brian Warner
3900d1fe7f docs: mention -SUMO tarballs, point users at release tarballs instead of development ones 2008-09-17 13:36:31 -07:00
Brian Warner
749c5a95e0 setup.py,Makefile: teat sdist --sumo about tahoe-deps/, use -SUMO suffix on tarballs, add sumo to 'make tarballs' target 2008-09-17 13:01:19 -07:00
Brian Warner
9aadf07835 .darcs-boringfile ignore tahoe-deps and tahoe-deps.tar.gz 2008-09-17 12:59:38 -07:00
Zooko O'Whielacronx
2d18450f7f docs: add a note about the process of making a new Tahoe release 2008-09-17 10:08:39 -07:00
Brian Warner
880df93c8b Makefile: pyutil from a dependent lib causes a #455-ish problem, the workaround is to run build-once *three* times 2008-09-16 22:36:43 -07:00
Brian Warner
00debea3a9 Makefile: desert-island: don't re-fetch tahoe-deps.tar.gz if it's already there, remove the tahoe-deps/ before untarring directory to avoid unpacking weirdness 2008-09-16 22:22:04 -07:00
Brian Warner
cf27f81a88 misc/check-build.py: ignore the 'Downloading file:..' line that occurs for the setup_requires= -triggered handling of the setuptools egg 2008-09-16 22:17:25 -07:00
Brian Warner
1853020a5f #249: add 'test-desert-island', to assert that a tahoe-deps.tar.gz -enabled build does not download anything 2008-09-16 18:37:02 -07:00
Brian Warner
fd432b43bf #249: get dependent libs from tahoe-deps and ../tahoe-deps 2008-09-16 18:36:27 -07:00
Brian Warner
fafdf58e41 #249: move dependent libs out of misc/dependencies/, get them from tahoe-deps.tar.gz instead 2008-09-16 18:25:45 -07:00