summaryrefslogtreecommitdiff
path: root/test/simulation/120-selectoptions
blob: 7e10293ca8c7619b1db4c06e5d4ec9c0a9a7474c (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
#!/bin/bash

. ./test.common

test_start "source selection options"

servers=3
falsetickers=2

base_delay=0.6
client_server_conf="
server 192.168.123.1
server 192.168.123.2
server 192.168.123.3 trust"

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

client_server_conf="
server 192.168.123.1
server 192.168.123.2
server 192.168.123.3 prefer"

run_test || test_fail
check_chronyd_exit || test_fail
check_source_selection || test_fail
check_packet_interval || test_fail
# This check is expected to fail
check_sync && test_fail

base_delay=1.1

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

base_delay=$default_base_delay
falsetickers=1

client_server_conf="
server 192.168.123.1
server 192.168.123.2
server 192.168.123.3 require"

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

client_server_conf="
server 192.168.123.1 require
server 192.168.123.2
server 192.168.123.3"

run_test || test_fail
check_chronyd_exit || test_fail
check_packet_interval || test_fail
# These checks are expected to fail
check_source_selection && test_fail
check_sync && test_fail

test_pass