blob: 689e38b7e8a0dd023be1dd32234e386f98a483c7 (
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
|
#!/usr/bin/env bash
. ./test.common
test_start "loading of configuration"
minimal_config=1
extra_chronyd_directives="
include $TEST_DIR/conf1.d/conf.1
confdir $TEST_DIR/conf1.d
confdir $TEST_DIR/conf2.d $TEST_DIR/conf3.d $TEST_DIR/conf4.d
sourcedir $TEST_DIR/conf5.d
include $TEST_DIR/conf1.d/conf.2"
mkdir $TEST_DIR/conf{1,2,3,4,5}.d
echo "server 127.123.1.1" > $TEST_DIR/conf1.d/conf.1
echo "server 127.123.1.2" > $TEST_DIR/conf1.d/conf.2
echo "server 127.123.1.3" > $TEST_DIR/conf1.d/3.conf
echo "server 127.123.1.4" > $TEST_DIR/conf1.d/4.conf
echo "server 127.123.2.2" > $TEST_DIR/conf2.d/2.conf
echo "server 127.123.2.3" > $TEST_DIR/conf2.d/3.conf
echo "server 127.123.3.1" > $TEST_DIR/conf3.d/1.conf
echo "server 127.123.3.2" > $TEST_DIR/conf3.d/2.conf
echo "server 127.123.3.3" > $TEST_DIR/conf3.d/3.conf
echo "server 127.123.4.1" > $TEST_DIR/conf4.d/1.conf
echo "server 127.123.4.2" > $TEST_DIR/conf4.d/2.conf
echo "server 127.123.4.3" > $TEST_DIR/conf4.d/3.conf
echo "server 127.123.4.4" > $TEST_DIR/conf4.d/4.conf
echo "server 127.123.5.1" > $TEST_DIR/conf5.d/1.sources
echo "server 127.123.5.2" > $TEST_DIR/conf5.d/2.sources
echo "server 127.123.5.3" > $TEST_DIR/conf5.d/3.sources
start_chronyd || test_fail
wait_for_sync || test_fail
run_chronyc "sources" || test_fail
check_chronyc_output "^[^=]*
=*
.. 127\.123\.1\.1 [^^]*
.. 127\.123\.1\.3 [^^]*
.. 127\.123\.1\.4 [^^]*
.. 127\.123\.3\.1 [^^]*
.. 127\.123\.2\.2 [^^]*
.. 127\.123\.2\.3 [^^]*
.. 127\.123\.4\.4 [^^]*
.. 127\.123\.1\.2 [^^]*
.. 127\.123\.5\.1 [^^]*
.. 127\.123\.5\.2 [^^]*
.. 127\.123\.5\.3 [^^]*$" || test_fail
rm $TEST_DIR/conf5.d/1.sources
echo "server 127.123.5.2 minpoll 7" > $TEST_DIR/conf5.d/2.sources
echo > $TEST_DIR/conf5.d/3.sources
echo "server 127.123.5.4" > $TEST_DIR/conf5.d/4.sources
run_chronyc "reload sources" || test_fail
run_chronyc "sources" || test_fail
check_chronyc_output "^[^=]*
=*
.. 127\.123\.1\.1 [^^]*
.. 127\.123\.1\.3 [^^]*
.. 127\.123\.1\.4 [^^]*
.. 127\.123\.3\.1 [^^]*
.. 127\.123\.2\.2 [^^]*
.. 127\.123\.2\.3 [^^]*
.. 127\.123\.4\.4 [^^]*
.. 127\.123\.1\.2 *0 6 [^^]*
.. 127\.123\.5\.2 *0 7 [^^]*
.. 127\.123\.5\.4 [^^]*$" || test_fail
stop_chronyd || test_fail
test_pass
|