Commit Graph

77 Commits

Author SHA1 Message Date
Andrew Bettison
776d4de894 Split up 'rhizomehttp' test script
New scripts 'rhizomerestful' and 'meshmsrestful'
New testdefs_json.sh
Improved testdefs.sh functions for discovering HTTP server port
2014-06-26 15:08:48 +09:30
Andrew Bettison
f2772b0ce8 Refactor tests: testdefs_java.sh, testdefs_meshms.sh
meshms_add_messages() now puts message texts into TEXT[$n] array
instead of "text$n" files
2014-06-19 09:54:29 +09:30
Andrew Bettison
11dcc3e972 Fix minor bugs in server start/kill tests 2014-06-11 11:15:28 +09:30
Andrew Bettison
ea9de737a2 MDP packet filter rules configuration
Configurable rules file path: mdp.filter_rules_path

Add filter rules parsing code, add filtering to outgoing as well as
incoming packets

New test script: tests/mdp with two test cases

Improve test defs: new execute_servald() function

Widen MDP port number format from 8 to ten chars to accommodate leading
"0x"
2014-04-29 15:31:50 +09:30
Andrew Bettison
684735b11c Fix config file timestamp bug
Ensure that timestamp always advances by at least one second every time
the config file is modified, add test case

Refactor test defs: detecting started HTTPD is not specific to Rhizome

Refactor struct file_meta and associated functions into "io.h" and io.c

Add various strbuf helper functions for formatting struct timespec
and struct file_meta to assist debug logging
2014-04-29 15:04:20 +09:30
Andrew Bettison
19aed8ecb5 Fix test defs: pop_instance did not restore instance
Add push_and_set_instance() function
Remove redundant set_instance calls in test cases
Cope if error() returns (can happen during teardown)
2014-03-03 15:14:34 +10:30
Andrew Bettison
08e02b18db Improve test framework: tfw_run() function 2014-03-03 15:14:34 +10:30
Jeremy Lakeman
ae67dd9c56 Initialise client API sockets before PID file 2014-02-24 17:14:35 +10:30
Jeremy Lakeman
46ef40cf23 Migrate and refactor more interfaces from batphone 2014-02-19 15:35:08 +10:30
Jeremy Lakeman
a7b43581ce Rename libservald to libserval for consistency with android build 2014-02-12 14:29:13 +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
Andrew Bettison
701f14fdf9 Improve test defs: extract_stdout_keyvalue_optional()
Logs its variable assignment
2013-11-11 16:17:16 +10:30
Andrew Bettison
f3f39faf84 Improve test defs: setup_jq()
For test fixtures that need the jq(1) JSON filter utility
2013-10-14 16:50:02 +10:30
Andrew Bettison
eb46cc99b3 Improve test defs: setup_curl()
Replace setup_curl_7() function in separate test scripts with a single,
general setup_curl() function in testdefs.sh which takes the minimum
version number as its argument.
2013-10-14 16:48:20 +10:30
Andrew Bettison
5e164607aa Expand output of rhizome add and import
Rename 'secret:' field to '.secret:' (non-manifest-fields start with '.'
using the same convention as rhizome list)

Add '.author' and 'BK' fields to "rhizome add"

Add 'BK' field to "rhizome import"

Fix 'rhizomeops' tests to assert no 'author' and 'BK' output fields from
"rhizome add" with no author

Fiz testdefs.sh and testdefs_rhizome.sh to support new output fields
2013-09-27 22:34:22 +09:30
Jeremy Lakeman
dab07dd4dc Remove monitor.socket & mdp.socket from tests 2013-09-24 16:27:34 +09:30
Andrew Bettison
d177512746 Add test for server start with --keyring-pin option 2013-09-09 14:47:02 +09:30
Andrew Bettison
aa20fd1a9b Improve keyring environment variables
Rename to SERVALD_...

Interpret SERVALD_KEYRING_PATH relative to instance dir unless absolute.

Explicitly unset them in setup_servald() test defs function
2013-08-30 11:20:19 +09:30
Jeremy Lakeman
d6d3c1f413 Add ping backward compatibility test 2013-05-29 11:58:06 +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
6d9bbe2e2c Refactor interface handling to separate encapsulation from stream type 2013-02-20 15:36:23 +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
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
dc6d0da07e Add explicit route tests and improve test speed 2012-12-11 11:27:18 +10:30
Jeremy Lakeman
2932544eb8 Add IPv4 addresses to dummy interface 2012-12-10 14:06:25 +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
Andrew Bettison
54d0e49a1d Improve Rhizome test defs: bundle_received_by()
Introduce per-instance server cache directory and use it to suppress duplicate
log messages from bundle_received_by().
2012-11-05 14:43:57 +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
Jeremy Lakeman
9842e22353 Add multi-hop routing test 2012-10-09 14:49:24 +10:30
Andrew Bettison
aca4e8eda9 Fix shell 'eval' metacharacter bug in test defs 2012-10-09 14:03:59 +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
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
1f4688db99 #16 Fix 'rhizomeops' tests that fail on Solaris 2012-09-13 14:08:52 +09:30
Daniel O'Connor
9f22073ab6 Detect Solaris and use GNU versions of awk, sed and grep.
Don't use %N as a date format unless we're on Linux.
Avoid using GNUisms with cmp & sort.
2012-09-06 16:41:24 +09:30
Andrew Bettison
41680ff663 Move functions from testdefs.sh to testdefs_rhizome.sh
... where they should have been in the first place.

Also, clean up the RHIZOME HTTP SERVER START log message.

Issue #9.
2012-08-27 17:07:44 +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
e534d93a84 Fix tests broken by execpath change
Commit 5cbc2167ec changed the servald 'start'
command to use a different argv[0], which meant that the testdefs.sh
get_servald_pids() function no longer detected running servald processes.
This broke most of the 'server' test cases.

testdefs.sh setup_servald() now makes a full copy of servald once per test
case, not just a symbolic link, so that the logic in get_servald_pids() works
again.
2012-08-21 13:35:33 +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
d63318cd2f Mop up executable rename from 'dna' to 'servald' 2012-07-30 16:15:42 +09:30
Andrew Bettison
6de247e576 Improve diagnosis of SEGV failures in tests 2012-07-24 15:39:36 +09:30
Jeremy Lakeman
be857316dc Move reachability test from starting instances to dna protocol tests 2012-07-18 19:35:47 +09:30
Jeremy Lakeman
fdc70d7512 Log when a peer becomes reachable or unreachable, edit tests to wait for this message 2012-07-17 18:22:39 +09:30
Andrew Bettison
218e7883ce Improve test scripts: use new 'wait_until' primitive 2012-07-11 16:51:29 +09:30
Andrew Bettison
572fa591e2 Refactor test utilities from 'rhizomeops' into testdefs_rhizome.sh 2012-07-06 13:32:21 +09:30
Andrew Bettison
ab64b08ceb Rewrite config file code
Gets rid of rotor in confValueGet() and duplicate config file parsing code
Currently fails three tests
2012-07-04 18:57:02 +09:30