Commit Graph

461 Commits

Author SHA1 Message Date
Jeremy Lakeman
348fc5f23b Fix meshms conversations parsing when looking for a single SID 2014-02-12 15:08:24 +10:30
Jeremy Lakeman
99fb8b6108 Move jni interface classes from batphone repo 2014-02-12 13:09:17 +10:30
Andrew Bettison
0769fa54e8 Improve MeshMS RESTful HTTP failure reporting
Add "meshms_status_code" element to simple JSON responses
2014-02-07 16:28:40 +10:30
Andrew Bettison
5dd9ea7a6b Improve MeshMS failure handling
Introduce "enum meshms_status" to replace int -1,0,1 for return values
from MeshMS internal functions

Add test cases to check that status 2 is returned when attempting to
send a message from an identity that is not known (unlocked)
2014-02-06 18:10:00 +10:30
Andrew Bettison
fd86a3d17f Implement HTTP POST /restful/meshms/<SID>/<SID>/sendmessage
Rename struct meshms_ply fields from "buffer" to "record" for
consistency with comment terminology
2014-02-05 14:28:15 +10:30
Andrew Bettison
015ed0b181 Refactor to rename "Rhizome HTTP server" to "HTTPD server"
Move HTTPD start/stop/dispatch logic from rhizome_httpd.c into new
httpd.c

Rename config.debug.httpd -> config.debug.http_server
Rename config.debug.rhizome_httpd -> config.debug.httpd
Rename config.debug.rhizome_nohttptx -> config.debug.nohttptx
2014-02-03 15:56:07 +10:30
Andrew Bettison
f4249707a4 Implement HTTP GET /restful/meshms/<SID>/<SID>/newsince/<token>/messagelist.json
Two new test cases
2014-01-31 14:58:30 +10:30
Andrew Bettison
ebe444ffe3 Refactor rhizomehttp MeshMS message list test
New function add_messages() to use in fixture

Improve existing test case by adding more ACKs and messages
2014-01-31 14:30:01 +10:30
Andrew Bettison
c73bc49cf0 Improve MeshMS RESTful HTTP requests
Include local (my) and remote (their) SIDs in JSON responses for
conversationlist.json and messagelist.json, so that the same JSON
structures can be used in future for non-SID-specific queries.

Refactor MeshMS message iterator, rename "sender" and "recipient" fields
to "my" and "their", for consistency with the rest of the MeshMS source
code, and because "sender" and "recipient" are properties that apply to
a single message or single ply, not to a message thread (conversation).
2014-01-31 14:29:57 +10:30
Andrew Bettison
7b5752a111 Implement HTTP GET /restful/meshms/<SID>/<SID>/messagelist.json 2014-01-28 15:09:51 +10:30
Andrew Bettison
8897563d09 Implement HTTP GET /restful/meshms/<SID>/conversationlist.json 2014-01-23 10:52:43 +10:30
Andrew Bettison
6a1c8bcf5a All HTTP RESTful responses are JSON, not HTTP
Even error responses (typically code 403)
2014-01-20 15:44:21 +10:30
Jeremy Lakeman
68421db114 Add msp debug flag 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
48dce9a575 Add tcp forwarding on the listen end of an MSP connection 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
99e08d1516 Add command to support forwarding TCP connections to an MSP service 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
e09387b27d Refactor stdio handling 2014-01-09 15:06:34 +10:30
Jeremy Lakeman
6d942f8d4f Improve tests 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
4bb3336b33 Generalise method for defining multiple interfaces 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
506518ad06 Allow interfaces to use local unix addresses
- broadcast packets are sent to all sockets in the same folder
- switched most tests to use local sockets
2014-01-09 15:01:38 +10:30
Jeremy Lakeman
df6af96455 Test connection keep alive and timeouts 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
741442c54c Pipe file contents across msp connection 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
3a533187b7 Improve msp failure handling 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
db7f68afd7 Initial msp library implementation with connection state tracking 2014-01-09 15:01:37 +10:30
Andrew Bettison
669080edc8 Add 'rhizomehttp' to 'all' tests
Disable unused 'rhizomehttp' tests
2013-12-30 18:10:39 +10:30
Andrew Bettison
ee9c96bb8c Implement HTTP POST /restful/rhizome/insert
Change HTTP request buffer pointers from (const char*) to (char*)
because some Rhizome operations can modify received data in-place, eg,
when decrypting it.
2013-12-30 18:09:56 +10:30
Andrew Bettison
34188fa489 Replace config 'rhizome.external_blobs' with 'rhizome.max_blob_size' 2013-12-30 16:30:43 +10:30
Andrew Bettison
72040517e1 New enum rhizome_payload_status
Refactor a lot of Rhizome bundle storage code to use the new "enum
rhizome_payload_status" instead of mysterious int values to represent
the outcome of the operation.
2013-12-30 16:30:35 +10:30
Andrew Bettison
9ebef81a49 Formalise "rhizome add file" exit status
Formalise add-bundle result in "enum rhizome_bundle_status"

Rewrite rhizome_manifest_finalise(), rhizome_find_duplicate() and
rhizome_add_manifest() to return enum rhizome_bundle_status

New function rhizome_manifest_check_stored() that compares a manifest
with its stored counterpart and returns enum rhizome_bundle_status

Remove redundant rhizome_manifest_check_sanity(), consolidating all
manifest validation rules in rhizome_manifest_validate(), which now
checks the 'id' field is present, and that 'sender' and 'recipient' are
both present for MeshMS

Correct manifest finalisation logic: set the 'finalised' flag in
rhizome_manifest_validate(), not in rhizome_manifest_verify() (which
sets 'selfSigned'), and consistently clear 'finalised' flag in all
attribute setter functions

Remove manifest 'ttl' field and all references thereof (leaving unused
space in Rhizome BAR)

Rename some payload functions for clarity
2013-12-21 14:37:18 +10:30
Andrew Bettison
39b2f3a6f5 Improve 'rhizomehttp' test descriptions 2013-12-19 11:29:28 +10:30
Andrew Bettison
6798e943ec Implement HTTP GET /restful/rhizome/<BID>/decrypted.bin 2013-12-16 15:09:46 +10:30
Andrew Bettison
8c9ac6c1a5 Improve test case for /restful/rhizome/<BID>/raw.bin
Include some encrypted payloads in the test
2013-12-13 17:41:26 +10:30
Andrew Bettison
b53cabaae5 Unify output manifest fields from CLI rhizome commands 2013-12-13 17:24:59 +10:30
Andrew Bettison
6361bfd757 Implement HTTP GET /restful/rhizome/<BID>/raw.bin 2013-12-13 16:36:37 +10:30
Andrew Bettison
183cb46000 Add Rhizome HTTP response headers to /restful/rhizome/<BID>.rhm 2013-12-13 14:49:55 +10:30
Andrew Bettison
26e0120898 Implement HTTP GET /restful/rhizome/<BID>.rhm 2013-12-05 17:25:58 +10:30
Andrew Bettison
6bff87f7e5 Increase 'rhizomeprotocol' test case timeout
The 50% MDP packet loss test case is now likely to take more than 60
seconds to transfer the bundles, probably because of stricter manifest
syntax
2013-12-01 05:49:50 +10:30
Andrew Bettison
8db5f9c14a Merge branch 'anyservice' into 'development'
Allows any valid "service" manifest field in the "rhizome add file"
command

Many improvements in Rhizome manifest parsing; stricter manifest syntax
rules (no comment or blank lines, field names must be alphanumeric
identifiers), faster preliminary manifest inspection when receiving
manifest advertisements or syncing manifests

The 'development' branch introduces "struct socket_address" which
coincidentally fixed the recently encountered Linux kernel 3.12
recvmsg(2) EINVAL problem, so that 'rhizomeprotocol' tests which fail on
the 'anyservice' branch will pass after this merge
2013-12-01 05:44:01 +10:30
Andrew Bettison
0dd1b302b5 Rewrite Rhizome manifest parsing
Move validation checks into new function rhizome_manifest_validate()

Remove rhizome_manifest 'errors' field

Replace rhizome_manifest 'warnings' with 'malformed'

Replace rhizome_manifest 'manifest_bytes' with 'manifest_body_bytes' and
refactor to use 'manifest_all_bytes' in all manifest i/o

Refactor rhizome_manifest_verify() and reverse sense of return value to
match rhizome_manifest_validate()

New function rhizome_manifest_inspect() -- lightweight manifest parser
used when receiving Rhizome advertisements

New 'rhizomeops' test case for invalid manifest "service" field values,
now passes
2013-12-01 05:13:34 +10:30
Andrew Bettison
5e5e097d7f Accept any well formed Rhizome service field
Do not limit service field to only recognised supported values 'file',
'MeshMS1' and 'MeshMS2'

New test case checks for malformed service field, fails
2013-12-01 05:13:33 +10:30
Jeremy Lakeman
1681abd620 Increase default mdp timeout & make it configurable 2013-11-27 13:10:11 +10:30
Jeremy Lakeman
1b34c2dc13 Improve test reliability 2013-11-27 13:10:09 +10:30
Jeremy Lakeman
ad33264834 Rename mavlink to radio_link
- split link state from slip structures and encapsulate it completely
- allocate interface specific buffers on demand
2013-11-27 13:09:26 +10:30
Jeremy Lakeman
5ea19ab538 Better approximation of TDMA timing 2013-11-27 13:00:02 +10:30
Andrew Bettison
851dbb4d64 Add 'debug.subscriber' config option
Add debug logging to find_subscriber() function
2013-11-26 15:33:54 +10:30
Andrew Bettison
59a6ded10c Update 'dnaprotocol' debug flags 2013-11-26 15:33:54 +10:30
Andrew Bettison
711364ad8d Merge branch 'meshextender' into 'development' 2013-11-21 17:05:03 +10:30
Andrew Bettison
513aa15968 Finish HTTP /restful/rhizome/newsince/... test case
Uses new test framework fork support
2013-11-20 15:06:58 +10:30
Andrew Bettison
a882b8ebc6 Fix Rhizome Direct stress test - longer command timeouts
Since a default timeout was added to the execute() primitive
(b1b5a79) the Rhizome Direct test fails.
2013-11-20 15:06:07 +10:30
Andrew Bettison
c5014baf62 Improve test framework: better fork functions
Replace forkKillAll with fork_terminate_all

Replace forkWaitAll with fork_wait_all

Add fork_terminate and fork_wait functions

Introduce fork labels '%<alphanumeric>' as arguments to all fork
functions

Treat a forked process exit status 143 (killed with SIGTERM) as a
failure or error -- it happens when a forked process is terminated
using fork_terminate or fork_terminate_all
2013-11-20 15:01:37 +10:30
Andrew Bettison
29fab6dcb7 Add 'rhizome.api.restful.newsince_poll_ms' config option 2013-11-20 14:50:57 +10:30