Brian Warner
52ef00b46b
CLI: refactor to make testing easier
...
When tests need a Config object, they now call a function which invokes
Click with a mocked-out go() function, and grabs the Config object
before actually doing anything with it.
2016-07-14 22:34:10 -06:00
Brian Warner
7b1d4cbcee
more stats: count since last reboot
2016-06-26 11:01:52 -07:00
Brian Warner
fa29789769
test_scripts: re-enable tests on py3
...
These weren't running because Click complained about an ASCII locale
when running under py3, which triggered an error check that was there to
detect broken virtualenvs, skipping those tests.
The fix appears to be to force the en_US.UTF-8 locale when running the
wormhole program in a subprocess.
2016-06-22 19:28:17 -07:00
meejah
ad6200c474
resolve XXX comments
2016-06-22 01:27:29 -06:00
meejah
e16b53817e
Refactor to use Click
2016-06-22 01:11:07 -06:00
laharah
150caedf73
u""
cleanup on test_scripts.py
2016-06-04 14:09:19 -07:00
laharah
6a73d50fdd
added unicode_literals import to all apropriate modules
...
bug in twisted serverFromString prevents test.common and transit
from using unicode properly should revisit if twisted gets patched
2016-06-04 12:42:59 -07:00
Brian Warner
26445c3fc4
test_scripts: fix on windows
2016-06-03 16:43:22 -07:00
Brian Warner
48cc85e88c
add file-mode checks to directory test
...
This new test failed before fixing _extract_file, and now it passes.
2016-06-03 16:05:51 -07:00
Brian Warner
71512809a9
extract _extract_file, add test
2016-06-03 15:38:49 -07:00
Brian Warner
905ec05696
fix welcome-error signalling
...
The handler was calling _signal_error() incorrectly.
2016-05-26 15:37:24 -07:00
Brian Warner
19702e01ac
make send pay attention to receiver errors correctly
...
Errors like "Refusing to overwrite existing file" would leave the sender
hanging, because it was looking for the "error" key in the wrong place.
2016-05-25 22:44:18 -07:00
Brian Warner
1a9e565fc3
cmd_send: turn into a self-contained class
...
This will make it easier to maintain state.
2016-05-24 17:44:41 -07:00
Brian Warner
96f25ec7a2
rename phase1 to offer/answer
...
rearrange cmd_send a bit to do less before the Wormhole is built
2016-05-24 16:41:13 -07:00
Brian Warner
3a062eaa26
bring scripts and tests up to date
...
* use wormhole instead of transcribe.py
* send() no longer waits
* get_verifier -> verify
* derive_key demands a length
2016-05-24 00:00:44 -07:00
Brian Warner
85dc0fd41b
change server API: "release" instead of "deallocate"
2016-05-12 17:46:15 -07:00
Brian Warner
2f6caa04d3
test_scripts.Cleanup: new test
...
This asserts that we deallocate the rendezvous channel, even when we
terminate early due to errors.
2016-04-25 17:53:00 -07:00
Brian Warner
34116c7b1f
CLI: document and return correct errors
...
Also clean up test_scripts.PregeneratedCode:
* fetch results from both sides at the same time
* only check rc when using a subprocess, since the direct call doesn't
use rc=0 anymore
* no need to cancel the other side's Deferred when one errors
* provide more information if stderr was non-empty
2016-04-25 17:52:59 -07:00
Brian Warner
4eaf88d7d2
cmd: remove _twisted suffix from function names
...
No longer necessary now that all commands are twisted-based.
2016-04-24 22:49:18 -07:00
Brian Warner
85b6264826
unsplit cli step 2: edit files
2016-04-20 19:15:33 -07:00
Brian Warner
7a5a99a1a8
unsplit tests step 3: modify files
2016-04-20 18:54:10 -07:00
Brian Warner
c890a850aa
unsplit tests step 1: move files
2016-04-20 18:44:33 -07:00
Brian Warner
95706c752c
move tests step 1: rename files
2016-04-18 16:45:03 -07:00
Brian Warner
36e63e2347
split wormhole_cli step 2: fix imports, setup.py
2016-04-18 16:43:18 -07:00
Brian Warner
4e937c2100
rename cmd_send_twisted to cmd_send, same for cmd_receive
2016-04-18 15:52:29 -07:00
Brian Warner
a1033b06a3
merge send_common into cmd_send_twisted
2016-04-18 15:52:29 -07:00
Brian Warner
68b22bec97
remove --twisted, stop using blocking-flavor scripts
2016-04-18 15:52:18 -07:00
Brian Warner
049fac01db
tolerate trailing slash on "wormhole send dirname/"
...
Previously, the trailing slash would cause the receiving side to get an
empty-named directory.
2016-03-24 08:46:29 -07:00
Brian Warner
8d82726c51
add DebugTiming object, --dump-timing= option
...
This writes timeline data to a .json file, which can be examined later
to find likely candidates for optimization.
2016-03-01 18:23:06 -08:00
Brian Warner
b1dae14e6d
test_scripts: handle hangs in one client
...
When test_scripts ran two clients at the same time, an error in one
could leave the other hanging (in a thread). One Deferred would errback,
the other would hang. Tests wait on one Deferred at a time, so if we're
unlucky and were waiting on the hanging Deferred (instead of the
erroring one), we'll wait forever, or at least until the default test
timeout of 180 seconds.
This adds an errback to notice when either client has errored, and
cancels the other Deferred, so it doesn't matter which one we wait upon
first.
2016-03-01 17:07:43 -08:00
Brian Warner
c225d57f8c
cmd_receive_twisted.py: twisted-based implementation
2016-02-29 07:31:34 -08:00
Brian Warner
01064325a2
cmd_receive: refactor (slight message changes)
...
This prepares the way for a twisted-based implementation.
2016-02-29 07:30:40 -08:00
Brian Warner
1ff0792b32
test_scripts: prep for windows compatibility
...
newlines, os.mkfifo errors, JSON type differences
2016-02-27 14:46:38 -08:00
Brian Warner
e6fba34570
start on twisted receive: move old files into new homes
2016-02-17 19:25:19 -08:00
Brian Warner
aa27bfd32c
add twisted form of sender
...
Currently this is only invokable from tests.
2016-02-17 19:02:36 -08:00
Brian Warner
369854b4cc
test build_phase1_data
2016-02-17 18:07:35 -08:00
Brian Warner
79decea9ea
rearrange scripts: make room for twisted
2016-02-17 16:26:03 -08:00
Brian Warner
5d572137f4
improve test error message
2016-02-17 14:00:03 -08:00
Brian Warner
fd7d1b97d4
test scripts in a thread, not a subprocess, mostly
2016-02-17 14:00:01 -08:00
Brian Warner
903129f4a2
add --hide-progress, mostly for tests
2016-02-17 13:58:41 -08:00
Brian Warner
e2f3bebe38
allow --relay-helper="" to disable relay
...
test_scripts now uses this to avoid accidentally using a relay
2016-02-17 13:53:18 -08:00
Brian Warner
00833a4bde
test_scripts: factor out common test code
2016-02-17 10:22:31 -08:00
Brian Warner
36cc0e2bca
tests: don't use network
...
Some tests failed to override --transit-helper, which meant they
intermittently talked to the real transit server (briefly, before
deciding the local+direct connection was better).
2016-02-12 17:11:06 -08:00
Brian Warner
5b46df133f
implement (and test) --output-file for receive-file
2015-11-29 01:40:25 -06:00
Brian Warner
3a343f9895
test send/receive directory
2015-11-29 01:33:15 -06:00
Brian Warner
35768d6738
wormhole/invitation code is now unicode
2015-10-06 19:42:10 -07:00
Brian Warner
574d5f2314
scope channelids to the appid, change API and DB schema
...
This requires a DB delete/recreate when upgrading. It changes the server
protocol, and app IDs, so clients cannot interoperate with each other
across this change, nor with the server. Flag day for everyone!
Now apps do not share channel IDs, so a lot of usage of app1 will not
cause the wormhole codes for app2 to get longer.
2015-10-06 19:21:53 -07:00
Brian Warner
00caa9f6d9
oops, update tests to match
2015-10-03 23:27:28 -07:00
Brian Warner
e7e5c2d079
merge send/receive "file" and "text" into a single command
2015-10-03 22:45:43 -07:00
Brian Warner
336eea5e78
tests: handle argparse on py3.3
...
which sends --version to stderr, not stdout. This might make the py3.3
tests pass.
2015-09-28 16:31:35 -07:00