Commit Graph

306 Commits

Author SHA1 Message Date
Andrew Bettison
788b3e37b2 Fix JNI argv parsing: throw exception on NULL
Add new 'jni' test case to ensure this works
2013-02-15 19:33:12 +10:30
Andrew Bettison
c42260f5f9 Replace "add did" command with improved "keyring add did"
Output is same format as "keyring add" command

Fixed minor bug in rolling a random DID -- last byte was not random

Some code improvements, including better support for sid_t
2013-02-14 16:06:01 +10:30
Andrew Bettison
433f49551a Cosmetic improvements to 'routing' test script 2013-02-14 16:02:09 +10:30
Andrew Bettison
f66a894a63 Improve keyring PIN handling
Replace explicit [<pin,pin...>] command-line arguments with --entry-pin=<pin>
options.  Update test scripts accordlingly.

Add --keyring-pin=<pin> option (with one test case).
2013-02-13 16:49:52 +10:30
Andrew Bettison
46513bf192 Add keyring tests to 'all' test script 2013-02-11 18:43:12 +10:30
Andrew Bettison
b2923744b0 Add 'keyring' test script with three basic tests 2013-02-11 18:41:36 +10:30
Andrew Bettison
2eb930b94c Improve Rhizome Direct stress test
Reduce log verbosity, report extra files received by nodes, re-order
push/pull/sync process start order to increase chance of cross-fetching.
2013-02-11 18:39:46 +10:30
Andrew Bettison
cb288d8b9c Fix new Rhizome Direct stress test
Now PASSES with Jeremy's recent fix, but FAILED before
2013-02-08 19:24:03 +10:30
Andrew Bettison
b5a55c8c08 Add Rhizome Direct stress test
Use new test framework fork() support to run several rhizome direct
push/pull/sync processes at once to a single server.

Speed up setup for Rhizome Transfer stress test.
2013-02-08 18:46:30 +10:30
Andrew Bettison
7a8323b31d Improve Rhizome stress tests
Rename tests to start with "Stress" prefix

Refactor StressRhizomeAdd test to use conventional utilities and be more
readable.  Remove trailing "sleep 10".
2013-02-08 12:08:24 +10:30
Andrew Bettison
a6b6209c6c Improve Rhizome Direct tests
Push/pull three bundles of varying sizes each way instead of one 64 byte
bundle each way
2013-02-08 10:39:41 +10:30
Andrew Bettison
c804b9d5ce Fix copyright messages in test scripts 2013-02-06 18:55:31 +10:30
Andrew Bettison
248e2b7096 Add new 'all' test script
Runs all tests except Rhizome stress tests.
2013-02-06 18:51:01 +10:30
Jeremy Lakeman
b35c1aca43 Specify that unicast traffic should use unicast UDP packets 2013-01-29 11:57:13 +11:00
Andrew Bettison
546fccc794 Support relative log.file config option
As already documented in doc/Servald-Configuration.md
2013-01-23 14:54:25 +10:30
Jeremy Lakeman
dbd4cb1771 Fix jni tests on osx & with new interface 2013-01-23 14:43:50 +10:30
Jeremy Lakeman
ad01836d0e Use database query to respond to rhizome list, add name argument 2013-01-17 11:45:45 +10:30
Jeremy Lakeman
b25ff45438 Importing the same bundle twice returns duplicate flag 2013-01-15 10:32:48 +10:30
Jeremy Lakeman
5a82bfcf31 Add support for importing and exporting a file with an appended manifest 2013-01-11 14:30:52 +10:30
Jeremy Lakeman
7825f9dbd2 Combine manifest and file extraction into one method that can also do both 2013-01-11 14:30:51 +10:30
Andrew Bettison
5ac394a3c1 Maybe fix tests/server:NoZombie occasional failure
Introduced a two-second wait for the KILLed process to die.
2013-01-10 12:12:51 +10:30
Jeremy Lakeman
c7cf80b352 Use sqlite user schema version to remember state 2013-01-06 13:04:49 +10:30
Jeremy Lakeman
2b480c1d1a Reinstate filesize and hash file extract output 2013-01-04 12:01:40 +10:30
Jeremy Lakeman
fd96c5bd76 Add bsk to correct command 2013-01-04 12:01:39 +10:30
Jeremy Lakeman
28a05baa54 Enable encryption of rhizome payloads 2013-01-03 16:12:24 +10:30
Jeremy Lakeman
8b045dd1a6 Extract files based on the manifest id
Renamed rhizome extract file to rhizome dump file
Added rhizome extract file [manifest] [filepath] [pins]
Modified tests to use the appropriate command, assuming that MeshMS payloads will be encrypted
2013-01-02 12:58:05 +10:30
Jeremy Lakeman
f906d5a46c Test each file immediately after adding 2012-12-28 12:00:43 +10:30
Jeremy Lakeman
3f45623d04 New stress test, rhizome add while transferring 2012-12-27 16:51:31 +10:30
Jeremy Lakeman
50b216da96 Make directory service test fail if the dna helper doesn't start 2012-12-20 16:50:50 +10:30
Jeremy Lakeman
38589f293c Interface speed is no longer validated 2012-12-20 16:20:12 +10:30
Jeremy Lakeman
f64de66b34 Refactor add via HTTP to be equivalent to command line add 2012-12-20 15:36:07 +10:30
Jeremy Lakeman
d76b3a25f9 Fail duplicate manifest test if secret is different 2012-12-17 16:09:22 +10:30
Jeremy Lakeman
55be5208a9 Remove packet queue delays, rely on network limits 2012-12-14 17:11:57 +10:30
Andrew Bettison
7d970d8f92 Merge branch 'newconfig' into 'master' 2012-12-11 17:21:56 +10:30
Andrew Bettison
5985df751d Overhaul debug flags
Replace debugflags_t and DEBUG_XXX bit masks with config schema "debug.xxx"
entries.

No more support for "debug.all".
2012-12-11 15:59:46 +10:30
Jeremy Lakeman
5798e5acb5 Always send scan packets with full sid 2012-12-11 13:32:02 +10:30
Jeremy Lakeman
dc6d0da07e Add explicit route tests and improve test speed 2012-12-11 11:27:18 +10:30
Jeremy Lakeman
c3f573ea7f Add more messages, wait for directory service to start first
And make sure gaps in sockaddr_in are zeroed.
2012-12-10 14:42:57 +10:30
Jeremy Lakeman
2932544eb8 Add IPv4 addresses to dummy interface 2012-12-10 14:06:25 +10:30
Andrew Bettison
8425882ffc Merge branch 'newconfig' into 'master'
Conflicts:
	commandline.c
	conf.h
	dataformats.c
	log.h
	overlay_address.c
	overlay_interface.c
	packetformats.c
	rhizome.c
	serval.h
	tests/directory_service
	vomp_console.c
2012-12-07 14:09:55 +10:30
Andrew Bettison
fe042bfa64 Servald 'config [ set|del ... ] ... ' command
Update all test scripts to avoid repetitive executeOk_servald invocations.
2012-12-06 12:31:19 +10:30
Jeremy Lakeman
4557c82b1f Increase delay before failing tests 2012-12-06 11:54:09 +10:30
Andrew Bettison
4985359158 Fix 'rhizomestress' test failures 2012-12-05 16:11:23 +10:30
Andrew Bettison
9e6059e473 Fix 'routing' test failures 2012-12-05 15:50:34 +10:30
Andrew Bettison
b497c88d9d Fix 'directory_service' test failures
New configuration schema.
2012-12-05 15:47:14 +10:30
Andrew Bettison
250fad71e8 Fix 'dnaprotocol' test failures
Config option "mdp.TYPE.tick_ms" is now "mdp.iftype.TYPE.tick_ms"
2012-12-05 15:26:25 +10:30
Andrew Bettison
1a3f916cfb Fix 'rhizomeprotocol' test failures
Config option rhizome.direct.peer.count is no longer required.

Bug in new URI parsing code.
2012-12-05 15:23:59 +10:30
Andrew Bettison
8384fed9c5 Fix failing 'dnahelper' test 2012-12-05 14:51:38 +10:30
Andrew Bettison
aa638a9bfd Fix new 'interfaces' config option
Introduce CFINCOMPATIBLE config parse result flag.

Sort interface rules by unsigned integer key.

Legacy and modern 'interfaces' config styles are now incompatible.

Validate config_network_interface struct to enforce that only exactly one of
'match' and 'dummy' options are set.

Add test cases for 'interface' config option.
2012-12-05 12:58:07 +10:30
Andrew Bettison
c53789d764 Legacy 'interfaces' config option improvements
Legacy form is now incompatible with modern form.

Test case to check legacy parsing.
2012-12-04 18:22:26 +10:30
Andrew Bettison
93c38a764d Improve servald 'config' 'set' and 'del' commands
Return exit status 2 if the new config is invalid in any way.
2012-12-04 18:20:53 +10:30
Andrew Bettison
71ed78e058 Make all 'config' tests pass
Change a test case: configuration options are now case sensitive.

Fix config file load and parse logic in conf.c, always copy 'debug' flags
from config.debug.

The config schema 'interfaces' option is no longer MANDATORY.

Introduce new CLIFLAG_PERMISSIVE_CONFIG to supress bad-config ERROR messages
from the 'config set' and 'config get' commands.

Refactor cli_execute() into cli_parse() and cli_invoke().  Use *const* struct
command_line_option everywhere.
2012-12-04 16:52:49 +10:30
Jeremy Lakeman
5c7eb4a594 Add unicast probe packets
Probe directory service instead of assuming that it is always reachable
Fix directory service and routing tests
2012-12-04 14:47:57 +10:30
Jeremy Lakeman
2b21a691ca Merge remote-tracking branch 'origin/master' into packet_format
Conflicts:
	constants.h
	packetformats.c
2012-12-03 14:10:32 +10:30
gardners
7b4b9dbf81 improved test coverage for Rhizome over MDP, and made testing
of MDP vs HTTP more explicit for an existing test case.
2012-12-01 10:56:48 +10:30
gardners
21f562122e added test for rhizome over mdp for a big file, to make sure that
timeout handling works properly.
2012-11-30 22:57:34 +10:30
gardners
6c0e6ef1c2 added extra tests for Rhizome over HTTP and MDP transports.
HTTP transport works, MDP transport segfaults.  To be examined.
2012-11-30 17:42:17 +10:30
gardners
3c4abfb566 improved and simplified test for rhizome http not running 2012-11-30 15:06:31 +10:30
gardners
9e29db827f added test for correct function of rhizome.http.enable config
option.
2012-11-30 15:02:34 +10:30
Jeremy Lakeman
d5f78bcffe Rework reachable link flags for simpler bitmask tests 2012-11-30 14:38:09 +10:30
Jeremy Lakeman
e0878644fe Add command to dump routing table 2012-11-28 15:43:58 +10:30
Andrew Bettison
21a0f31ae4 Merge branch 'whacktmps' into 'master' 2012-11-15 13:41:45 +10:30
Jeremy Lakeman
10bde11918 Remove resolution of peer details from node info command 2012-11-14 12:17:41 +10:30
Jeremy Lakeman
dd93f201e3 Add separate reverse lookup command 2012-11-14 12:17:14 +10:30
Andrew Bettison
5751569b59 Rhizome extract manifest to '-' writes to output
Instead of specifying a file path, if the file is given as '-' then the content
of the manifest is output in the 'manifest' key-value pair instead of written
to a file.
2012-11-07 20:29:12 +10:30
Andrew Bettison
5185c944c9 JNI interface returns byte[] instead of String
This allows the output fields of any command to contain nul characters, which
paves the way for extracting a manifest or other binary data directly instead
of having to write it into a temporary file.
2012-11-07 17:12:04 +10:30
Andrew Bettison
548b837d2a Rhizome stress test: increase timeout from 3 to 10 minutes 2012-11-05 14:45:23 +10:30
Andrew Bettison
03f71dcccf Improve rhizome stress test
Generate test files from 2KiB to 32MiB in size, instead of all about 13 bytes
in size.  Guess what?  Found a bug!
2012-10-31 18:17:06 +10:30
Andrew Bettison
39fc4ce6de Issue #30, remove periodic Rhizome fetch alarm
Replace the main-loop scheduled periodic alarm with an "activate" alarm that is
scheduled whenever a fetch candidate is added to any queue, unless the alarm is
already scheduled.

Replace the "rhizome.fetch_interval_ms" config item with
"rhizome.fetch_delay_ms" [default 50], which is the number of milliseconds
between adding a fetch candidate and firing the "activate" alarm.  This allows
time for a few more Rhizome advertisment packets to arrive after the first one,
before deciding which fetches to start first.

Add new `is_scheduled()` alarm primitive.
2012-10-24 15:13:50 +10:30
Andrew Bettison
af1a6c4297 Split Rhizome stress test into separate file 2012-10-18 17:46:17 +10:30
Andrew Bettison
877f76557a Fix 'rhizomeprotocol' stress test 2012-10-18 17:29:58 +10:30
Andrew Bettison
1eeb040602 Improve new Rhizome stress test
Now it fails for the right reasons, and does not produce ERROR.
2012-10-18 11:51:10 +10:30
Andrew Bettison
381fc7cad8 Use finally() function in test suites
Mainly to call stop_all_servald_servers(), which asserts that the server is
still running and responding to orderly shutdown.
2012-10-18 11:46:32 +10:30
Andrew Bettison
7317f9b56c Add a new 'rhizomeprotocol' test case: stress test
Refactored some testdefs.sh and testdefs_rhizome.sh, not yet complete.
2012-10-17 18:10:39 +10:30
Andrew Bettison
c43a7ba8e6 Issue #17, improve "rhizome extract manifest" command
Add ".readonly" output field, add logic to detect bundle author and update
MANIFESTS table 'author' column accordingly.

Add two 'rhizomeops' test cases to deal with authorless logic.

Rename some 'rhizomeops' test cases for consistency and to help filtering.
2012-10-15 16:48:04 +10:30
Andrew Bettison
eff3e9ec8f Issue #17, fix new 'rhizomeops' test
Was incorrectly supplying bundle secret to "rhizome add" command.
2012-10-15 14:01:48 +10:30
Andrew Bettison
3f1f495d68 Issue #17, overhaul manifest author crypto logic
Add test case for new feature of the "rhizome add" command: if the author SID
is not specified (empty arg) then it searches the keyring for the author.

Removed "authorSid" argument from several functions that also take a struct
rhizome_manifest * arg, since the author, if known, is now supplied in the
struct.

Improve return value handling and refactored some rhizome crypto code.
2012-10-11 17:58:24 +10:30
Jeremy Lakeman
b22e3f1964 Add hop count to mdp ping
- Allow mdp client to specify ttl
- Copy ttl into and out of overlay frame
2012-10-10 16:22:31 +10:30
Andrew Bettison
3678522872 Issue #17, add AUTHOR column to Rhizome MANIFESTS table
Replace ".selfsigned" column with ".author" and ".fromhere" columns in
output of "rhizome list" command.  (Note that a "sender" column is
already present.)

Add 'author' field to struct rhizome_manifest.

Log all fully rendered SQL statements on DEBUG_RHIZOME.

Update 'rhizomeops' test cases and improve the assert_rhizome_list()
test function to be able to assert authorship of files.
2012-10-09 17:48:06 +10:30
Jeremy Lakeman
1f379ea209 Add and preserve QOS bit flags in packet header 2012-10-09 16:17:07 +10:30
Jeremy Lakeman
9842e22353 Add multi-hop routing test 2012-10-09 14:49:24 +10:30
Andrew Bettison
5a6a42f36d Improve test defs: extract_stdout_keyvalue()
The extract_stdout_keyvalue() function now accepts an optional delimiter
argument, to override its default of ':'.  This makes it useful for extracting
the output of "servald config get" commands.
2012-10-09 13:35:00 +10:30
Andrew Bettison
6954325b04 Server process no longer becomes a zombie on Android
Fixes #21.  The problem was caused when the double-fork logic used in "servald
start" was clobbered in 5103176.  This meant that the servald daemon process on
Android no longer had a PPID=1, but the PID of the long-lived
"org.servalproject" parent process which called the JNI entry point.  Killing
the servald process then caused it to become a zombie process, since the
org.servalproject does not habitually call wait(2).  That caused the "servald
stop" logic to send five SIGHUPs to the zombie without any error, making it
appear that the process was not dying.

Reinstated the double-fork logic and added a new test case to ensure that the
daemon process does not become a zombie on being killed prematurely.
2012-10-08 17:20:19 +10:30
Andrew Bettison
6e7805d9d5 Fix two 'dnahelper' tests broken by 62f8d223ea 2012-10-06 14:42:22 +09:30
Andrew Bettison
89343c69cd Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
Andrew Bettison
2e7d19a3f7 Issue #9, fix rhizome direct push and sync tests
The "rhizome direct push" command (and also sync) was not waiting for the
server's HTTP response, so it was exiting before the server had finished
storing the bundle, which led to a race with the subsequent "assert
bundle_received_by" test.  Fixed by adding the missing code to receive the HTTP
response.

Refactored the code used for parsing HTTP responses in rhizome_fetch.c, and
used it in rhizome_direct_http.c.
2012-10-04 17:38:33 +09:30
Andrew Bettison
e1cacdb687 Issue #9, improve 'rhizomeprotocol' tests
Rename Push, Pull, Sync to DirectPush, DirectPull, DirectSync.

Move HttpAdd test to just after HttpImport test.

Tighten up the assertions in Rhizome Direct test cases.

Factor the "assert_rhizome_list" test out of assert_received() to avoid having
to water down assert_rhizome_list(), which currently takes an exact list of all
files that must be present in the list, and is more valuable that way.
2012-10-04 14:25:08 +09:30
gardners
8aa18db913 ... and same fix for sync case, and that passes now as well.
All rhizomeprotocol tests now PASS with merged changes. #9
2012-10-03 18:17:12 +02:00
gardners
ab61ee698e switched rhizome direct push/pull/sync target from instance A to B
and made corresponding adjustments.  Oddly push and pull work again.
Maybe there is some subtle bug in the test framework?
Anyway, now to fix the sync test. #9
2012-10-03 18:15:09 +02:00
gardners
99f8e9b86d progress on tracking down post-merge bugs that are stopping
rhizome direct push/pull/sync tests from working. #9
2012-10-03 17:55:55 +02:00
gardners
4e0c0064ba added rhizome.api.addfile.author config option to supply author SID
as hex if not supplying a manifest template.
modified rhizomeprotocol test of manifest-less HTTP import to set
that option.  That test now passes.
ALL rhizomeprotocol tests now pass. #9
2012-10-03 16:24:06 +02:00
gardners
2e907e6fff fixed some bugs with rhizomeprotocol tests and manifest-less
file import. It now rungs in rhizomeprotocol test suite, but fails
because the BK= field is missing (but the file is imported).
Also removed the assertions about receiving bundles from the push
test as it was non-deterministic.  The bundle reception is already
tested, so there is no loss.
Investigating missing BK=.
Also test 8 (sync) fails post-merge, although push and pull work
intepdendently. Will investigate that post-merge. #9
2012-10-03 16:23:27 +02:00
gardners
dc3137707f rhizome import bundle from file sans-manifest via http now works.
Must be enabled by using rhizome.api.addfile.*
Certainly polishing to be done, including using filename supplied
during HTTP POST.  Now to fix that, and make it all work with
final rhizomeprotocol test case.
rhizomeprotocol test cases 8 and 9 currently fail post-merge. #9
2012-10-03 16:13:06 +02:00
gardners
40dff25814 test 8 (rhizome import via http post using curl) almost works
(something broken in merge of AB and PGS changes -- will investigate
once merge complete). #9
2012-10-03 15:55:49 +02:00
gardners
132cfd6fec Fixed bug in rhizome_store_file(), where it tried to open the
associated file before checking if it was already in the database.
Rhizome Direct can supply a manifest without associated file if
the file is already in the database, and so it was breaking.
Also removed "assert bundle_received_by"'s from rhizome direct
pull and sync tests because they are not needed, and were failing
because the same file contents was used for the files being
exchanged, and so file storage was not occurring, and thus the log
message being looked for was not being produced.
Push, pull and sync tests in rhizomeprotocol now pass, leaving
only two tests in error.  #9
2012-10-03 15:50:43 +02:00
gardners
7c544b25f2 applied similar fixes to rhizome direct pull and sync tests as
were recently made to rhizome direct push test. Now to implement
the rhizome direct http pull functionality so that they work... #9
2012-10-03 12:28:23 +02:00
gardners
1c72778c50 fixed problem with rhizome direct push / manifest import where
signatures were not being recorded.  Also fixed separate issue
where rhizomeprotocols tests expected selfsigned to be 1 on
receiver end, when it will never be, because the BK doesn't match.
rhizome direct push test in rhizomeprotocols now passes. #9
2012-10-03 12:28:23 +02:00
gardners
13679ecb23 Fixed bug in new rhizome direct sync command line parsing.
Now works from command line.
Updated rhizomeprotocol rhizome direct tests, but these still
fail -- under investigation. #9
2012-10-03 12:26:10 +02:00
gardners
d11109bca5 Improve rhizome direct push/pull/sync command line parsing and
use of configuration. Not yet finished, but allows multiple
rhizome direct peers and non-http URLs. #9
2012-10-03 12:24:22 +02:00
Andrew Bettison
bbe6d12693 Issue #9, fix 'rhizome direct push' command
Now the 'rhizomeprotocol' Push test case now passes.  It should be renamed to
DirectPush.

Much refactoring of the Rhizome Direct HTTP request parsing.  Now uses
strbuf_sprintf() instead of snprintf() in many places to check for buffer
overrun and ensure terminating nul.  Still more of this kind of work is needed.

Improved debug that needs to be made conditional on DEBUG_RHIZOME_RX and
DEBUG_RHIZOME_TX.  Some just needs removal.
2012-10-03 17:51:37 +09:30