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.
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.
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)
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.
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.
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.
Debug bit mask is unsigned int everywhere.
Refactor DEBUG() macros a bit.
Add SERVALD_DEBUG_FILE env var to support test scripts.
Test defs put instance directories under $TFWVAR not $TFWTMP.
Tests assert that stderr contains no ERROR: lines after a successful exit
Rewrote sqlite_exec_int64() to separate error outcomes from legitimate
result values
Changed several WHY() calls to DEBUG()
Improved test framework
Improve regular expressions for common data types in test scripts
Revert column count field delimiter in "rhizome list" from ":" to "\n"
Add a few more test cases
- Put common utility functions into testdefs.sh
- Add abspath() and realpath() functions to test framework
- Test framework now executes all tests with working directory in a temporary
directory, to avoid pollution of caller's working directory
- Improve test log verbosity
- Name test log files by test script name