summaryrefslogtreecommitdiffstats
path: root/test/simulation
diff options
context:
space:
mode:
Diffstat (limited to 'test/simulation')
-rwxr-xr-xtest/simulation/008-ntpera1
-rwxr-xr-xtest/simulation/106-refclock13
-rwxr-xr-xtest/simulation/108-peer2
-rwxr-xr-xtest/simulation/110-chronyc20
-rwxr-xr-xtest/simulation/113-leapsecond88
-rwxr-xr-xtest/simulation/118-maxdelay1
-rwxr-xr-xtest/simulation/119-smoothtime2
-rwxr-xr-xtest/simulation/121-local90
-rwxr-xr-xtest/simulation/121-orphan26
-rwxr-xr-xtest/simulation/122-xleave1
-rwxr-xr-xtest/simulation/124-tai16
-rwxr-xr-xtest/simulation/126-burst2
-rwxr-xr-xtest/simulation/127-filter2
-rwxr-xr-xtest/simulation/135-ratelimit11
-rwxr-xr-xtest/simulation/142-ntpoverptp17
-rwxr-xr-xtest/simulation/144-monoroot4
-rwxr-xr-xtest/simulation/148-replacement24
-rwxr-xr-xtest/simulation/203-initreload26
18 files changed, 270 insertions, 76 deletions
diff --git a/test/simulation/008-ntpera b/test/simulation/008-ntpera
index 2eea63b..ab11819 100755
--- a/test/simulation/008-ntpera
+++ b/test/simulation/008-ntpera
@@ -41,7 +41,6 @@ for time_offset in -1e-1 1e-1; do
export CLKNETSIM_START_DATE=$(awk "BEGIN {printf \"%.0f\", $ntp_start + $start_offset}")
run_test || test_fail
check_chronyd_exit || test_fail
- check_source_selection || test_fail
check_packet_interval || test_fail
check_sync && test_fail
done
diff --git a/test/simulation/106-refclock b/test/simulation/106-refclock
index ba7c482..dedab9b 100755
--- a/test/simulation/106-refclock
+++ b/test/simulation/106-refclock
@@ -36,7 +36,7 @@ Update interval : 16\.. seconds
.*$" || test_fail
if echo "$refclock" | grep -q 'PHC.*nocrossts'; then
- check_file_messages "20.* GPS.*[0-9] N " 650 750 refclocks.log || test_fail
+ check_file_messages "20.* GPS.*[0-9] N " 620 750 refclocks.log || test_fail
else
check_file_messages "20.* GPS.*[0-9] N " 997 1001 refclocks.log || test_fail
fi
@@ -64,7 +64,7 @@ Stratum.*: 1
Root delay : 0\.000000001 seconds
.*$" || test_fail
- check_file_messages "20.* PPS1.*[0-9] N " 620 740 refclocks.log || test_fail
+ check_file_messages "20.* PPS1.*[0-9] N " 610 740 refclocks.log || test_fail
check_file_messages "20.* PPS1.*- N " 60 63 refclocks.log || test_fail
rm -f tmp/refclocks.log
@@ -89,14 +89,15 @@ Root delay : 0\.000000001 seconds
check_file_messages "20.* PPS1.*- N " 60 63 refclocks.log || test_fail
rm -f tmp/refclocks.log
- min_sync_time=100
- max_sync_time=220
+ min_sync_time=80
+ max_sync_time=180
chronyc_start=220
client_conf="
refclock SHM 0 refid NMEA offset 0.35 delay 0.1
refclock PPS /dev/pps0
logdir tmp
-log refclocks"
+log refclocks
+maxupdateskew 10000"
run_test || test_fail
check_chronyd_exit || test_fail
@@ -108,7 +109,7 @@ Stratum.*: 1
Root delay : 0\.000000001 seconds
.*$" || test_fail
- check_file_messages "20.* PPS1.*[0-9] N " 800 940 refclocks.log || test_fail
+ check_file_messages "20.* PPS1.*[0-9] N " 800 960 refclocks.log || test_fail
check_file_messages "20.* PPS1.*- N " 50 63 refclocks.log || test_fail
rm -f tmp/refclocks.log
fi
diff --git a/test/simulation/108-peer b/test/simulation/108-peer
index 906de17..2c914e1 100755
--- a/test/simulation/108-peer
+++ b/test/simulation/108-peer
@@ -21,6 +21,7 @@ EOF
clients=2
peers=2
+freq_max_limit=1e-3
max_sync_time=1000
client_server_options="minpoll 6 maxpoll 6"
client_peer_options="minpoll 6 maxpoll 6"
@@ -30,6 +31,7 @@ check_chronyd_exit || test_fail
check_source_selection || test_fail
check_sync || test_fail
+freq_max_limit=$default_freq_max_limit
base_delay="(+ 1e-4 (* -1 (equal 0.1 from 3) (equal 0.1 to 1)))"
client_peer_options=""
diff --git a/test/simulation/110-chronyc b/test/simulation/110-chronyc
index 46b0a3f..5b32931 100755
--- a/test/simulation/110-chronyc
+++ b/test/simulation/110-chronyc
@@ -58,7 +58,7 @@ MS Name/IP address Stratum Poll Reach LastRx Last sample
\^\? 192\.168\.123\.2 0 [0-9]+ 0 - \+0ns\[ \+0ns\] \+/- 0ns
Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev
==============================================================================
-SHM0 [0-9 ]+ [0-9 ]+ [0-9 ]+ [ +-][01]\.... [0-9 ]+\.... [0-9 +-]+[un]s [0-9 ]+[un]s
+SHM0 [0-9 ]+ [0-9 ]+ [0-9 ]+ [ +-][012]\.... [0-9 ]+\.... [0-9 +-]+[un]s [0-9 ]+[un]s
192\.168\.123\.1 [0-9 ]+ [0-9 ]+ [0-9 ]+ [ +-][01]\.... [0-9 ]+\.... [0-9 +-]+[un]s [0-9 ]+[un]s
192\.168\.123\.2 0 0 0 \+0\.000 2000\.000 \+0ns 4000ms
210 n_samples = 0
@@ -114,7 +114,7 @@ limit=1
for chronyc_conf in \
"accheck 1.2.3.4" \
"add peer 10.0.0.0 minpoll 2 maxpoll 6" \
- "add server 10.0.0.0 minpoll 6 maxpoll 10 iburst burst key 1 certset 2 maxdelay 1e-3 maxdelayratio 10.0 maxdelaydevratio 10.0 maxdelayquant 0.5 mindelay 1e-4 asymmetry 0.5 offset 1e-5 minsamples 6 maxsamples 6 filter 3 offline auto_offline prefer noselect trust require xleave polltarget 20 port 123 presend 7 minstratum 3 version 4 nts ntsport 4460 copy extfield F323 extfield F324" \
+ "add server 10.0.0.0 minpoll 6 maxpoll 10 iburst burst key 1 certset 2 maxdelay 1e-3 maxdelayratio 10.0 maxdelaydevratio 10.0 maxdelayquant 0.5 mindelay 1e-4 asymmetry 0.5 offset 1e-5 minsamples 6 maxsamples 6 filter 3 offline auto_offline prefer noselect trust require xleave polltarget 20 port 123 presend 7 minstratum 3 version 4 nts ntsport 4460 copy extfield F323 extfield F324 ipv6 ipv4" \
"add server node1.net1.clk" \
"allow 1.2.3.4" \
"allow 1.2" \
@@ -145,7 +145,7 @@ for chronyc_conf in \
"dfreq 1.0e-3" \
"doffset -1.0" \
"dump" \
- "local stratum 5 distance 1.0 orphan" \
+ "local stratum 5 distance 1.0 activate 0.5 orphan" \
"local off" \
"makestep 10.0 3" \
"makestep" \
@@ -165,6 +165,7 @@ for chronyc_conf in \
"offline" \
"offline 255.255.255.0/1.2.3.0" \
"offline 1.2.3.0/24" \
+ "offset 1.2.3.4 1.0" \
"online" \
"online 1.2.3.0/24" \
"onoffline" \
@@ -247,6 +248,10 @@ Total TX : 1
Total RX : 1
Total valid RX : 1
Total good RX : 0
+Total kernel TX : [01]
+Total kernel RX : 1
+Total HW TX : 0
+Total HW RX : 0
S Name/IP Address Auth COpts EOpts Last Score Interval Leap
=======================================================================
M node1\.net1\.clk N ----- ----- 0 1\.0 \+0ns \+0ns N
@@ -347,6 +352,7 @@ maxpoll 192.168.123.1 5
maxupdateskew 192.168.123.1 10.0
minpoll 192.168.123.1 3
minstratum 192.168.123.1 1
+offset 192.168.123.1 -1.0
polltarget 192.168.123.1 10
selectopts 192.168.123.1 +trust +prefer -require
selectdata
@@ -371,6 +377,7 @@ check_chronyc_output "^200 OK
200 OK
200 OK
200 OK
+200 OK
S Name/IP Address Auth COpts EOpts Last Score Interval Leap
=======================================================================
M node1\.net1\.clk N \-PT\-\- \-PT\-\- 0 1\.0 \+0ns \+0ns \?
@@ -433,7 +440,12 @@ server_conf="
server 192.168.123.1
noclientlog"
-commands=(
+check_config_h 'FEAT_IPV6 1' && commands=(
+ "add server ::1 ipv4" "^515 Invalid address family$"
+ ) || commands=()
+
+commands+=(
+ "add server 192.168.123.1 ipv6" "^515 Invalid address family$"
"add server nosuchnode.net1.clk" "^Invalid host/IP address$"
"allow nosuchnode.net1.clk" "^Could not read address$"
"allow 192.168.123.0/2 4" "^Could not read address$"
diff --git a/test/simulation/113-leapsecond b/test/simulation/113-leapsecond
index 394440b..63da734 100755
--- a/test/simulation/113-leapsecond
+++ b/test/simulation/113-leapsecond
@@ -8,54 +8,86 @@ check_config_h 'FEAT_REFCLOCK 1' || test_skip
export CLKNETSIM_START_DATE=$(TZ=UTC date -d 'Dec 30 2008 0:00:00' +'%s')
-leap=$[2 * 24 * 3600]
limit=$[4 * 24 * 3600]
client_start=$[2 * 3600]
-server_conf="refclock SHM 0 dpoll 10 poll 10
-leapsectz right/UTC"
refclock_jitter=1e-9
-refclock_offset="(* -1.0 (equal 0.1 (max (sum 1.0) $leap) $leap))"
-for leapmode in system step slew; do
- client_conf="leapsecmode $leapmode"
- if [ $leapmode = slew ]; then
- max_sync_time=$[$leap + 12]
- else
- max_sync_time=$[$leap]
- fi
+for dir in "+1" "-1"; do
+ leap=$[2 * 24 * 3600 + 1 + $dir]
+ server_conf="refclock SHM 0 dpoll 10 poll 10
+ leapseclist tmp/leap.list"
+ refclock_offset="(* $dir (equal 0.1 (max (sum 1.0) $leap) $leap))"
+
+ cat > tmp/leap.list <<-EOF
+ #$ 3676924800
+ #@ 3928521600
+ 3345062400 33 # 1 Jan 2006
+ 3439756800 $[33 - $dir] # 1 Jan 2009 $(
+ [ "$dir" = "+1" ] && echo -e "\n3471292800 33\n3502828800 34")
+ 3550089600 35 # 1 Jul 2012
+ EOF
+
+ for leapmode in system step slew; do
+ client_conf="leapsecmode $leapmode"
+ if [ $leapmode = slew ]; then
+ max_sync_time=$[2 * 24 * 3600 + 13]
+ else
+ max_sync_time=$[2 * 24 * 3600 + 1]
+ fi
+ min_sync_time=$[$max_sync_time - 2]
+
+ run_test || test_fail
+ check_chronyd_exit || test_fail
+ check_source_selection || test_fail
+ check_packet_interval || test_fail
+ check_sync || test_fail
+ check_file_messages "System clock TAI offset set to" 1 1 log.1 || test_fail
+ check_file_messages "System clock TAI offset set to 33" 1 1 log.1 || test_fail
+ done
+
+ client_server_options="trust"
+ client_conf="refclock SHM 0 dpoll 10 poll 10 delay 1e-3"
+ min_sync_time=$[$leap - 2]
+ max_sync_time=$[$leap]
run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_packet_interval || test_fail
check_sync || test_fail
-done
-client_server_options="trust"
-client_conf="refclock SHM 0 dpoll 10 poll 10 delay 1e-3"
+ client_server_options=""
+ client_conf="leapsecmode system"
+ min_sync_time=230000
+ max_sync_time=240000
-run_test || test_fail
-check_chronyd_exit || test_fail
-check_source_selection || test_fail
-check_packet_interval || test_fail
-check_sync || test_fail
+ for smoothmode in "" "leaponly"; do
+ server_conf="refclock SHM 0 dpoll 10 poll 10
+ leapseclist tmp/leap.list
+ leapsecmode slew
+ smoothtime 400 0.001 $smoothmode"
-client_server_options=""
-client_conf="leapsecmode system"
-min_sync_time=230000
-max_sync_time=240000
+ run_test || test_fail
+ check_chronyd_exit || test_fail
+ check_source_selection || test_fail
+ check_packet_interval || test_fail
+ check_sync || test_fail
+ done
+done
-for smoothmode in "" "leaponly"; do
+if TZ=right/UTC date -d 'Dec 31 2008 23:59:60' 2> /dev/null | grep :60; then
server_conf="refclock SHM 0 dpoll 10 poll 10
- leapsectz right/UTC
- leapsecmode slew
- smoothtime 400 0.001 $smoothmode"
+ leapsectz right/UTC"
+ refclock_offset="(* -1 (equal 0.1 (max (sum 1.0) $leap) $leap))"
+ client_conf="leapsecmode system"
+ min_sync_time=$[$leap - 2]
+ max_sync_time=$[$leap]
run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_packet_interval || test_fail
check_sync || test_fail
-done
+fi
test_pass
diff --git a/test/simulation/118-maxdelay b/test/simulation/118-maxdelay
index 117b170..8ab0a62 100755
--- a/test/simulation/118-maxdelay
+++ b/test/simulation/118-maxdelay
@@ -14,7 +14,6 @@ client_server_options="maxpoll 6 maxdelay 3e-5 maxdelayratio 2.0 maxdelaydevrati
run_test || test_fail
check_chronyd_exit || test_fail
-check_source_selection || test_fail
check_packet_interval || test_fail
check_sync || test_fail
diff --git a/test/simulation/119-smoothtime b/test/simulation/119-smoothtime
index 7f5114c..fc2c6be 100755
--- a/test/simulation/119-smoothtime
+++ b/test/simulation/119-smoothtime
@@ -14,7 +14,7 @@ max_sync_time=800
run_test || test_fail
check_chronyd_exit || test_fail
-check_source_selection || test_fail
+check_source_selection && test_fail
check_sync || test_fail
limit=10000
diff --git a/test/simulation/121-local b/test/simulation/121-local
new file mode 100755
index 0000000..ba99efc
--- /dev/null
+++ b/test/simulation/121-local
@@ -0,0 +1,90 @@
+#!/usr/bin/env bash
+
+. ./test.common
+
+test_start "local options"
+
+check_config_h 'FEAT_CMDMON 1' || test_skip
+
+server_strata=3
+server_conf="local stratum 5 orphan
+server 192.168.123.1
+server 192.168.123.2
+server 192.168.123.3"
+max_sync_time=900
+client_start=140
+chronyc_start=700
+chronyc_conf="tracking"
+time_rms_limit=5e-4
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_sync || test_fail
+check_chronyc_output "^.*Stratum *: 7.*$" || test_fail
+
+limit=4000
+wander=0.0
+jitter=0.0
+server_strata=1
+server_conf=""
+client_server_options="minpoll 6 maxpoll 6 minsamples 64"
+chronyc_start=1
+chronyc_conf="timeout 1000000
+tracking
+tracking
+tracking
+tracking"
+base_delay=$(cat <<-EOF | tr -d '\n'
+ (+ 1e-4
+ (* 990
+ (equal 0.1 from 3))
+ (* -1
+ (equal 0.1 from 1)
+ (equal 0.1 (max (% time 2000) 1000) 1000)))
+EOF
+)
+
+client_conf="local
+maxclockerror 1000"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_chronyc_output "^.*7F7F0101.*C0A87B01.*7F7F0101.*C0A87B01.*$" || test_fail
+
+client_conf="local distance 0.5
+maxclockerror 1000"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_chronyc_output "^.*7F7F0101.*C0A87B01.*7F7F0101.*C0A87B01.*$" || test_fail
+
+client_conf="local distance 2.0
+maxclockerror 1000"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_chronyc_output "^.*7F7F0101.*C0A87B01.*C0A87B01.*C0A87B01.*$" || test_fail
+
+client_conf="local activate 1e-4
+maxclockerror 1000"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_chronyc_output "^.* 00000000 .*C0A87B01.*C0A87B01.*C0A87B01.*$" || test_fail
+
+client_conf="local activate 1e-1
+maxclockerror 1000"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_chronyc_output "^.* 00000000 .*C0A87B01.*7F7F0101.*C0A87B01.*$" || test_fail
+
+client_conf="local activate 1e-1 distance 2.0
+maxclockerror 1000"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_chronyc_output "^.* 00000000 .*C0A87B01.*C0A87B01.*C0A87B01.*$" || test_fail
+
+test_pass
diff --git a/test/simulation/121-orphan b/test/simulation/121-orphan
deleted file mode 100755
index 7579997..0000000
--- a/test/simulation/121-orphan
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-. ./test.common
-
-test_start "orphan option"
-
-check_config_h 'FEAT_CMDMON 1' || test_skip
-
-server_strata=3
-server_conf="local stratum 5 orphan
-server 192.168.123.1
-server 192.168.123.2
-server 192.168.123.3"
-max_sync_time=900
-client_start=140
-chronyc_start=700
-chronyc_conf="tracking"
-time_rms_limit=5e-4
-
-run_test || test_fail
-check_chronyd_exit || test_fail
-check_source_selection || test_fail
-check_sync || test_fail
-check_chronyc_output "^.*Stratum *: 7.*$" || test_fail
-
-test_pass
diff --git a/test/simulation/122-xleave b/test/simulation/122-xleave
index c19063a..77059d8 100755
--- a/test/simulation/122-xleave
+++ b/test/simulation/122-xleave
@@ -53,7 +53,6 @@ for rpoll in 4 5 6; do
run_test || test_fail
check_chronyd_exit || test_fail
- check_source_selection || test_fail
check_sync || test_fail
if [ $rpoll -le 5 ]; then
diff --git a/test/simulation/124-tai b/test/simulation/124-tai
index 97064f7..e8c909d 100755
--- a/test/simulation/124-tai
+++ b/test/simulation/124-tai
@@ -18,9 +18,17 @@ servers=0
refclock_offset="(+ -34 (equal 0.1 (max (sum 1.0) $leap) $leap))"
client_conf="
refclock SHM 0 dpoll 0 poll 0 tai
-leapsectz right/UTC
+leapseclist tmp/leap.list
leapsecmode ignore
-maxchange 1e-3 1 0"
+maxchange 1e-3 10 0"
+
+cat > tmp/leap.list <<-EOF
+ #$ 3676924800
+ #@ 3928521600
+ 3345062400 33 # 1 Jan 2006
+ 3439756800 34 # 1 Jan 2009
+ 3550089600 35 # 1 Jul 2012
+EOF
run_test || test_fail
check_chronyd_exit || test_fail
@@ -33,9 +41,9 @@ time_offset=-1000
refclock_offset="(+ -34)"
client_conf="
refclock SHM 0 dpoll 0 poll 0 tai
-leapsectz right/UTC
+leapseclist tmp/leap.list
makestep 1 1
-maxchange 1e-3 1 0"
+maxchange 1e-3 10 0"
run_test || test_fail
check_chronyd_exit || test_fail
diff --git a/test/simulation/126-burst b/test/simulation/126-burst
index 1cb6f9c..baae3d5 100755
--- a/test/simulation/126-burst
+++ b/test/simulation/126-burst
@@ -22,7 +22,7 @@ client_min_mean_out_interval=150.0
run_test || test_fail
check_chronyd_exit || test_fail
-check_source_selection || test_fail
+check_source_selection && test_fail
check_packet_interval || test_fail
check_sync || test_fail
diff --git a/test/simulation/127-filter b/test/simulation/127-filter
index 739dd91..68afec2 100755
--- a/test/simulation/127-filter
+++ b/test/simulation/127-filter
@@ -12,7 +12,7 @@ client_min_mean_out_interval=15.9
run_test || test_fail
check_chronyd_exit || test_fail
-check_source_selection || test_fail
+check_source_selection && test_fail
check_packet_interval || test_fail
check_sync || test_fail
diff --git a/test/simulation/135-ratelimit b/test/simulation/135-ratelimit
index 86c435d..0756f19 100755
--- a/test/simulation/135-ratelimit
+++ b/test/simulation/135-ratelimit
@@ -15,4 +15,15 @@ check_sync || test_fail
check_file_messages " 2 1 " 1200 1300 log.packets || test_fail
check_file_messages " 1 2 " 180 220 log.packets || test_fail
+server_conf="ratelimit interval 6 burst 2 leak 4 kod 2"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_packet_interval || test_fail
+check_sync || test_fail
+
+check_file_messages " 2 1 " 700 850 log.packets || test_fail
+check_file_messages " 1 2 " 350 450 log.packets || test_fail
+check_log_messages "Received KoD RATE.*\.123.1" 100 140 || test_fail
+
test_pass
diff --git a/test/simulation/142-ntpoverptp b/test/simulation/142-ntpoverptp
index 2996dc0..74cb8f7 100755
--- a/test/simulation/142-ntpoverptp
+++ b/test/simulation/142-ntpoverptp
@@ -16,6 +16,7 @@ peers=2
max_sync_time=420
server_conf="
+ptpdomain 123
ptpport 319"
client_conf="
ptpport 319
@@ -103,4 +104,20 @@ if check_config_h 'FEAT_DEBUG 1'; then
check_log_messages "apply_net_correction.*Applied" 0 0 || test_fail
fi
+freq_offset=-1e-4
+delay_correction=""
+server_conf="ptpport 319"
+client_conf="ptpport 319
+ptpdomain 124
+authselectmode ignore
+keyfile tmp/peer.keys"
+time_max_limit=$default_time_max_limit
+time_rms_limit=$default_time_rms_limit
+freq_max_limit=$default_freq_max_limit
+freq_rms_limit=$default_freq_rms_limit
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_sync && test_fail
+
test_pass
diff --git a/test/simulation/144-monoroot b/test/simulation/144-monoroot
index 20fae12..d97f30d 100755
--- a/test/simulation/144-monoroot
+++ b/test/simulation/144-monoroot
@@ -20,7 +20,7 @@ for options in "extfield F323" "xleave extfield F323"; do
run_test || test_fail
check_chronyd_exit || test_fail
- check_source_selection || test_fail
+ check_source_selection && test_fail
check_sync || test_fail
done
@@ -47,7 +47,7 @@ for lpoll in 5 6 7; do
run_test || test_fail
check_chronyd_exit || test_fail
- check_source_selection || test_fail
+ check_source_selection && test_fail
check_sync || test_fail
done
done
diff --git a/test/simulation/148-replacement b/test/simulation/148-replacement
index f15fc4d..d09fba6 100755
--- a/test/simulation/148-replacement
+++ b/test/simulation/148-replacement
@@ -53,4 +53,28 @@ check_log_messages "2010-01-01T0[5-9]:.*Source 192.168.123.. replaced with" 0 15
check_file_messages "20.*192.168.123.* 11.1 6 6 " 20 500 measurements.log || test_fail
rm -f tmp/measurements.log
+# 2 replaceable falsetickers and 1 replaceable unreachable server
+servers=6
+falsetickers=2
+base_delay="(+ 1e-4 (* -1 (equal 0.1 to 3)))"
+client_server_conf="
+server nodes-4-1.net1.clk
+server nodes-5-2.net1.clk
+server nodes-6-3.net1.clk"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection && test_fail
+check_packet_interval || test_fail
+check_sync || test_fail
+
+check_log_messages "Can't synchronise: no majority" 1 1 || test_fail
+check_log_messages "Detected falseticker" 0 2 || test_fail
+check_log_messages "Source 192.168.123.. replaced with" 3 60 || test_fail
+check_log_messages "Source 192.168.123.1 replaced with" 1 25 || test_fail
+check_log_messages "Source 192.168.123.2 replaced with" 1 25 || test_fail
+check_log_messages "Source 192.168.123.3 replaced with" 1 25 || test_fail
+check_file_messages "20.*192.168.123.* 11.1 6 6 " 50 800 measurements.log || test_fail
+rm -f tmp/measurements.log
+
test_pass
diff --git a/test/simulation/203-initreload b/test/simulation/203-initreload
new file mode 100755
index 0000000..cf7924b
--- /dev/null
+++ b/test/simulation/203-initreload
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+. ./test.common
+
+check_config_h 'FEAT_CMDMON 1' || test_skip
+
+# Test fix "conf: don't load sourcedir during initstepslew and RTC init"
+
+test_start "reload during initstepslew"
+
+client_conf="initstepslew 5 192.168.123.1
+sourcedir tmp"
+client_server_conf="#"
+chronyc_conf="reload sources"
+chronyc_start=4
+
+echo 'server 192.168.123.1' > tmp/sources.sources
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_sync || test_fail
+
+check_log_messages "Added source 192\.168\.123\.1" 1 1 || test_fail
+
+test_pass