summaryrefslogtreecommitdiffstats
path: root/test/simulation/119-smoothtime
blob: 7f5114c80d26afb104d33d00d06593d1ae933403 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash

. ./test.common

test_start "smoothtime option"

check_config_h 'FEAT_REFCLOCK 1' || test_skip

server_strata=2
server_conf="smoothtime 400 0.001"
server_server_options="minpoll 8"
min_sync_time=600
max_sync_time=800

run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_sync || test_fail

limit=10000
refclock_jitter=1e-4
refclock_offset="(* 10.0 (equal 0.1 (max (sum 1.0) 1000) 1000))"
server_step="(* -10.0 (equal 0.1 (sum 1.0) 1))"
server_strata=1
server_conf="refclock SHM 0 dpoll 4 poll 6
smoothtime 2000 1
maxjitter 10.0"
time_offset=-10
server_server_options=""
client_server_options="minpoll 6 maxpoll 6"
client_conf="corrtimeratio 100"
min_sync_time=8000
max_sync_time=9000

run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_sync || test_fail

client_server_options="minpoll 6 maxpoll 6 xleave maxdelay 1e-1"

run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_sync || test_fail

client_server_options="minpoll 6 maxpoll 6"
min_sync_time=$default_min_sync_time
max_sync_time=$default_max_sync_time
time_max_limit=11
time_rms_limit=11
freq_max_limit=1e-2
freq_rms_limit=2e-3

run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_sync || test_fail

refclock_jitter=1e-9
refclock_offset="(* 1e-1 (triangle 1000) (+ -1.0 (pulse 1000 10000)))"
server_step=""
server_conf="refclock SHM 0 dpoll 4 poll 6 minsamples 4 maxsamples 4
smoothtime 1e4 1e-6"
client_server_options="minpoll 4 maxpoll 4"
time_offset=0.1
jitter=1e-6
wander=0.0
min_sync_time=30
max_sync_time=40
time_max_limit=1e-5
time_rms_limit=5e-6
freq_max_limit=1e-6
freq_rms_limit=1e-7

run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_packet_interval || test_fail
check_sync || test_fail

test_pass