Commit Graph

31 Commits

Author SHA1 Message Date
Joachim Nilsson
d6370aeb1f Follow-up to 69608f7: Update API test with TAG formatting change
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-13 08:31:36 +01:00
Joachim Nilsson
6ac6abe60e test: Verify new secure mode, and remote log to default port
It's a lot easier to debug the remote test with Wireshark if we log to
the default service port on the remote host.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 13:28:02 +01:00
Joachim Nilsson
11ab6c55bc test: Don't overwrite bar.conf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 13:28:02 +01:00
Joachim Nilsson
4ee6211277 syslogd: Refactor internals to use new socket API
This patch is inspired, in part, by FreeBSD syslogd but now diverges
onto its own path.  Special handling for AF_UNIX sockets are required
on Linux, which unlike BSD cannot use getaddrinfo() on UNIX sockets.

- Rip out old funix[] and finet support
- Add new concept of peers
- Linked list of peers can be > 20
- Temporarily open up to accept all remote conns
- Remove old logerror(), replaced with new log macros

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-12 13:28:01 +01:00
Joachim Nilsson
172ae92887 test: Extend API test with logger verifing structured data
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 23:21:33 +01:00
Joachim Nilsson
6059d873a5 Fix stray 'g' that sneaked in last test update
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 19:13:28 +01:00
Joachim Nilsson
939a28f6f8 Test with a secondary UNIX socket
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 19:08:29 +01:00
Joachim Nilsson
4376def121 Allow running tests stand-alone
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-07 19:08:29 +01:00
Joachim Nilsson
8142c780e0 Wait a bit before checking the log file, also check if it's alive
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 16:38:30 +01:00
Joachim Nilsson
999f713115 Dump actual v1.conf file on error
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 16:26:44 +01:00
Joachim Nilsson
66e9975234 Actually return error when API test fails, dump more logs
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 16:22:29 +01:00
Joachim Nilsson
09085b2ba9 Debug API test, syslogp() fails on Travis-CI for some reason
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-06 16:07:13 +01:00
Joachim Nilsson
0ade961e60 Fix syslog() and syslogp() message formatting in API test
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 20:10:36 +01:00
Joachim Nilsson
512aaa1afc Fix paths for out-of-tree builds, found by make distcheck
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 20:09:54 +01:00
Joachim Nilsson
e202196152 Add missing files to distribution, found by make distcheck
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 20:09:15 +01:00
Joachim Nilsson
c35f4de7fc Travis-CI: Build all test programs as regular user, or clang fails
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:52:37 +01:00
Joachim Nilsson
dca48d8b7d test: Extend API test with three more phases
- with/without openlog()
- setlogmask()
- syslogp() API

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:51:39 +01:00
Joachim Nilsson
f07d00f910 test: Enable syslogd debug mode, log in test/start.log
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 19:51:02 +01:00
Joachim Nilsson
b1548e7c73 Add simple API test, syslog() no call to openlog()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-03 15:55:25 +01:00
Joachim Nilsson
62c651a979 Adapt unit tests to leverage and test /etc/syslog.d/*.conf support
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-02 11:47:45 +01:00
Joachim Nilsson
c6a19049dc Trim remote test, restore startup/log sleep 2
Even on my laptop it sometimes takes a bit too long for tshark to start
up and syslogd to actually FWD the $MSG to remote.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 12:07:52 +01:00
Joachim Nilsson
892ee80e59 Trim test times now that we've fixed the root cause on Travis-CI
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:52:27 +01:00
Joachim Nilsson
3f5ae0e861 Travis-CI: Run test suite as super user, avoid sudo from within test
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:46:49 +01:00
Joachim Nilsson
cd7d2ca0be sudo do what I mean
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:35:19 +01:00
Joachim Nilsson
ef00787c5c Show any errors from tshark/tcpdump in error log
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:15:01 +01:00
Joachim Nilsson
ba9e494db2 Travis-CI: Debug networking capabilities
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:09:46 +01:00
Joachim Nilsson
495325dc51 Let remote unit test exit on first error
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 10:04:36 +01:00
Joachim Nilsson
7a605f1435 Increase delay in remote logging test for Travis-CI
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 09:53:56 +01:00
Joachim Nilsson
8f459d349a test: Check sending log messages to remote server works
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-30 17:14:29 +01:00
Joachim Nilsson
87292c6f95 Verify logging to local file via syslogd
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-29 13:58:56 +01:00
Joachim Nilsson
b67d57cf59 Initial test framework: make check
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-29 13:58:56 +01:00