Commit Graph

673 Commits

Author SHA1 Message Date
Andrew Bettison
43bd0bd33f Fix a failing keyring test
The in-memory identity creation test was failing intermittently because
the server only creates the in-memory identity on the first tick, and
under load the server sometimes does not tick for a while, leading to a
race with the "servald id self" command.

The test case now waits for the server to emit a tick before running the
"id self" command.  This necessitated a new DEBUG() statement and a new
debug flag 'overlaytick'.

Also disabled Rhizome for all the keyring tests, as unnecessary Rhizome
DB creation was slowing down the fixtures.
2016-09-06 15:00:21 +09:30
Andrew Bettison
2cfdafdb56 Add some MDP client DEBUG trace statements 2016-09-06 13:31:38 +09:30
Andrew Bettison
7f0fef2209 Fix an intermittent server test failure
The quit-on-monitor-client-disconnect test was non-deterministic
depending on load (eg, other concurrently running tests).  Under load,
it was likely that the server did not process the "monitor quit" command
before checking for disconnect, so the server did not terminate.

The fix was to make the monitor interface read and process all queued
input from the client before checking for HUP or ERR condition on the
socket.  With this fix, the "sleep 1" kludges before and after the echo
"monitor quit" to the console command are no longer needed.

In the process the monitor interface code was modernised: eg, now it
calls read_nonblock() instead of read(2).
2016-09-06 12:33:29 +09:30
Jeremy Lakeman
67b9aeeb4e Add simple meshmb find command 2016-08-29 11:06:53 +09:30
Jeremy Lakeman
e13b9c3c94 Reduce redundant reading of message ply's 2016-08-23 14:28:13 +09:30
Jeremy Lakeman
b2eb3a2199 Begin broadcast messaging service 2016-08-16 15:04:15 +09:30
Jeremy Lakeman
b6256ea89a Add identity_t type & rename signing key api to identity. 2016-08-16 12:22:13 +09:30
Jeremy Lakeman
c5d6579397 Add cli option to include text of last received message 2016-08-10 11:20:12 +09:30
Jeremy Lakeman
83b6ecb453 Roll an in memory identity when the keyring is empty 2016-08-02 11:01:32 +09:30
Jeremy Lakeman
dbded493c1 Refactor meshms ply handling into separate source file 2016-07-25 16:54:11 +09:30
Jeremy Lakeman
9f4f56b663 Add Java api to add identity with name and number 2016-06-07 12:30:42 +09:30
Jeremy Lakeman
ce2131870c Fix rhizome op test that used recipient field 2016-05-31 13:05:06 +09:30
Jeremy Lakeman
d9e89fd299 Add meshms restful stress test 2016-05-31 12:53:37 +09:30
Jeremy Lakeman
16a14269af Encrypt payloads without needing a sender
- reworked keyring identity handling to reduce memory searching
2016-05-31 12:50:32 +09:30
Jeremy Lakeman
89ab832c21 Link multiple versions of a journal payload to the same file 2016-05-24 14:47:49 +09:30
Jeremy Lakeman
dced3bbb91 Avoid 1 second delay in tests when using curl to post forms 2016-05-18 12:11:58 +09:30
Jeremy Lakeman
b55926b081 Add configuration for idle_tick_ms so tests can complete faster without wasting power 2016-05-10 11:19:49 +09:30
Jeremy Lakeman
6feaddf24d Rework route print command to use newer mdp api, show live updates & deprecate monitor messages 2016-05-10 10:28:14 +09:30
Jeremy Lakeman
6cedb2d0ac Cleanup sync state when complete, or peers move out of range 2016-05-09 11:10:50 +09:30
Jeremy Lakeman
c5957e9c85 Transfer bundles via msp, triggered by key sync 2016-05-09 11:10:50 +09:30
Jeremy Lakeman
6b7aa800e4 Start syncing rhizome based on manifest hashes 2016-05-09 11:10:50 +09:30
Jeremy Lakeman
7939a780fb Fix case where eof mime boundary overlaps buffer boundary 2016-04-11 13:10:37 +09:30
Jeremy Lakeman
2241a15e48 Use file locking to better detect if the server really is running 2016-04-06 14:57:30 +09:30
Jeremy Lakeman
5636edfe20 Append manifest into zip file comment 2016-03-30 16:25:43 +10:30
Jeremy Lakeman
9feffb89c0 Add test for missing file 2016-03-08 14:59:13 +10:30
Jeremy Lakeman
b5afcf9a8f Fix vomp stun test after route print change 2016-03-07 16:11:27 +10:30
Jeremy Lakeman
c1947cf774 Add prior hop SID to route print output 2016-03-02 10:51:16 +10:30
Andrew Bettison
fa4fd02fbd Fix MSP test case after switching to nc6 2016-02-15 18:41:54 +10:30
Andrew Bettison
3e4470bf4a Use nc6 in MSP tests instead of nc
On OS-X (BSD), nc6 appears to be the only available variant of
netcat that matches the Linux version.

Introduces a guard function to catch invocations of nc6 when
setup_netcat6 has not been called in the fixture.  Introduce
guard functions to prevent invocations of nc and netcat.
2016-02-15 18:41:54 +10:30
Jeremy Lakeman
3b88b50d01 Make sure the test is performed on the correct serval instance 2016-02-01 15:05:27 +10:30
Jeremy Lakeman
389f16d2bb Establish a unicast link to a configured host on demand 2016-01-27 16:27:47 +10:30
Jeremy Lakeman
d0da910b19 Avoid undefined behaviour as highlighted by clang 2016-01-27 16:27:47 +10:30
Andrew Bettison
0361b99ca7 Fix OSX bugs in test framework
Use GNU grep, sed and awk instead of BSD variants.  Developers will have
to install these using a package manager like homebrew.  Updated the
INSTALL.md and doc/Development.md tech docs with instructions.
2016-01-27 00:24:43 +10:30
Jeremy Lakeman
75523b7f3c Don't talk about SID's that don't match the whole abbreviation 2016-01-12 10:29:46 +10:30
Jeremy Lakeman
912806360c Tweak netlink setup code in an attempt to prevent gcc mis-optimization 2016-01-11 14:40:23 +10:30
Jeremy Lakeman
77162fbaec Improve config overflow message 2015-12-14 10:31:38 +10:30
Andrew Bettison
3f8f0f6fc7 Improve Rhizome HTTP API diagnostics
Add RHIZOME_BUNDLE_STATUS_MANIFEST_TOO_BIG enum option to indicate
that the manifest exceeded 8 KiB in size.

Refactor rhizome_add_manifest() and rhizome_manifest_finalise()
to return 'struct rhizome_bundle_result' instead of 'enum
rhizome_bundle_status', so that that their detailed failure messages
can reach the HTTP API layer instead of just being logged.

Fix HTTP response status codes produced Rhizome direct HTTP requests
to be consistent with the Rhizome RESTful API.
2015-12-07 22:35:42 +10:30
Andrew Bettison
39460947f1 Add 'rhizomeall' test script
Runs all Rhizome test cases.
2015-12-01 00:51:15 +10:30
Andrew Bettison
fd50a34fc8 Add minor safety check to a Rhizome test case
Ensure that two generated test files are different instead of just
assuming they are; makes the test logic more explicit.
2015-12-01 00:51:15 +10:30
Andrew Bettison
98ed0406c5 Refactor Rhizome result handling
- Introduce the new 'struct rhizome_bundle_result' that contains a
  rhizome_bundle_status enum value and an optional, nul-terminated
  string that provides an explanation of the cause of the status; add
  functions to construct, query, and free the struct

- Replace 'enum rhizome_add_result' with 'struct rhizome_bundle_result',
  removing an unnecessary level of enum interpretation

- Make rhizome_fill_manifest() return 'struct rhizome_bundle_result' and
  add logic to check that the supplied author SID is correct (previous
  behaviour was: if an incorrect author SID was supplied but the correct
  author could be found in the keyring, then the incorrect one was
  silently ignored)

- Simplify the response code in rhizome_restful.cc to take advantage of
  the new 'struct rhizome_bundle_result'; in particular, the mapping
  from 'enum rhizome_bundle_status' codes to HTTP status codes is now
  expressed in a single switch statement

- Fix some minor failures in test scripts revealed by the changes
2015-12-01 00:51:15 +10:30
Jeremy Lakeman
2ddbb86cb5 Don't ask for explanation of SIDs with dead routing links 2015-11-16 14:09:35 +10:30
Andrew Bettison
419364b5a9 Improve REST HTTP response status codes
List all the HTTP status codes in the REST API tech doc.

Only use 403 Forbidden for requests originating from a disallowed
origin (ie, not localhost).

- Return 400 for missing, unknown, duplicate and out-of-order form
  parts in POST requests.
- Return 415 Unsupported Media Type for unsupported form part
  Content-Disposition and Content-Type (including unsupported
  charset).
- Return 414 Request-URI Too Long for any buffer exhaustion while
  parsing request.
- Return 419 Authentication Timeout for missing crypto secret.
2015-11-02 12:26:40 +10:30
Andrew Bettison
4564e955e3 Improve HTTP Origin response headers
Re-introduce "Origin: null" handling, because actually it is in the
spec.
2015-11-02 11:58:24 +10:30
Andrew Bettison
404cc1476d Improve HTTP Origin header parsing
Parses the separate parts of the URI: scheme, hostname, port.
No longer supports "Origin: null", because that is not in the
spec.
2015-10-01 07:05:17 +09:30
Andrew Bettison
6123503c15 Improve Rhizome HTTP status codes
Also improve some reason phrases and test them
2015-09-21 18:43:24 +09:30
Andrew Bettison
7635e6b71b Add Keyring Java API (incomplete) with tests
keyringListIdentities()
keyringSetDidName()
2015-08-31 19:16:30 +09:30
Andrew Bettison
714ea63190 Change JSON response of GET HTTP /restful/keyring/...
Return "sid", "did" and "name" fields inside their own "identity"
object
2015-08-31 19:16:30 +09:30
Andrew Bettison
e956749727 Move utility functions from 'rhizomejava' test to testdefs_java.sh 2015-08-31 19:16:30 +09:30
Andrew Bettison
8ba612ffa1 HTTP GET /restful/keyring/set[?pin=PIN][&did=DID][&name=Name] 2015-08-24 22:54:45 +09:30
Andrew Bettison
8834a81575 Refactor HTTP GET /restful/keyring/add 2015-08-24 22:44:24 +09:30