Commit Graph

3342 Commits

Author SHA1 Message Date
Jeremy Lakeman
51ed6162dd Add support for running and stopping servald from a JVM thread
fdpoll will now run a callback when about to sleep / woke up.
A new Java interface to indicate server started / sleeping / waking up.
An android implementation may allow the CPU to sleep.
If there's a java exception the server will try to shutdown.
Calling servald stop is currently undefined.
2015-05-25 11:46:37 +09:30
Andrew Bettison
106f5d04d9 Fix 'msp' test failures: different netcat versions
The "traditional" variant of nc(1) ("netcat") (installed by default on
Debian and Ubuntu) behaves differently from the OpenBSD variant, causing
two 'msp' tests to fail.  Added -q options to nc(1) invocations to make
tests pass with either variant.
2015-05-18 17:20:01 +09:30
Andrew Bettison
f4df768041 Improve test framework: report stderr/stdout of execute within fork
So that if execute() is used within a forked process and if that process
is terminated prematurely, the log will show what the execute'd command
was doing
2015-05-18 17:17:29 +09:30
Andrew Bettison
c560374da5 Quieten some stderr ephemera in test logs 2015-05-18 17:15:18 +09:30
Jeremy Lakeman
d5e0835f21 Add explicit timeout parameter to mdp trace for slow links 2015-05-11 15:47:35 +09:30
Jeremy Lakeman
b75c926ee3 Relax ack timing 2015-05-11 15:47:35 +09:30
Andrew Bettison
30f4a398ea Merge RESTful Rhizome journal append into development
Support for appending to Rhizome journals using the RESTful API
2015-04-13 16:59:06 +09:30
Andrew Bettison
979854ae0b Test that Rhizome RESTful append rejects non-journals 2015-04-13 16:24:05 +09:30
Andrew Bettison
5120e50dd7 Suppress Rhizome add de-duplication for journals 2015-04-13 16:24:05 +09:30
Andrew Bettison
0f8141af95 Test RESTful Rhizome journal append with shared payload
When an append produces a payload that is already in the store,
the append must succeed, and the returned status codes should
indicate that the payload already existed
2015-04-13 16:24:05 +09:30
Andrew Bettison
53e4e5be5f Improve 'rhizomerestful' journal append test case
Add asserts for the returned status codes
2015-04-13 14:43:52 +09:30
Andrew Bettison
f602674ea5 RESTful Rhizome add/insert always return HTTP 201
The 200 status is reserved to indicate a well-formed and
legal request but the bundle was not added because the
store rejected it.
2015-04-13 14:39:51 +09:30
Andrew Bettison
7734e24006 /restful/rhizome/append on existing journal
Refactor Rhizome insert/append logic into functions used by both CLI and
RESTful API.  Improve RESTful diagnostic messages.
2015-03-30 18:24:12 +10:30
Andrew Bettison
214dad421b Rename 'rhizomerestful' journal test cases 2015-03-30 18:21:31 +10:30
Andrew Bettison
86c3c7312c Better support for Rhizome logging status enums
Provide functions that return non-NULL even on invalid enum
values
2015-03-30 18:19:26 +10:30
Andrew Bettison
dbe0cf862f Remove 'debug.manifests' option
Use existing 'debug.rhizome_manifest' instead
Improve format of manifest alloc/free log messages
2015-03-30 18:19:26 +10:30
Jeremy Lakeman
fea91f3f82 Use configured reachable timeout for network links, read dummy files even when not ticking 2015-03-30 17:38:40 +10:30
Jeremy Lakeman
943bca3bea Add transmit timeout config per network destination for low bandwidth links 2015-03-30 14:15:08 +10:30
Jeremy Lakeman
e680ccb0ec Update test_cli to match recent config changes 2015-03-30 13:50:23 +10:30
Jeremy Lakeman
13bb8a558d Re-route packets on retransmision if the route has changed 2015-03-30 11:27:37 +10:30
Andrew Bettison
99ff49d502 /restful/rhizome/insert reject out-of-order parameters
Must have the 'bundle-secret', 'bundle-author' and 'bundle-id'
parameters before the 'manifest' part
2015-03-28 05:09:38 +10:30
Andrew Bettison
ccf4824605 Add 'manifest-id' parameter to /restful/rhizome/insert 2015-03-28 05:09:38 +10:30
Andrew Bettison
da22816784 Add 'rhizome add file --bundle=BID' option
A convenience to re-use an existing manifest, instead of having
to extract the manifest, erase some fields, then pass the result
back into the 'rhizome add file' command
2015-03-28 05:09:38 +10:30
Andrew Bettison
b17848a438 Improve 'rhizomeops' test fixtures
Use extract_stdout_manifestid() instead of extract_stdout_keyvalue()
2015-03-28 05:09:37 +10:30
Andrew Bettison
dbea301ce2 Rhizome test defs support 'tail' field 2015-03-28 05:09:37 +10:30
Andrew Bettison
7f564e4dcf Make strn_to_xxx() functions consistent
All strn_to_xxx() functions should take a 'size_t len' parameter

All functions that take a 'const char **endp' parameter should
be named parse_xxx(), and should also have a 'ssize_t len' parameter
which can be -1 to indicate a null-terminated string
2015-03-28 04:53:09 +10:30
Andrew Bettison
5c933cc5b3 Add cli_optional_bid() 2015-03-28 04:39:53 +10:30
Andrew Bettison
59b1c08e52 Rename cli_manifestid() to cli_bid() 2015-03-28 04:39:37 +10:30
Andrew Bettison
adc050a8cb Add API comment to cli_arg() in "cli.h" 2015-03-28 04:37:38 +10:30
Andrew Bettison
987ec00183 Improve 'rhizomeops' test speed
Only create the identities needed, not five in every test
2015-03-25 00:55:37 +10:30
Andrew Bettison
16355df04b Fix failing 'rhizomejava' test
Handle missing payload-status headers in Java test client
2015-03-23 23:26:09 +10:30
Andrew Bettison
705dbeff09 Fix bug in rhizome_write_open_journal()
Was treating PAYLOAD_STATUS_NEW as an error
2015-03-23 17:40:08 +10:30
Andrew Bettison
015b4a0b07 Refactor and improve "journal append"
Distinguish between fatal and user-supplied-input errors, return
error descriptive text in a strbuf to allow dynamic content, apply
user-supplied field assgnments/deletions _after_ copying existing
manifest fields, use exit status 4 (invalid manifest) when applying
journal append to a non-journal or vice versa
2015-03-23 17:38:46 +10:30
Andrew Bettison
73a4191547 Improve manifest field copy/unset logging
Add __whence arguments to all field copy and unset functions
2015-03-23 17:32:57 +10:30
Andrew Bettison
5b7cfb8afb crypto_sign_compute_public_key() return void not int
It can never fail, so no need to check return value for -1
2015-03-23 17:31:06 +10:30
Jeremy Lakeman
b048e8874f Reschedule alarm when tick_ms config changed 2015-03-23 13:35:22 +10:30
Jeremy Lakeman
f7dbe06836 Rearrange interface config to support unicast settings 2015-03-23 13:35:22 +10:30
Andrew Bettison
655b94eb3c Fix failing 'rhizomeops' tests 2015-03-19 03:21:27 +10:30
Andrew Bettison
19119e759c Refactor "rhizome add file" and "rhizome journal append"
Put manifest creation logic into new rhizome_bundle_add_file()
function, in preparation for implementing new HTTP POST
/restful/rhizome/append request

Several 'rhizomeops' tests fail
2015-03-16 22:44:15 +10:30
Andrew Bettison
67a6e1b9b6 Add debug logging to rhizome_write_open_journal() 2015-03-16 22:41:52 +10:30
Andrew Bettison
3ee42021cb Block comment for rhizome_add_manifest() 2015-03-16 22:41:21 +10:30
Andrew Bettison
217fc7cde9 Improve diagnostic logging and HTTP responses 2015-03-16 22:40:46 +10:30
Andrew Bettison
4d5cded047 Change return type of rhizome_fill_manifest()
To help improve diagnostic feedback through APIs
2015-03-16 22:40:08 +10:30
Andrew Bettison
016bb32b89 Add rhizome_manifest_overwrite() function 2015-03-16 22:36:38 +10:30
Andrew Bettison
72345a3b2f Add alloca_sprintf() macro 2015-03-16 22:33:42 +10:30
Andrew Bettison
00037cf803 Change return type of strbuf_sprintf() 2015-03-16 22:33:11 +10:30
Andrew Bettison
c9131f43a2 POST /restful/rhizome/append for journals 2015-03-02 18:52:12 +10:30
Andrew Bettison
4b234fbfbd Fix /restful/rhizome/insert HTTP status code
Return 403 "Forbidden" instead of 501 "Not implemented" when
given a journal bundle
2015-03-02 18:49:51 +10:30
Andrew Bettison
d44d18280a Rhizome test: cannot use "add file" to create a journal 2015-03-02 18:49:51 +10:30
Andrew Bettison
b2919a3a5e Rhizome test: cannot use "add file" to update a journal
Journal bundles can only be modified using "journal append"
2015-03-02 18:49:51 +10:30