Commit Graph

34 Commits

Author SHA1 Message Date
Jeremy Lakeman
3726fe2f73 Move vomp console feature to test binary 2016-11-21 11:09:27 +10:30
Andrew Bettison
95cce9109f Fix Android server thread start bug
Was failing to start if a stale pidfile was present.

Introduced the 'debug.server' config option to help diagnose pidfile
issues.
2016-10-20 13:29:01 +10:30
Andrew Bettison
a15396b793 Add server status test case 2016-10-13 16:01:22 +10: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
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
2241a15e48 Use file locking to better detect if the server really is running 2016-04-06 14:57:30 +09: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
52da7778cd Allow closing a monitor connection to force the server to quit 2014-06-11 20:39:26 +09:30
Andrew Bettison
11dcc3e972 Fix minor bugs in server start/kill tests 2014-06-11 11:15:28 +09:30
Jeremy Lakeman
afd31fe12c Ensure a race condition while starting servald only starts one process 2014-06-11 09:01:56 +09:30
Jeremy Lakeman
f09e6c38d2 Test that server quits after deleting pid file 2014-06-05 14:55:50 +09:30
Jeremy Lakeman
6d4ad0e150 Rework scheduler to allow for lazy but important alarms 2014-06-04 17:13:08 +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
8bc746af25 New "config sync" command 2014-04-16 19:28:16 +09:30
Andrew Bettison
2716228074 Add server watchdog and config reload test 2014-04-16 18:06:27 +09:30
Jeremy Lakeman
c6e461bcb0 Attempt to create folders for binding AF_UNIX sockets 2014-04-11 17:00:47 +09:30
Jeremy Lakeman
6d942f8d4f Improve tests 2014-01-09 15:01:38 +10:30
Andrew Bettison
4851eaf536 Issue #20: remove unique socket names from tests
The recent work on abstract local socket names means that every instance has
its own unique abstract socket name anyway, so there is no need for test
scripts to use $TFWUNIQUE in MDP and Monitor socket names to avoid
intereference when run concurrently.
2013-09-20 14:24:55 +09:30
Andrew Bettison
f06613c35f Fix test failures from latest logging changes 2013-04-05 15:28:54 +10:30
Andrew Bettison
95b0c028f2 Log to file, Android and stderr simultaneously
Indepent configuration of show_pid, show_time and log level for each
destination

Update test scripts for new config options

Include xprintf.c in MDP client source files (now used by log.c)
2013-03-27 16:17:38 +10:30
Andrew Bettison
c804b9d5ce Fix copyright messages in test scripts 2013-02-06 18:55:31 +10:30
Andrew Bettison
5ac394a3c1 Maybe fix tests/server:NoZombie occasional failure
Introduced a two-second wait for the KILLed process to die.
2013-01-10 12:12:51 +10:30
Andrew Bettison
fe042bfa64 Servald 'config [ set|del ... ] ... ' command
Update all test scripts to avoid repetitive executeOk_servald invocations.
2012-12-06 12:31:19 +10:30
Andrew Bettison
c53789d764 Legacy 'interfaces' config option improvements
Legacy form is now incompatible with modern form.

Test case to check legacy parsing.
2012-12-04 18:22:26 +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
bdd0bb357f Improve logging config options
Rename config option "logfile" to "log.file"
Add "log.show_pid" boolean
Add "log.show_time" boolean
2012-07-11 17:09:50 +09:30
Andrew Bettison
1193763abd Fix server test fixtures to isolate concurrent running tests 2012-07-02 16:08:39 +09:30
Andrew Bettison
f5a99238cb Add test case for server start while already running 2012-06-26 16:09:22 +09:30
Andrew Bettison
4afdbe1b5e Add server start/stop tests 2012-06-26 15:52:37 +09:30
Andrew Bettison
c041048958 Fix servald server test assertion messages 2012-06-22 17:32:42 +09:30
Andrew Bettison
de4a9a1318 Improve server tests: server log file assertions 2012-06-22 17:18:14 +09:30
Andrew Bettison
aedb31e451 Improve test definitions
Better instance handling primitives
Fix get_servald_pids() to work on Linux and Mac (allegedly!)
2012-06-22 15:56:28 +09:30
Andrew Bettison
72640e830a First server start/stop test
On the way to multi-instance test scripts
2012-06-04 18:28:38 +09:30