From Fedora Project Wiki
Description
chrony is a suite of utilities for maintaining the accuracy of computer clocks. It includes chronyd, a daemon that can synchronize the system clock with NTP servers, and chronyc, a command-line client for managing chronydThis test case ensures that the chrony
suite functions correctly to synchronize the system clock with NTP servers.
Setup
- Install the
chrony
package:sudo dnf install chrony
. - Make sure your system is connected to the internet.
How to test
- Start the
chronyd
service:sudo systemctl start chronyd
. - Check the status of the service to ensure it's running:
sudo systemctl status chronyd
. - Use
chronyc
to see tracking statistics:chronyc tracking
. - Use
chronyc
to see information about peers:chronyc sources
.
Expected Results
- The
chronyd
service starts without any errors. - The service status indicates that
chronyd
is active and running. - The
chronyc tracking
command should provide valid statistics and show the system's synchronization status. - The
chronyc sources
command should list NTP servers (by default from the system's pool) with their current state.
Optional
For advanced testing:
- Introduce an artificial clock skew and observe
chrony
correcting it. - Temporarily block NTP traffic (using
iptables
or other means) and check howchronyd
responds. - Customize the
chrony
configuration (e.g., use different NTP servers) and validate the behavior. - Test
chrony
's behavior after system reboots or when transitioning between different network environments.