summaryrefslogtreecommitdiffstats
path: root/test/simulation/142-ptpport
blob: 060932cbde6838e54b088c3c276ae797d246bde7 (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
#!/usr/bin/env bash

. ./test.common

test_start "PTP port"

# Block communication between 3 and 1
base_delay="(+ 1e-4 (* -1 (equal 0.1 from 3) (equal 0.1 to 1)))"

cat > tmp/peer.keys <<-EOF
1 MD5 1234567890
EOF

clients=2
peers=2
max_sync_time=420

server_conf="
ptpport 319"
client_conf="
ptpport 319
authselectmode ignore
keyfile tmp/peer.keys"
client_server_options="minpoll 6 maxpoll 6 port 319"
client_peer_options="minpoll 6 maxpoll 6 port 319 key 1"

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

check_file_messages "	2	1	.*	319	319	1	96	" 150 160 \
	log.packets || test_fail
check_file_messages "	1	2	.*	319	319	1	96	" 150 160 \
	log.packets || test_fail
check_file_messages "	2	3	.*	319	319	1	116	" 150 160 \
	log.packets || test_fail
check_file_messages "	3	2	.*	319	319	1	116	" 150 160 \
	log.packets || test_fail

test_pass