]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
5 years agoutil: add functions for common file operations
Miroslav Lichvar [Tue, 22 Oct 2019 16:06:15 +0000 (18:06 +0200)] 
util: add functions for common file operations

Add a function to open a file for reading, writing, or appending.
In uppercase modes errors are handled as fatal, i.e. the caller doesn't
need to check for NULL. To avoid string manipulations in the callers,
the function accepts an optional directory and suffix. New files are
created with specified permissions, which will be needed for saving
keys. The O_EXCL flag is used in the writing mode to make sure a new
file is created (on filesystems that support it).

Also, add a function to rename a temporary file by changing its suffix,
and a function to remove a file.

All functions log all errors, at least as debug messages.

5 years agortc: don't clone file attributes of rtc file
Miroslav Lichvar [Tue, 22 Oct 2019 12:50:00 +0000 (14:50 +0200)] 
rtc: don't clone file attributes of rtc file

When replacing an existing rtc file with the temporary file, don't
change the ownership or permissions of the temporary file to match the
old rtc file, as if it didn't exist.

5 years agoreference: don't clone file attributes of drift file
Miroslav Lichvar [Tue, 22 Oct 2019 10:31:03 +0000 (12:31 +0200)] 
reference: don't clone file attributes of drift file

When replacing an existing drift file with the temporary file, don't
change the ownership or permissions of the temporary file to match the
old drift file, as if it didn't exist.

5 years agouse PATH_MAX
Miroslav Lichvar [Thu, 10 Oct 2019 15:53:58 +0000 (17:53 +0200)] 
use PATH_MAX

Include <limits.h> and use the PATH_MAX macro to define the length of
buffers containing paths to make it constistent. (It's not supposed to
fit all possible paths.)

5 years agologging: include <syslog.h>
Miroslav Lichvar [Wed, 23 Oct 2019 15:23:35 +0000 (17:23 +0200)] 
logging: include <syslog.h>

Move the inclusion of <syslog.h> from sysincl.h to logging.c to avoid
accidentally using the LOG_* constants from the header.

5 years agologging: make banner printing safer
Miroslav Lichvar [Tue, 22 Oct 2019 13:25:03 +0000 (15:25 +0200)] 
logging: make banner printing safer

Don't rely on the buffer filled with '=' characters to be always at
least as long as the log-specific banner string.

5 years agologging: call exit() in LOG_Message()
Miroslav Lichvar [Thu, 10 Oct 2019 13:07:10 +0000 (15:07 +0200)] 
logging: call exit() in LOG_Message()

Call exit() in LOG_Message() after printing a fatal message to allow the
LOG macro or LOG_Message() to be used directly instead of the LOG_FATAL
macro.

5 years agotest: extend 110-chronyc test
Miroslav Lichvar [Tue, 24 Sep 2019 09:29:35 +0000 (11:29 +0200)] 
test: extend 110-chronyc test

5 years agotest: extend 105-ntpauth test
Miroslav Lichvar [Thu, 19 Sep 2019 15:38:22 +0000 (17:38 +0200)] 
test: extend 105-ntpauth test

5 years agotest: extend keys unit test
Miroslav Lichvar [Thu, 19 Sep 2019 15:47:53 +0000 (17:47 +0200)] 
test: extend keys unit test

5 years agotest: add cmac unit test
Miroslav Lichvar [Mon, 23 Sep 2019 12:38:57 +0000 (14:38 +0200)] 
test: add cmac unit test

5 years agoclient: add CMAC support to keygen command
Miroslav Lichvar [Thu, 19 Sep 2019 11:17:20 +0000 (13:17 +0200)] 
client: add CMAC support to keygen command

Allow a CMAC cipher to be specified in the keygen command. Ignore the
specified length as the key length is determined by the cipher.

5 years agokeys: add support for CMAC keys
Miroslav Lichvar [Tue, 17 Sep 2019 14:59:55 +0000 (16:59 +0200)] 
keys: add support for CMAC keys

Allow a cipher (AES128 or AES256) to be specified as the type of a key
in the key file to authenticate NTP packets with a CMAC instead of the
NTPv4 (RFC 5905) MAC using a hash function. This follows RFC 8573.

5 years agocmac: add support for Nettle
Miroslav Lichvar [Tue, 17 Sep 2019 14:58:31 +0000 (16:58 +0200)] 
cmac: add support for Nettle

Add support for AES128 and AES256 CMAC in Nettle.

5 years agocmac: add CMAC interface
Miroslav Lichvar [Tue, 17 Sep 2019 14:57:03 +0000 (16:57 +0200)] 
cmac: add CMAC interface

Add cmac.h and stubs for cipher-based message authentication code
(CMAC).

5 years agokeys: don't fudge authentication delay
Miroslav Lichvar [Mon, 23 Sep 2019 15:58:27 +0000 (17:58 +0200)] 
keys: don't fudge authentication delay

Remove the magic constant compensating for copying, conversions, etc.
It cannot possibly be accurate on all hardware. The delay is supposed to
be a minimum delay.

5 years agohash: drop support for RIPEMD hash functions
Miroslav Lichvar [Tue, 17 Sep 2019 14:51:39 +0000 (16:51 +0200)] 
hash: drop support for RIPEMD hash functions

An analysis by Tim Ruffing [1] shows that a length extension attack
adding valid extension fields to NTPv4 packets is possible with some
specific key lengths and hash functions using little-endian length like
MD5 and RIPEMD160.

chronyd currently doesn't process or generate any extension fields, but
it could be a problem in future when a non-authentication extension
field is supported.

Drop support for all RIPEMD functions as they don't seem to be secure in
the context of the NTPv4 MAC. MD5 is kept only for compatibility.

[1] https://mailarchive.ietf.org/arch/msg/ntp/gvibuB6bTbDRBumfHNdJ84Kq4kA

5 years agomakefile: improve coding style
Miroslav Lichvar [Thu, 19 Sep 2019 10:25:39 +0000 (12:25 +0200)] 
makefile: improve coding style

5 years agomakefile: refactor to support extra client-specific objects
Miroslav Lichvar [Thu, 19 Sep 2019 10:08:03 +0000 (12:08 +0200)] 
makefile: refactor to support extra client-specific objects

5 years agoconfigure: move duplicated libraries to LIBS
Miroslav Lichvar [Thu, 19 Sep 2019 10:55:35 +0000 (12:55 +0200)] 
configure: move duplicated libraries to LIBS

5 years agoconfigure: remove unused variables
Miroslav Lichvar [Thu, 19 Sep 2019 10:03:12 +0000 (12:03 +0200)] 
configure: remove unused variables

5 years agotest: disable server on client-only nodes by default
Miroslav Lichvar [Wed, 11 Sep 2019 17:26:51 +0000 (19:26 +0200)] 
test: disable server on client-only nodes by default

5 years agotest: add 138-syncloop test
Miroslav Lichvar [Wed, 11 Sep 2019 16:49:02 +0000 (18:49 +0200)] 
test: add 138-syncloop test

5 years agotest: allow nodes to poll themselves
Miroslav Lichvar [Thu, 5 Sep 2019 15:30:17 +0000 (17:30 +0200)] 
test: allow nodes to poll themselves

5 years agotest: remove subdirectories in tmp directory
Miroslav Lichvar [Thu, 5 Sep 2019 15:29:36 +0000 (17:29 +0200)] 
test: remove subdirectories in tmp directory

5 years agontp: skip loop test if no server socket is open
Miroslav Lichvar [Wed, 11 Sep 2019 16:35:29 +0000 (18:35 +0200)] 
ntp: skip loop test if no server socket is open

If there is no socket that could receive a request from a client or
peer, we know that nothing can be synchronized to us and no loop is
possible.

5 years agontp: prevent synchronization to itself
Miroslav Lichvar [Thu, 5 Sep 2019 15:30:50 +0000 (17:30 +0200)] 
ntp: prevent synchronization to itself

Improve the client's test D to compare the stratum, reference ID,
reference timestamp, and root delay from the received packet with its
own reference data in order to prevent it from synchronizing to itself,
e.g. due to a misconfiguration.

5 years agoreference: make local reference timestamp consistent
Miroslav Lichvar [Thu, 5 Sep 2019 15:14:30 +0000 (17:14 +0200)] 
reference: make local reference timestamp consistent

In the local reference mode, instead of returning the adjusted current
time as the reference time, return the same timestamp updated only once
per about 62.5 seconds.

This will enable chronyd to detect polling of itself even when the local
reference mode is active.

5 years agoreference: rework adjustment of reference timestamp
Miroslav Lichvar [Thu, 5 Sep 2019 15:03:38 +0000 (17:03 +0200)] 
reference: rework adjustment of reference timestamp

Instead of converting the reference timestamp to the NTP format and
back, add a negative double value to the timestamp directly. Move the
code to a separate function. This will allow the timestamp to stay
outside the compiled-in NTP era, which is useful for testing of the
cmdmon protocol.

5 years agotest: extend 110-chronyc test
Miroslav Lichvar [Tue, 3 Sep 2019 10:41:05 +0000 (12:41 +0200)] 
test: extend 110-chronyc test

5 years agotest: add 137-pool test
Miroslav Lichvar [Mon, 2 Sep 2019 15:21:43 +0000 (17:21 +0200)] 
test: add 137-pool test

5 years agotest: add 013-nameserv test
Miroslav Lichvar [Mon, 2 Sep 2019 14:32:58 +0000 (16:32 +0200)] 
test: add 013-nameserv test

5 years agotest: add option to enable name/address resolving
Miroslav Lichvar [Mon, 2 Sep 2019 14:25:42 +0000 (16:25 +0200)] 
test: add option to enable name/address resolving

5 years agotest: add copyright header to util unit test
Miroslav Lichvar [Wed, 21 Aug 2019 14:36:12 +0000 (16:36 +0200)] 
test: add copyright header to util unit test

5 years agotest: extend 105-ntpauth test
Miroslav Lichvar [Mon, 19 Aug 2019 13:56:18 +0000 (15:56 +0200)] 
test: extend 105-ntpauth test

5 years agotest: add debug message to ntp unit test
Miroslav Lichvar [Thu, 15 Aug 2019 16:46:04 +0000 (18:46 +0200)] 
test: add debug message to ntp unit test

5 years agontp: update setting of socket option
Miroslav Lichvar [Wed, 21 Aug 2019 07:12:33 +0000 (09:12 +0200)] 
ntp: update setting of socket option

5 years agosocket: add support for TCP sockets
Miroslav Lichvar [Tue, 6 Aug 2019 16:33:06 +0000 (18:33 +0200)] 
socket: add support for TCP sockets

TCP sockets will be needed for NTS key establishment.

6 years agosocket: fix typo in union declaration
Miroslav Lichvar [Tue, 6 Aug 2019 15:50:37 +0000 (17:50 +0200)] 
socket: fix typo in union declaration

6 years agoutil: add debug messages to UTI_FdSetCloexec()
Miroslav Lichvar [Thu, 8 Aug 2019 15:32:23 +0000 (17:32 +0200)] 
util: add debug messages to UTI_FdSetCloexec()

6 years agomakefile: clean unit tests in clean target
Miroslav Lichvar [Tue, 6 Aug 2019 13:59:05 +0000 (15:59 +0200)] 
makefile: clean unit tests in clean target

6 years agodoc: improve ntpdate answer in FAQ
Miroslav Lichvar [Mon, 5 Aug 2019 16:15:38 +0000 (18:15 +0200)] 
doc: improve ntpdate answer in FAQ

6 years agosourcestats: report offset even with single sample
Miroslav Lichvar [Tue, 6 Aug 2019 13:54:38 +0000 (15:54 +0200)] 
sourcestats: report offset even with single sample

6 years agosourcestats: simplify SST_DoSourcestatsReport()
Miroslav Lichvar [Tue, 6 Aug 2019 12:00:17 +0000 (14:00 +0200)] 
sourcestats: simplify SST_DoSourcestatsReport()

6 years agotest: extend 130-quit test
Miroslav Lichvar [Mon, 5 Aug 2019 16:03:11 +0000 (18:03 +0200)] 
test: extend 130-quit test

6 years agosourcestats: enable selection with maxsamples < 3
Miroslav Lichvar [Mon, 5 Aug 2019 15:53:00 +0000 (17:53 +0200)] 
sourcestats: enable selection with maxsamples < 3

Setting maxsamples to 1 or 2 prevented the source from being selected as
the regression would always fail. Handle this as a special case with
disabled frequency tracking in order to enable a fast reference update
with the -q/-Q option.

6 years agosourcestats: update offset estimate when regression fails
Miroslav Lichvar [Mon, 5 Aug 2019 13:25:04 +0000 (15:25 +0200)] 
sourcestats: update offset estimate when regression fails

If there are too few samples to make a regression, at least update the
offset estimate from the last sample and keep the previous frequency
offset unchanged. Also, reset the error estimates.

6 years agosocket: fix compiler warning
Miroslav Lichvar [Thu, 25 Jul 2019 07:52:33 +0000 (09:52 +0200)] 
socket: fix compiler warning

Don't define check_socket_flag() if no supported socket flag is defined.

6 years agosocket: avoid unnecessary bind() call
Miroslav Lichvar [Wed, 24 Jul 2019 09:46:39 +0000 (11:46 +0200)] 
socket: avoid unnecessary bind() call

Don't call bind() if the specified local address of a socket has port 0
and the "any" address. It will be bound automatically on connect() or
sendmsg().

6 years agosocket: add support for socket() flags
Miroslav Lichvar [Tue, 23 Jul 2019 15:26:29 +0000 (17:26 +0200)] 
socket: add support for socket() flags

On start, check if the SOCK_CLOEXEC and SOCK_NONBLOCK flags are
supported in the socket() call and use them instead of fcntl() in order
to reduce the number of system calls required to send a client request.

6 years agosocket: make all sockets non-blocking
Miroslav Lichvar [Tue, 23 Jul 2019 13:09:24 +0000 (15:09 +0200)] 
socket: make all sockets non-blocking

All networking code in chronyd (NTP server/client, signd client, cmdmon
server) assumes sending a message will not block, but only the signd
client actually checks for a write event and only the NTP server
requests a non-blocking socket. The cmdmon server and NTP client
(if using one socket for all servers) might be blocked.

chronyc doesn't need a non-blocking socket, but it is not expected to
block as it sends only one message at a time.

Prefer dropped messages over blocking in all cases. Remove the
SCK_FLAG_NONBLOCK flag and make all sockets non-blocking.

6 years agontp: improve debug messages with port number
Miroslav Lichvar [Thu, 18 Jul 2019 09:33:13 +0000 (11:33 +0200)] 
ntp: improve debug messages with port number

6 years agoutil: move and improve sockaddr-specific functions
Miroslav Lichvar [Thu, 18 Jul 2019 07:42:11 +0000 (09:42 +0200)] 
util: move and improve sockaddr-specific functions

Move the functions to socket.c and improve them to require and check the
sockaddr length.

6 years agoutil: remove UTI_SockaddrToString()
Miroslav Lichvar [Thu, 18 Jul 2019 07:35:59 +0000 (09:35 +0200)] 
util: remove UTI_SockaddrToString()

It is no longer used after the conversions.

6 years agoclient: convert to new socket API
Miroslav Lichvar [Wed, 17 Jul 2019 15:38:32 +0000 (17:38 +0200)] 
client: convert to new socket API

6 years agorefclock: remove SOCK socket on exit
Miroslav Lichvar [Wed, 17 Jul 2019 09:30:11 +0000 (11:30 +0200)] 
refclock: remove SOCK socket on exit

6 years agorefclock: convert SOCK to new socket API
Miroslav Lichvar [Wed, 17 Jul 2019 09:26:28 +0000 (11:26 +0200)] 
refclock: convert SOCK to new socket API

6 years agocmdmon: respond from same address
Miroslav Lichvar [Tue, 16 Jul 2019 15:13:07 +0000 (17:13 +0200)] 
cmdmon: respond from same address

Enable the destination address of received messages in order to respond
from the same address on multihomed hosts.

6 years agocmdmon: convert to new socket API
Miroslav Lichvar [Thu, 18 Jul 2019 06:35:54 +0000 (08:35 +0200)] 
cmdmon: convert to new socket API

6 years agontp: convert to new socket API
Miroslav Lichvar [Thu, 18 Jul 2019 06:35:16 +0000 (08:35 +0200)] 
ntp: convert to new socket API

Rework the NTP I/O code to use the new socket support. There are
differences in debug messages and handling of some errors.

6 years agosocket: add new socket support
Miroslav Lichvar [Thu, 18 Jul 2019 06:26:06 +0000 (08:26 +0200)] 
socket: add new socket support

Add a new file implementing support for opening sockets, sending and
receiving messages with control messages (e.g. addresses, timestamps),
and related operations, which should be simpler to use than the system
functions and allow their features to be reused between different parts
of the chrony code.

It is based on the ntp_io.c and ntp_io_linux.c files. It will be used by
the NTP client/server, cmdmon server, client, and others.

6 years agoutil: add UTI_IPSockAddrToString()
Miroslav Lichvar [Thu, 18 Jul 2019 06:12:33 +0000 (08:12 +0200)] 
util: add UTI_IPSockAddrToString()

This function prints an IPSockAddr. IPv6 addresses are printed in
brackets to separate the address from the port.

6 years agoaddressing: introduce IPSockAddr
Miroslav Lichvar [Thu, 18 Jul 2019 06:05:43 +0000 (08:05 +0200)] 
addressing: introduce IPSockAddr

Rename NTP_Remote_Address to IPSockAddr to make it usable in non-NTP
context and provide NTP_Remote_Address for compatibility. Also, change
the type of port to uint16_t.

6 years agocmdmon: limit rate of all responses
Miroslav Lichvar [Tue, 16 Jul 2019 15:15:03 +0000 (17:15 +0200)] 
cmdmon: limit rate of all responses

Include responses to invalid requests in the rate limiting enabled by
the cmdratelimit directive.

6 years agocmdmon: don't require bound UDP socket
Miroslav Lichvar [Tue, 9 Jul 2019 12:48:42 +0000 (14:48 +0200)] 
cmdmon: don't require bound UDP socket

Don't abort on start when no UDP socket could be opened/bound for
cmdmon. The Unix socket is more important and with the IP_FREEBIND
option this case was not caught anyway.

6 years agoprivops: add assertion for bind address length
Miroslav Lichvar [Tue, 9 Jul 2019 10:28:13 +0000 (12:28 +0200)] 
privops: add assertion for bind address length

6 years agotest: fix building of unit tests
Miroslav Lichvar [Tue, 16 Jul 2019 11:30:05 +0000 (13:30 +0200)] 
test: fix building of unit tests

This fixes commit 1227873b8810ed0f82d4b85a3c19c9562fda0b91.

6 years agodoc: improve chronyd man page
Miroslav Lichvar [Thu, 4 Jul 2019 15:37:54 +0000 (17:37 +0200)] 
doc: improve chronyd man page

6 years agomain: add option to specify minimum log severity level
Miroslav Lichvar [Thu, 4 Jul 2019 14:57:36 +0000 (16:57 +0200)] 
main: add option to specify minimum log severity level

The -L option can be used to disable logging of less severe messages,
e.g informational or warnings.

6 years agologging: refactor enabling of debug messages
Miroslav Lichvar [Tue, 2 Jul 2019 14:18:06 +0000 (16:18 +0200)] 
logging: refactor enabling of debug messages

Reorder the LOGS_Severity enum in order of severity and change the code
to not log/print messages with severity below the specified minimum
instead of having a separate debug level.

6 years agonameserv: request SOCK_DGRAM socktype
Miroslav Lichvar [Wed, 26 Jun 2019 15:17:31 +0000 (17:17 +0200)] 
nameserv: request SOCK_DGRAM socktype

Specify SOCK_DGRAM socktype instead of SOCK_STREAM in hints for
getaddrinfo() as chronyd is (and will mainly be) using the returned
addresses to open UDP sockets. This shouldn't make a difference in
practice, but it might avoid some confusion.

6 years agoconfigure: fix warnings in tests
Miroslav Lichvar [Tue, 18 Jun 2019 14:20:59 +0000 (16:20 +0200)] 
configure: fix warnings in tests

Fix some warnings in configure tests reported by clang and coverity
static analyzer.

6 years agotest: update processing of packet log
Miroslav Lichvar [Tue, 18 Jun 2019 13:41:50 +0000 (15:41 +0200)] 
test: update processing of packet log

Two new fields have been added to the packet log, which broke some
of the simulation tests.

6 years agodoc: update NEWS 3.5
Miroslav Lichvar [Fri, 10 May 2019 10:22:57 +0000 (12:22 +0200)] 
doc: update NEWS

6 years agoupdate copyright years
Miroslav Lichvar [Thu, 9 May 2019 14:55:04 +0000 (16:55 +0200)] 
update copyright years

6 years agodoc: add note about minsamples to FAQ
Miroslav Lichvar [Thu, 9 May 2019 13:49:11 +0000 (15:49 +0200)] 
doc: add note about minsamples to FAQ

6 years agorefclock: remove unnecessary strlen() call
Miroslav Lichvar [Thu, 9 May 2019 13:48:11 +0000 (15:48 +0200)] 
refclock: remove unnecessary strlen() call

6 years agotest: extend 133-hwtimestamp test
Miroslav Lichvar [Thu, 9 May 2019 16:44:03 +0000 (18:44 +0200)] 
test: extend 133-hwtimestamp test

6 years agontp: check value returned by CMSG_FIRSTHDR
Miroslav Lichvar [Thu, 9 May 2019 15:34:53 +0000 (17:34 +0200)] 
ntp: check value returned by CMSG_FIRSTHDR

In NIO_Linux_RequestTxTimestamp(), check the returned pointer and the
length of the buffer before adding the control message. This fixes an
issue reported by the Clang static analyzer.

6 years agontp: check timestamping configuration when SIOCSHWTSTAMP fails
Miroslav Lichvar [Tue, 7 May 2019 16:04:37 +0000 (18:04 +0200)] 
ntp: check timestamping configuration when SIOCSHWTSTAMP fails

With future kernels it may be possible to get, but not set, the HW
timestamping configuration on some specific interfaces like macvlan in
containers. This would require the admin to configure the timestamping
before starting chronyd.

If SIOCSHWTSTAMP failed on an interface, try SIOCGHWTSTAMP to check if
the current configuration matches the expected configuration and allow
the interface to be used for HW timestamping.

6 years agoexamples: remove /var from PIDFile in chronyd.service
Miroslav Lichvar [Mon, 6 May 2019 13:38:16 +0000 (15:38 +0200)] 
examples: remove /var from PIDFile in chronyd.service

Recent systemd versions complain when loading a unit using a PIDFile
that relies on the /var/run -> /run symlink.

6 years agodoc: update NEWS 3.5-pre1
Miroslav Lichvar [Thu, 2 May 2019 09:31:40 +0000 (11:31 +0200)] 
doc: update NEWS

6 years agodoc: add more recommendations for best stability to FAQ
Miroslav Lichvar [Tue, 30 Apr 2019 12:45:23 +0000 (14:45 +0200)] 
doc: add more recommendations for best stability to FAQ

6 years agodoc: update list of contributors
Miroslav Lichvar [Mon, 29 Apr 2019 14:42:44 +0000 (16:42 +0200)] 
doc: update list of contributors

Include all authors from the git repository.

6 years agodoc: simplify acknowledgements in README
Miroslav Lichvar [Mon, 29 Apr 2019 14:22:32 +0000 (16:22 +0200)] 
doc: simplify acknowledgements in README

Stop trying to maintain a list of individual contributions. Just list
the contributors. For tracking individual changes in the source code
there is git.

6 years agodoc: list build requirements in installation
Miroslav Lichvar [Mon, 29 Apr 2019 14:15:06 +0000 (16:15 +0200)] 
doc: list build requirements in installation

6 years agodoc: improve combinelimit description
Miroslav Lichvar [Fri, 26 Apr 2019 09:19:20 +0000 (11:19 +0200)] 
doc: improve combinelimit description

6 years agodoc: improve rtconutc description
Miroslav Lichvar [Fri, 26 Apr 2019 09:12:41 +0000 (11:12 +0200)] 
doc: improve rtconutc description

6 years agotest: use env in shebang of system tests
Miroslav Lichvar [Fri, 26 Apr 2019 08:04:15 +0000 (10:04 +0200)] 
test: use env in shebang of system tests

This should allow the tests to run on systems where bash is not in /bin.

6 years agotest: add 104-systemdirs system test
Miroslav Lichvar [Thu, 25 Apr 2019 16:40:46 +0000 (18:40 +0200)] 
test: add 104-systemdirs system test

6 years agotest: fix owner of driftfile and keys in system tests
Miroslav Lichvar [Thu, 25 Apr 2019 16:18:11 +0000 (18:18 +0200)] 
test: fix owner of driftfile and keys in system tests

6 years agotest: allow separate lib/log/run directories in system tests
Miroslav Lichvar [Thu, 25 Apr 2019 16:19:00 +0000 (18:19 +0200)] 
test: allow separate lib/log/run directories in system tests

6 years agotest: check if non-root user can access test directory
Miroslav Lichvar [Thu, 25 Apr 2019 15:27:31 +0000 (17:27 +0200)] 
test: check if non-root user can access test directory

6 years agotest: redirect error messages in system tests
Miroslav Lichvar [Thu, 25 Apr 2019 15:25:19 +0000 (17:25 +0200)] 
test: redirect error messages in system tests

6 years agotest: allow TEST_DIR and CHRONYC_WRAPPER to be set for system tests
Miroslav Lichvar [Thu, 25 Apr 2019 15:24:37 +0000 (17:24 +0200)] 
test: allow TEST_DIR and CHRONYC_WRAPPER to be set for system tests

6 years agosys_posix: support SCHED_FIFO and mlockall on more OSs
Stefan R. Filipek [Fri, 19 Apr 2019 18:41:14 +0000 (14:41 -0400)] 
sys_posix: support SCHED_FIFO and mlockall on more OSs

Real-time scheduling and memory locking is available on posix compliant
OSs. This patch centralizes this functionality and brings support to
FreeBSD, NetBSD, and Solaris.

[ML: updated coding style]

6 years agorefclock: check all driver options
Miroslav Lichvar [Thu, 18 Apr 2019 13:56:15 +0000 (15:56 +0200)] 
refclock: check all driver options

In each driver provide a list of supported options and abort when an
unknown option is specified in the refclock directive.

6 years agodoc: fix syntax of refclock directive
Miroslav Lichvar [Thu, 18 Apr 2019 10:29:44 +0000 (12:29 +0200)] 
doc: fix syntax of refclock directive

When multiple driver options are specified, they need to be separated by
colon, not comma.

6 years agotest: add system tests
Miroslav Lichvar [Wed, 17 Apr 2019 15:33:16 +0000 (17:33 +0200)] 
test: add system tests

Add a new set of tests for testing basic functionality, starting chronyd
with root privileges on the actual system instead of the simulator.

Tests numbered in the 100-199 range are considered destructive and
intended to be used only on machines dedicated for development or
testing. They are started by the run script only with the -d option.
They may adjust/step the system clock and other clocks, block the RTC,
enable HW timestamping, create SHM segments, etc.

Other tests should not interfere with the system and should work even
when another NTP server/client is running.

6 years agosys_linux: use pthread_setschedparam instead of sched_setscheduler
Stefan R. Filipek [Thu, 4 Apr 2019 23:12:39 +0000 (19:12 -0400)] 
sys_linux: use pthread_setschedparam instead of sched_setscheduler

Fix an issue with Linux and musl libc where sched_setscheduler is not
implemented. It seems that pthread_setschedparam is more widely
supported across different C libraries and OSs. For our use case, it
should make no difference which call is used.