Commit Graph

148 Commits

Author SHA1 Message Date
david-sarah
b9121e045f test_runner.py: fix a race condition in the test when NODE_URL_FILE is written before PORTNUM_FILE. refs #1469 2011-08-06 16:18:42 -07:00
david-sarah
743cb898e7 test_runner.py: cleanups of HOTLINE_FILE writing and removal. 2011-08-06 16:16:52 -07:00
david-sarah
e3c600d047 test_runner.py: remove an unused constant. 2011-08-06 15:14:16 -07:00
david-sarah
531758df19 test_runner.py: test that client and introducer nodes record their port number and use that port on the next restart. This tests for a regression caused by ref #1385. 2011-08-06 15:06:35 -07:00
david-sarah
b9eb0235ea test_runner.py: fix a bug in CreateNode.do_create introduced in changeset [5114] when the tahoe.cfg file has been written with CRLF line endings. refs #1385 2011-08-03 17:30:32 -07:00
david-sarah
521754b506 test_runner.py: fix RunNode.test_introducer to not rely on the mtime of introducer.furl to detect when the node has restarted. Instead we detect when node.url has been written. refs #1385 2011-08-03 11:09:17 -07:00
david-sarah
e74387f4f1 test_runner.py: modify RunNode.test_introducer to test that starting an introducer works when the introducer.furl file already exists. refs #1385 2011-08-02 18:27:04 -07:00
Zooko O'Whielacronx
e5c4e83f4c reject old-style (pre-Tahoe-LAFS-v1.3) configuration files
Check for the existence of any of them and if any are found raise exception which will abort the startup of the node.
This is a backwards-incompatible change for anyone who is still using old-style configuration files.
fixes #1385
2011-08-01 16:24:23 -07:00
Zooko O'Whielacronx
420e3aa293 whitespace-cleanup 2011-07-24 18:55:46 -07:00
Zooko O'Whielacronx
578a117c5b test: increase timeout on a network test because Francois's ARM machine hit that timeout
I'm skeptical that the test was proceeding correctly but ran out of time. It seems more likely that it had gotten hung. But if we raise the timeout to an even more extravagant number then we can be even more certain that the test was never going to finish.
2011-03-17 09:59:09 -07:00
david-sarah
f84f2aa987 tests: use verlib to compare versions, and get the versions of Twisted and Nevow from get_package_versions() instead of pkg_resources. refs #1287 2011-01-21 17:42:56 -08:00
david-sarah
8587c63bdc Make bb-freeze (and probably other static packaging tools) work. This updates various places where we assumed that the tahoe process was executed via the Python interpreter. It also allows tests to recursively invoke the same tahoe.exe, rather than bin/tahoe. refs #585 2011-01-21 00:04:29 -08:00
david-sarah
6dd8b6f471 Eliminate dependencies on pywin32, even via Twisted. refs #1274 2011-01-19 20:32:38 -08:00
david-sarah
fd6cdc48ae src/allmydata/test/test_runner.py: add test_import_from_repl, which checks that we are running the right code in a bin/tahoe subprocess. refs #1258 2011-01-19 00:21:45 -08:00
david-sarah
8a3cb60bf7 Test changes to take account of ref #1311. 2011-01-16 22:05:40 -08:00
Brian Warner
45212d8000 Set "reserved_space=1G" in newly-created storage nodes. Closes #1208. 2011-01-16 12:58:22 -08:00
david-sarah
e62a69e7ff test_runner: avoid unnecessary use of non-ASCII. 2011-01-01 02:01:01 -08:00
david-sarah
9ceb527787 Change another doc reference from .txt to .rst in a text string. 2010-11-28 09:45:07 -08:00
Brian Warner
69b42c6cb7 remove --multiple/-m option from all CLI commands: closes #1262
I personally used "tahoe start/restart -m ../MY-TESTNET/node*" all the time,
to spin up or update a local testgrid while iterating over new code. However,
with the recent switch from "subprocess.Popen(/bin/twistd)" to "import and
call twistd.run()" in scripts/startstop_node.py (yay fewer processes!),
"start -m" broke, and fixing it requires os.fork, which is unavailable on
windows (boo windows!). And I was probably the only one using -m. So in the
interests of uniformity among platforms and simpler code (yay negative code
days!), we're just removing -m from everything. I will start using a little
shell script or something to simulate the removed functionality.

This patch also cleans up CLI-function calling a bit: get the basedir from
the config dict (instead of sometimes from a separate argument), and always
return a numeric exit code.
2010-11-27 00:38:09 -08:00
Brian Warner
f36bda2780 Revert previous commit: there's an ugly corner-case on windows that fails tests.
Specifically, test_runner.CreateNode.test_client failed, because the
os.fork-is-present test decided that --multiple should not be allowed on
windows, even though --multiple works just fine for 'tahoe create-client'.
The only restriction on --multiple is for 'tahoe start' and 'tahoe restart'.

This needs a different approach, probably by cleaning up BasedirMixin. We
should only be withholding --multiple on windows for "start" and
"restart". (we should continue withholding --multiple on all platforms for
"run").

This reverts (git) commit f3adb037ae:
 "startstop_node.py: fix "tahoe start -m" by forking before non-final targets"
2010-11-26 16:44:11 -08:00
Brian Warner
f3adb037ae startstop_node.py: fix "tahoe start -m" by forking before non-final targets
* don't advertise -m flag on tahoe start/restart/run unless os.fork is
  available (i.e. windows)
* test_runner.py: add test to exercise "start/stop/restart -m"
2010-11-26 14:45:38 -08:00
david-sarah
56f4c1218b test_runner.py: fix test failure in test_the_right_code after applying zooko's change to test-with-fake-pkg.py 2010-11-01 20:59:05 -07:00
david-sarah
10a5f23df9 test_runner.py: fix error in BinTahoe.test_version_no_noise introduced by last patch. refs #1235 2010-10-29 15:11:23 -07:00
david-sarah
d249589667 test_runner.py: also allow 'from pkg_resources import load_entry_point' as noise. refs #1235. 2010-10-29 13:42:46 -07:00
david-sarah
8c95f88b4f test_runner.py: if the only noise is 'UserWarning: Unbuilt egg for setuptools', skip instead of failing the no_noise tests. This version avoids 'any' to be compatible with Python < 2.5. refs #1235. 2010-10-29 12:18:04 -07:00
david-sarah
b23a7fcc10 test_runner.py: fix spurious failures of test_path on case-insensitive filesystems, and restore the check that the version is not 'unknown'. 2010-09-11 15:19:13 -07:00
Zooko O'Whielacronx
fd17d63c95 test: make tests stop relying on pyutil version class accepting the string 'unknown' for its version, and make them forward-compatible with the future Python Rational Version Numbering standard 2010-09-10 08:41:35 -07:00
david-sarah
fd9a2205de test_runner.py: correct and simplify normalization of package directory for case-insensitive filesystems. 2010-08-08 11:50:05 -07:00
david-sarah
f88e4f0df6 test_runner.py: make test_path work for test-from-installdir. 2010-08-08 10:13:40 -07:00
david-sarah
dc53d4f5ef test_runner.py: another try at calculating the rootdir correctly for test-from-egg and test-from-prefixdir. 2010-08-08 08:43:07 -07:00
david-sarah
39fa9a81d1 test_runner.py: calculate the location of bin/tahoe correctly for test-from-prefixdir (by copying code from misc/build_helpers/run_trial.py). Also fix the false-positive check for Unicode paths in test_the_right_code, which was causing skips that should have been failures. 2010-08-07 21:28:17 -07:00
david-sarah
600cb95fe2 test_runner.py: increase timeout to cater for Francois' ARM buildslave. 2010-08-05 21:26:01 -07:00
david-sarah
a7c474a098 CLI: further improve consistency of basedir options and add tests. addresses #118 2010-08-03 01:54:16 -07:00
david-sarah
d81e8acf88 test_runner.py: add test_run_with_python_options, which checks that the Windows script changes haven't broken 'python <options> bin/tahoe'. 2010-08-01 23:25:58 -07:00
david-sarah
3ddb4a9bbf test_runner.py: fix missing import of get_filesystem_encoding 2010-08-01 23:09:02 -07:00
david-sarah
3af6f19cb0 misc/build_helpers/run_trial.py: check that the root from which the module we are testing was loaded is the current directory. This version of the patch folds in later fixes to the logic for caculating the directories to compare, and improvements to error messages. addresses #1137 2010-08-01 21:55:35 -07:00
david-sarah
1fad717aaa test_runner.py: change to code for locating the bin/tahoe script that was missed when rebasing the patch for #1074. 2010-07-25 11:20:08 -07:00
david-sarah
37b07a545f Changes to Tahoe needed to work with new zetuptoolz (that does not use .exe wrappers on Windows), and to support Unicode arguments and stdout/stderr -- v5 2010-07-25 01:32:16 -07:00
david-sarah
f952532f08 Basedir/node directory option improvements for ticket798 branch. addresses #188, #706, #715, #772, #890 2010-08-01 21:30:04 -07:00
david-sarah
9aae9208e3 test_runner.py: Fix error in message arguments to 'fail' calls. 2010-08-01 18:35:26 -07:00
david-sarah
618db4867c Replace uses of os.path.abspath with abspath_expanduser_unicode where necessary. This makes basedir paths consistently represented as Unicode. 2010-07-21 17:14:18 -07:00
Zooko O'Whielacronx
fd874d6669 setup: fix a couple instances of hard-coded 'allmydata-tahoe' in the scripts, tighten the tests (as suggested by David-Sarah) 2010-08-01 09:42:07 -07:00
Zooko O'Whielacronx
44edecb36c setup: replace hardcoded 'allmydata-tahoe' with allmydata.__appname__ 2010-08-01 09:05:17 -07:00
david-sarah
bdc6fd2f8b test_runner: test that 'tahoe --version' outputs no noise (e.g. DeprecationWarnings). 2010-07-19 18:13:45 -07:00
Zooko O'Whielacronx
d4f6d4092c test: show stdout and stderr in case of non-zero exit code from "tahoe" command 2010-05-24 00:33:48 -07:00
Zooko O'Whielacronx
35efdf04ca tests: don't let bench_dirnode.py do stuff and have side-effects at import time (unless __name__ == '__main__') 2010-05-21 05:20:52 -07:00
Zooko O'Whielacronx
e4e2599017 tests: don't require tahoe to run with no noise if we are using an old twisted that emits DeprecationWarnings 2010-01-31 21:23:23 -08:00
david-sarah
6215ebd95e cli: suppress DeprecationWarnings emitted from importing nevow and twisted. Fixes #859 2010-01-31 16:44:29 -08:00
Brian Warner
3880486f91 test_runner: cleanup, refactor common code into a non-executable method
Having both test_node() and test_client() (one of which calls the other) felt
confusing to me, so I changed it to have test_node(), test_client(), and a
common do_create() helper method.
2010-01-27 14:40:40 -08:00
david-sarah
174d356692 Message saying that we couldn't find bin/tahoe should say where we looked 2010-01-16 12:45:56 -08:00
david-sarah
87f1bae7fe Add create-node CLI command, and make create-client equivalent to create-node --no-storage (fixes #760) 2010-01-15 21:20:55 -08:00
Zooko O'Whielacronx
22c962bbc2 tests: double the timeout on test_runner.RunNode.test_introducer since feisty hit a timeout
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.
2009-08-15 09:05:12 -07:00
Brian Warner
0d0e0ba2fb test_runner.py: tolerate symlinks in the source tree directory's ancestor path 2009-07-30 10:17:24 -07:00
Brian Warner
3a1196701f test_runner.py: remove test_client_no_noise: the issue in question is
ticketed in http://divmod.org/trac/ticket/2830 and doesn't need a Tahoe-side
change, plus this test fails on win32 for unrelated reasons (and test_client
is the place to think about the win32 issue).
2009-06-01 15:50:07 -07:00
Brian Warner
b542d5aca6 test_runner.py: fix minor typo 2009-05-19 20:36:20 -07:00
Zooko O'Whielacronx
718537ab8c tests: mark test_runner as coded in utf-8 instead of ascii 2009-05-07 15:31:51 -07:00
Zooko O'Whielacronx
04ff9a3f97 tests: raise timeout on test_runner.RunNode.test_introducer from 120s to 240s, since it hit the 120s time-out on François Lenny-armv5tel 2009-05-07 14:50:12 -07:00
Brian Warner
f35c659b2f tests: stop using setUpClass/tearDownClass, since they've been deprecated in Twisted-8.2.0 2009-02-23 14:43:12 -07:00
Zooko O'Whielacronx
8303f90da0 nodeadmin: node stops itself if a hotline file hasn't been touched in 60 seconds now, instead of in 40 seconds
A test failed on draco (MacPPC) because it took 49 seconds to get around to running the test, and the node had already stopped itself when the hotline file was 40 seconds old.
2009-02-12 15:21:31 -07:00
Zooko O'Whielacronx
079c1851a9 trivial: whitespace 2009-02-11 11:19:35 -07:00
Brian Warner
b197c5bb8c test_runner: skip all spawnProcess-using tests on cygwin, since spawnProcess just hangs forever 2009-02-09 02:34:00 -07:00
Brian Warner
19902a0f16 test_runner.py: revert the CreateNode section to using runner() inline, rather than spawning a process, to get more precise coverage 2009-02-09 02:26:17 -07:00
Zooko O'Whielacronx
f0682cf43e setup: more verbose assertion failure in test_runner 2009-01-29 10:49:06 -07:00
Zooko O'Whielacronx
8d7fe2adb3 trivial: remove unused imports noticed by pyflakes 2009-01-27 15:11:48 -07:00
Zooko O'Whielacronx
64d12a9402 setup: fix test_runner to invoke bin/tahoe.exe instead of bin/tahoe if on Windows (this is what happens when a user invokes bin/tahoe on Windows) 2009-01-27 14:37:17 -07:00
Zooko O'Whielacronx
1ae08acc8f setup: fix test_runner to assert that lines which are output to stderr must end with a punctuation mark (apparently re.search("x$", "x\r\n") does not match. :-() 2009-01-27 14:35:05 -07:00
Zooko O'Whielacronx
3cd4722c9b setup: fix test_runner.RunNode.test_baddir -- it was left incomplete and broken by a recent patch 2009-01-27 14:32:45 -07:00
Zooko O'Whielacronx
688bb7a453 setup: go ahead and check for noise in test_client_no_noise 2009-01-26 17:46:16 -07:00
Zooko O'Whielacronx
8d2a3e78ca setup: add a test for a warning message from importing nevow, marked as TODO, comment-out the assertion of no-noise inside other test_runner tests 2009-01-26 17:30:46 -07:00
Zooko O'Whielacronx
3e4450cf3f setup: find a "bin/tahoe" executable to test based on allmydata.__file__ instead of based on the CWD
This means that the tests still work if you are executing them from a CWD other than the src dir -- *if* the "bin/tahoe" is found at os.path.dirname(os.path.dirname(os.path.dirname(allmydata.__file__))).
If no file is found at that location, then just skip the tests of executing the "tahoe" executable, because we don't want to accidentally run those tests against an executable from a different version of tahoe.
2009-01-23 18:34:37 -07:00
Zooko O'Whielacronx
b77c89ac60 setup: add test that the tests are testing the right source code
This is a test of #145, and I think that now the code passes this test.
2009-01-22 15:52:40 -07:00
Zooko O'Whielacronx
967102e1b9 trivial: removed unused imports noticed by pyflakes 2009-01-22 15:52:13 -07:00
Zooko O'Whielacronx
210da5cd9a setup: change test_runner to invoke "bin/tahoe" in a subprocess instead of executing runner.runner()
This is necessary because loading allmydata code now depends on PYTHONPATH manipulation which is done in the "bin/tahoe" script.  Unfortunately it makes test_runner slower since it launches and waits for many subprocesses.
2009-01-22 15:38:18 -07:00
Zooko O'Whielacronx
25d962c67d test: extend timeout on the hotline file that prevents the client from stopping itself
The 20-second timeout was apparently tripped on my Powerbook G4 "draco".
2008-12-21 21:06:29 -07:00
Zooko O'Whielacronx
8b7ce325d7 immutable, checker, and tests: improve docstrings, assertions, tests
No functional changes, but remove unused code, improve or fix docstrings, etc.
2008-12-21 15:07:52 -07:00
Brian Warner
71c62f8fcb #542 'tahoe create-key-generator': fix the .tac file this creates to be compatible with modern code, add a test 2008-12-01 17:47:21 -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
1af3bfb1d4 test_runner.py: test launching an introducer too 2008-02-18 00:28:56 -07:00
Brian Warner
6ff98a3c0b 'tahoe start': allow this to start arbitrary .tac file -bearing directories (like the log gatherer) 2008-02-18 00:28:17 -07:00
Zooko O'Whielacronx
fc0d637523 docs: update install and usage docs, improve cli "usage" output, make new example directories, add unit test that fails code which prints out sentences that don't end with punctuation marks 2008-02-15 13:11:02 -07:00
Zooko O'Whielacronx
3605354a95 fix several bugs and warnings -- thanks, pyflakes 2007-12-03 15:42:35 -07:00
Zooko O'Whielacronx
59d6c3c822 decentralized directories: integration and testing
* use new decentralized directories everywhere instead of old centralized directories
 * provide UI to them through the web server
 * provide UI to them through the CLI
 * update unit tests to simulate decentralized mutable directories in order to test other components that rely on them
 * remove the notion of a "vdrive server" and a client thereof
 * remove the notion of a "public vdrive", which was a directory that was centrally published/subscribed automatically by the tahoe node (you can accomplish this manually by making a directory and posting the URL to it on your web site, for example)
 * add a notion of "wait_for_numpeers" when you need to publish data to peers, which is how many peers should be attached before you start.  The default is 1.
 * add __repr__ for filesystem nodes (note: these reprs contain a few bits of the secret key!)
 * fix a few bugs where we used to equate "mutable" with "not read-only".  Nowadays all directories are mutable, but some might be read-only (to you).
 * fix a few bugs where code wasn't aware of the new general-purpose metadata dict the comes with each filesystem edge
 * sundry fixes to unit tests to adjust to the new directories, e.g. don't assume that every share on disk belongs to a chk file.
2007-12-03 14:52:42 -07:00
Brian Warner
07b03bd55b test_runner.RunNode: pass an explicit webport, to avoid using 8123 (which might be in used by a running node). Closes #175. 2007-10-13 16:06:39 -07:00
Brian Warner
dc573554c8 rename bin/allmydata-tahoe to bin/tahoe. Closes #155. 2007-10-11 03:38:24 -07:00
Brian Warner
ee72a5adfd rename client.tac to tahoe-client.tac, so that 'ps ax|grep tahoe' works. Closes #156. 2007-10-11 02:48:06 -07:00
Brian Warner
7fd1964c6f runner: make most commands use ~/.tahoe by default (create-client, start/stop/restart, all CLI tools, but *not* create-introducer 2007-10-11 01:54:23 -07:00
Brian Warner
2b93164a03 test_runner: try harder to work on slow buildslaves and cygwin 2007-09-19 13:56:00 -07:00
Brian Warner
e2f19825d9 startstop_node.py: improve test coverage a little bit 2007-09-19 01:50:27 -07:00
Brian Warner
a5fab9935b test_runner: better diagnostics in case test_client fails 2007-09-18 20:03:18 -07:00
Brian Warner
38946439f3 test_runner.py: fix race conditions in start/stop node, should run on cygwin now 2007-09-18 15:17:26 -07:00
Brian Warner
645927ca73 test_runner.py: skip the start/stop test when sys.platform is win32/cygwin.
The previous twisted.python.runtime.platformType approach didn't catch cygwin
for some reason.
2007-09-17 21:56:08 -07:00
Brian Warner
f72ef4d8f9 test_runner.py: add tests for startstop_node.py 2007-09-17 02:25:31 -07:00
Brian Warner
4a16d20d85 runner.py: start to refactor into separate files 2007-07-10 18:41:52 -07:00
Brian Warner
912fc5a77e runner.py: improve test coverage further: implement --quiet with StringIOs 2007-06-26 16:19:18 -07:00
Brian Warner
a505560bbe improve test coverage of runner.py 2007-06-26 15:36:46 -07:00
Brian Warner
813fdd70da test_runner.py: improve test coverage a little bit 2007-04-23 21:28:19 -07:00
Brian Warner
d1a848e0a7 runner.py: add --quiet, use it from test cases 2007-04-23 21:17:13 -07:00
Brian Warner
491f96258e test_runner.py: add some coverage for allmydata.scripts.runner, to create nodes 2007-04-19 18:56:45 -07:00