Commit Graph

461 Commits

Author SHA1 Message Date
Jeremy Lakeman
37ef97268b Disable rhizome when testing dnahelper to reduce IO load 2013-05-29 11:58:06 +09:30
Jeremy Lakeman
aa75e519f3 Rename 2-hop test 2013-05-29 11:58:06 +09:30
Jeremy Lakeman
8f575262ff Reduce packet storm to reduce I/O required for running tests 2013-05-29 11:58:06 +09:30
Jeremy Lakeman
8ab5073869 Adjust packet format for better duplicate detection 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
02be4c2979 Add support for retransmitting broadcast mdp packets 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
a213872f09 Don't ack if we aren't being used in a route 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
5b4e4919cf Mark resent packets so they can be dropped 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
e519633f7a Resend last ACK if it is explicitly NACKed 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
e5856225cf Add packet retransmissions due to missed ack's 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
b10746b3a5 Add stub functions for retransmission / throttling 2013-05-29 11:58:04 +09:30
Jeremy Lakeman
abfe6963d2 Wait for servald daemon to enter main loop for more reliable tests 2013-05-27 14:24:33 +09:30
Jeremy Lakeman
118dcca40b Improve quality and readability of some routing tests 2013-05-10 12:05:28 +09:30
Jeremy Lakeman
ef1e93bf52 Establish neighbour links with nodes running our legacy routing engine 2013-05-09 16:57:33 +09:30
Jeremy Lakeman
a59b306173 Allow for out of order packets, reduce link state spam 2013-05-08 11:37:31 +09:30
Jeremy Lakeman
c0b31a2774 Report packet acks, make routing decisions based on dropped packets 2013-05-08 11:37:02 +09:30
Jeremy Lakeman
a29c1d3468 Don't override subscriber interface due to unicast probe packets 2013-05-02 14:29:31 +09:30
Jeremy Lakeman
dd03014b44 Choose the best link from a neighbour 2013-05-02 14:29:31 +09:30
Jeremy Lakeman
9ee09e36a0 Replace old routing engine with new link state engine 2013-05-02 14:29:28 +09:30
Andrew Bettison
4e48725c93 Merge branch 'new-keyring' into 'development' 2013-04-30 17:57:59 +09:30
Andrew Bettison
cf26a77019 Use "keyring dump" command in back-compatible keyring test 2013-04-30 17:56:10 +09:30
Andrew Bettison
deed4665fe Fix keyring test copyright and header comments 2013-04-29 17:38:01 +09:30
Jeremy Lakeman
559b270966 Only compare routes that have all links via the same neighbour 2013-04-29 17:07:36 +09:30
Andrew Bettison
78b3a3a8c4 Add keyring test case (combined PINs) 2013-04-29 16:00:17 +09:30
Andrew Bettison
ae69da284f Add keyring back-compatibility test case 2013-04-29 15:11:04 +09:30
Andrew Bettison
6fd49099cb Rewrite keyring pack/unpack for extensibility
Use new rotbuf primitives to handle rotated buffers
2013-04-29 14:31:50 +09:30
Jeremy Lakeman
d7caaf4973 Add length of link record for forward compatibility 2013-04-29 10:06:22 +09:30
Jeremy Lakeman
85b885dde2 Add basic link state routing 2013-04-26 16:54:01 +09:30
Andrew Bettison
121ae2d609 Improve timeout control in routing tests 2013-04-22 16:01:38 +09:30
Andrew Bettison
81af4460f3 Fix broken "ping" command arg parsing 2013-04-12 17:18:25 +09:30
Jeremy Lakeman
73342a9659 Announce routes to secondary keyring entries 2013-04-08 10:03:51 +09:30
Andrew Bettison
2c379fadb1 Merge branch 'naf2-logging' into 'development'
Conflicts:
	commandline.c
	tests/rhizomeprotocol
2013-04-05 17:39:23 +10:30
Andrew Bettison
ec481e5f0f Rename config option 'log.stderr' to 'log.console'
Because Android <stdio.h> defines 'stderr' as a macro...
2013-04-05 16:55:14 +10:30
Andrew Bettison
f7fc63c452 Improve logging tests, fix failures, add 'log.file.path' config option 2013-04-05 16:23:20 +10:30
Andrew Bettison
f06613c35f Fix test failures from latest logging changes 2013-04-05 15:28:54 +10:30
Andrew Bettison
21991726ae Add logging tests, add "log" command
Refactor log.c ready for log file rotation
2013-04-02 17:01:48 +10:30
Andrew Bettison
0f83b9a5fc Fix #60 - "rhizome direct" command line URL
Add test case for "rhizome push <url>" command
2013-04-02 14:54:46 +10:30
Andrew Bettison
95b0c028f2 Log to file, Android and stderr simultaneously
Indepent configuration of show_pid, show_time and log level for each
destination

Update test scripts for new config options

Include xprintf.c in MDP client source files (now used by log.c)
2013-03-27 16:17:38 +10:30
gardners
3a0a4df216 add place-holder tests for adding channel labels to Rhizome. #58 2013-03-18 13:27:15 +10:30
Andrew Bettison
5dd6a53615 Fix 'rhizomeops' tests
Rename duplicate AddNoAuthor test to AddNoAuthorEncrypted

Fix broken AddNoAuthor test

Add new AddInvalidAuthor test
2013-03-15 15:58:17 +10:30
Andrew Bettison
bc7c58ee3c Improve keyring test case 2013-03-06 15:29:27 +10:30
Andrew Bettison
03f38d2031 Improve keyring debugging 2013-03-06 14:15:27 +10:30
Jeremy Lakeman
4cdd3da77f Add config option to disable fetching via rhizome 2013-03-05 10:56:20 +10:30
Jeremy Lakeman
9e2eb1aea4 Add keyring test for implicitly created identity 2013-02-28 16:27:53 +10:30
Jeremy Lakeman
ee95e47d1f Add rhizome export commands that don't try to decrypt file contents
export [bundle/manifest/file]
extract [bundle/file]

"dump file" has been replaced with "export file".
2013-02-27 11:39:23 +10:30
Jeremy Lakeman
b20e714ffb Test that changing config.rhizome.external_blobs still allows existing blobs to be read (FAILs) 2013-02-22 13:37:01 +10:30
Jeremy Lakeman
90386ce1b1 Merge remote-tracking branch 'origin/development' into serial
Conflicts:
	rhizome.h
	rhizome_database.c
	rhizome_fetch.c
	rhizome_store.c
2013-02-20 17:23:03 +10:30
Jeremy Lakeman
73786bcb5d Refactor all rhizome reading and writing
- The API in rhizome_store.c is used for all reading and writing
- external storage is now usable for all transport options
2013-02-20 16:18:59 +10:30
Jeremy Lakeman
e5fa357f07 Add slip test to automated testing 2013-02-20 16:18:59 +10:30
gardners
944486c048 simplify external/internal blob storage to a boolean flag instead
of a threshold.
2013-02-20 16:18:59 +10:30
Jeremy Lakeman
bb8b3d6376 Add new mdp trace command 2013-02-20 16:18:58 +10:30
gardners
a23612428b make rhizome over mdp block size configurable.
1K seems too big to be reliable on our prototype UHF radio links,
as CRCs fail almost all the time. #48
2013-02-20 16:18:57 +10:30
gardners
57013c3a03 removed temporary verbose output from test. 2013-02-20 16:18:57 +10:30
Andrew Bettison
390655580d Add 'rhizome delete' and 'rhizome clean' commands
sqlite_void_exec() and its ilk now return the count of changed rows, not
just zero, on success

sqlite_exec_prepared() and its ilk now return the count of rows (number
of step results SQLITE_ROW), instead of just zero, on success

rhizome_clean() function now produces an optional report of its changes

rhizome_fail_write() and rhizome_finish_write() now log WARNings not
ERRORs if the SQL DELETE FROM FILES or DELETE FROM FILEBLOBS statements
fail

Refactor rhizome_open_read() to use sqlite_exec_int64()

Ensure that 'rhizome extract' and 'rhizome dump' commands return exit
status of 1 in "not found" conditions, not 255, which is reserved for
errors

Test cases for four new commands: 'rhizome delete bundle', 'rhizome
delete manifest', 'rhizome delete payload' and 'rhizome delete file'
(no test case for 'rhizome clean' yet)
2013-02-20 15:37:09 +10:30
gardners
641d749ab4 Create files for large rhizome bundles
- configurable size threashold
2013-02-20 15:36:32 +10:30
Jeremy Lakeman
6d9bbe2e2c Refactor interface handling to separate encapsulation from stream type 2013-02-20 15:36:23 +10:30
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
Andrew Bettison
ebf2aa83ac Issue #9, re-order 'rhizomeprotocol' HttpImport test 2012-10-02 17:16:44 +09:30
Andrew Bettison
5fed0460e1 Issue #9, 'rhizomeprotocol' HttpImport test now passes
Any HTTP client can import a bundle into Rhizome using a PUSH request.
2012-10-02 17:15:14 +09:30
Andrew Bettison
4379be5c50 Issue #9, improve rhizome HttpImport test
Disable any inherited HTTP proxy settings that could interfere with curl(1).

Better invocation of curl(1) to fail on error response.
2012-09-28 17:50:49 +09:30
Andrew Bettison
d26c3f67e8 Fix broken 'dnaprotocol' tests
Explicitly create identities in 'dnaprotocol' fixtures because
start_servald_instances() no longer does it.

The create_single_identity() function was not setting NAMEA, NAMEB, etc.  when
they contained a space, because of shell misquoting.
(cherry picked from commit 9d8707a0ad)
2012-09-28 12:16:55 +09:30
Andrew Bettison
c2b515347f Improve testdefs: foreach_instance() function
Cherry picked from commit 87133cb2de, conflicts
in tests/rhizomeprotocol resolved by hand: bundle_received_by() now takes two
args before list of instances.

The 'rhizomeprotocol' tests now use create_single_identity() in fixtures (which
tests the 'keyring list' command).

Use foreach_instance() function in various places, and replace functions that
used to loop over instances with functions that work on the current instance.
2012-09-28 12:15:10 +09:30
Andrew Bettison
5b8194eae0 Refactor test definitions
Cherry picked from commit e994626429, conflicts
in testdefs.sh resolved manually (start_servald_instances() sets DUMMYx
variable).

Move create_rhizome_identities() from testdefs_rhizome.sh to
create_identities() in testdefs.sh

Rename create_identity() in testdefs.sh to create_single_identity(), uses
create_identities() to do its work.
2012-09-28 12:05:22 +09:30
Andrew Bettison
14721fab19 Merge branch 'solaris' into rhizomedirect
All test cases pass on Solaris (see issue #16) except the 'jni' tests because
there is no Java compiler available on Solaris, and the new 'rhizomeprotocol'
tests from the rhizomedirect branch, which have always failed.
2012-09-27 17:38:16 +09:30
Andrew Bettison
b91fc4e5b5 Refactor some 'rhizomeprotocol' tests
Replace explicit inline binary data from HttpImport test, so that Git stops
thinking the shell script is a binary file.

Put curl(1) detection into common fixture function.
2012-09-27 17:36:22 +09:30
Andrew Bettison
b44053a480 Issue #16, fix 'dnaprotocol' tests broken on Solaris
Same problem that broke most of the 'dnahelper' test fixtures; the dnahelper
script was using #!/bin/sh, which on Solaris is not Bash.
2012-09-27 16:50:29 +09:30
Andrew Bettison
ca6d8f487d Fix broken 'rhizomeprotocol' tests on Solaris 2012-09-27 15:14:43 +09:30
Jeremy Lakeman
222cb80ce7 Modify lookup uri format to distinguish between serval identities and gateway services 2012-09-21 15:17:56 +09:30
Jeremy Lakeman
2fa5fbfee7 Publish and retrieve multiple entries for the same phone number 2012-09-20 16:21:18 +09:30
Jeremy Lakeman
bae1ab310c Add multi-hop, default route test 2012-09-19 09:54:41 +09:30
Jeremy Lakeman
7c73ca7a78 Finish test and implementation of directory service 2012-09-18 12:30:15 +09:30
Andrew Bettison
9d8707a0ad Fix broken 'dnaprotocol' tests
Explicitly create identities in 'dnaprotocol' fixtures because
start_servald_instances() no longer does it.

The create_single_identity() function was not setting NAMEA, NAMEB, etc.  when
they contained a space, because of shell misquoting.
2012-09-17 15:30:05 +09:30
Andrew Bettison
87133cb2de Improve testdefs: foreach_instance() function
The 'rhizomeprotocol' tests now use create_single_identity() in fixtures (which
tests the 'keyring list' command).

Use foreach_instance() function in various places, and replace functions that
used to loop over instances with functions that work on the current instance.
2012-09-14 16:09:28 +09:30
Andrew Bettison
e994626429 Refactor test definitions
Move create_rhizome_identities() from testdefs_rhizome.sh to
create_identities() in testdefs.sh

Rename create_identity() in testdefs.sh to create_single_identity(), uses
create_identities() to do its work.
2012-09-14 15:04:05 +09:30
Andrew Bettison
1f4688db99 #16 Fix 'rhizomeops' tests that fail on Solaris 2012-09-13 14:08:52 +09:30
Daniel O'Connor
f8d5b066c0 Create #! line correctly (no need to escape !).
Many more tests pass now.
2012-09-07 15:42:20 +09:30
Daniel O'Connor
7a06f55078 SHELL is not set by the shell, use BASH which is set by bash. 2012-09-06 17:19:51 +09:30
Daniel O'Connor
bc6681f4d7 Use $SHELL instead of hardcoding /bin/bash in the dnahelper. 2012-09-06 16:37:41 +09:30
gardners
5aa4c8bb82 added rhizome import via http post test. #9 2012-09-06 16:29:39 +09:30
Andrew Bettison
420add0f4b Merge branch 'master' into rhizomedirect 2012-08-30 09:38:19 +09:30
Andrew Bettison
9149c80297 Improve test framework: assert '!' command...
The assert command now supports leading '!' args in its command, each negating
the sense of the following command.
2012-08-30 09:33:15 +09:30
Andrew Bettison
b3f9e437b3 Issue #9, add test case for local HTTP add 2012-08-27 17:57:41 +09:30
Andrew Bettison
f93e32b4bc Add 'rhizomeprotocol' tests for push, pull, sync
See issue #9.

These commands are not yet implemented, so of course the new
tests fail.
2012-08-27 16:29:46 +09:30
Andrew Bettison
836a6d9b6a Issue #5, fix one failing test, two to go
On Max OS X, /bin/sh does not support echo -n option, but /bin/bash does
2012-08-24 18:40:30 +09:30
Andrew Bettison
eec8fb6e95 Improve SAS resolution debug messages 2012-08-14 14:06:59 +09:30
Andrew Bettison
ec4384ae7d Fix failing 'dnahelper' test case 2012-08-09 12:21:40 +09:30
Andrew Bettison
b7fa83624d Split up dnaprotocol tests for speed 2012-08-06 16:45:07 +09:30
Andrew Bettison
0022990e72 Add new dnaprotocol test
Dnahelpers on many nodes resolve the same DIDs

Currently fails, suspicious error from overlay_mdp_sanitytest_sourceaddr()
2012-08-02 17:18:04 +09:30
Andrew Bettison
29bf23d7ac Add dnahelper test: dna.helper.argv.1 config option 2012-08-02 17:11:36 +09:30
Andrew Bettison
32704bf0e9 Improve 'dnaprotocol' test script
Replace hard-coded identity names and DIDs with shell variables
2012-08-02 15:46:53 +09:30
Andrew Bettison
cd168ac368 Improve dnaprotocol tests: enable logging in commands 2012-07-31 17:47:59 +09:30
Andrew Bettison
bb97a80452 Minor improvements to 'dnaproctocol' tests 2012-07-27 18:04:46 +09:30
Andrew Bettison
e9abed6efb Remove redundant logging from 'dnaprotocol' tests 2012-07-25 18:04:45 +09:30
Andrew Bettison
04b95d2590 Merge branch 'andrew' into 'master' 2012-07-25 18:04:16 +09:30
Andrew Bettison
f2ddc00797 Fix SEGV bug in new overlay abbreviation code 2012-07-25 17:45:57 +09:30
Andrew Bettison
d8fc9bd3c2 Fix DEBUG_OVERLAYEBBREVIATIONS from fprintf(stderr) to DEBUGF() 2012-07-25 17:43:44 +09:30
Andrew Bettison
c545061b50 Add server.respawn_on_signal config option 2012-07-25 17:02:57 +09:30
Andrew Bettison
54da59bc56 Fix DNA helper so all tests pass
Added a couple more 'dnahelper' tests for timeout conditions
and spurious output
2012-07-24 11:29:07 +09:30
Andrew Bettison
f472ac9a8d Lots of 'dnahelper' tests, all pass but one
Test fails because DNA helper logic does not yet impose a timeout on receiving
the "DONE" ACK after a request.
2012-07-23 18:29:57 +09:30
Andrew Bettison
30567c1d34 Start writing systematic 'dnahelper' tests 2012-07-23 12:23:17 +09:30
Andrew Bettison
0e5c5e0e98 More work on dnahelper, almost done
Servald starts DNA helper, receives startup ACK, sends requests, receives
responses, handles malformed helper responses, echoes dnahelper stderr lines to
log, sends MDP reply packet, waits for dead helper process, all asynchronously.
Shuts down helper process during servald shutdown.

Remaining issues:
 - Does not impose a timeout on helper responses.
 - Only the first URI is reported by the "dna lookup" command.
2012-07-20 18:17:43 +09:30
Andrew Bettison
3b44bb6e58 More progress on dnahelper 2012-07-19 17:59:45 +09:30