File: dynamically-add-source

package info (click to toggle)
chrony 4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,780 kB
  • sloc: ansic: 38,349; sh: 5,876; yacc: 862; makefile: 232
file content (29 lines) | stat: -rw-r--r-- 712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# Make sure that NTP sources from /etc/chrony/sources.d are usable.

set -e

. debian/tests/helper-functions

trap __cleanup EXIT

server_addr="192.0.2.1"

printf "Preparing chronyd configuration: "
__no_system_clock_control
__restart_chronyd && __test_ok || __test_skip

printf "Adding a dummy server to the list of NTP sources: "
printf "server $server_addr\n" > /etc/chrony/sources.d/dummy-server.sources && __test_ok || __test_fail

printf "Reloading NTP sources: "
__reload_sources

printf "Checking for dummy server availability: "
__check_sources "$server_addr"

printf "Checking for dummy server availability after restarting chronyd: "
__restart_chronyd
__check_sources "$server_addr"

exit 0