forked from mlichvar/linuxptp-testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
12-phc2sys
executable file
·75 lines (58 loc) · 1.56 KB
/
12-phc2sys
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
#!/bin/bash
. test.common
test_start "phc2sys"
nodes=1
master_nodes="0"
phc2sys_node=1
phc2sys_conf="-O 0 -s /dev/ptp0"
run_test || test_fail
check_sync || test_fail
time_max_limit=1e-8
phc2sys_conf="-O 0 -d /dev/pps0"
run_test || test_fail
check_sync || test_fail
phc2sys_conf="-O 0 -s /dev/ptp0 -d /dev/pps0"
run_test || test_fail
check_sync || test_fail
nodes=3
subnets="1 2 3 | 1 2 3"
master_nodes="1"
master_conf="utc_offset 30"
refclock_offset="-30"
phc2sys_node=3
phc2sys_uds="2:1"
phc2sys_phc_base=2
phc2sys_phc_swap=1
time_max_limit=$default_time_max_limit
phc2sys_conf="-w -s eth0"
run_test || test_fail
check_sync || test_fail
phc2sys_conf="-a -r"
# network down at 150-250 in subnet 1 and 100-200 in subnet 2
base_delay=$(cat <<-EOF | tr -d '\n'
(+ $default_base_delay
(* -1
(equal 0.6 subnet 1.5)
(equal 0.1 (min (+ time (* subnet 50) -100) 100) 100)
(equal 0.1 (max (+ time (* subnet 50) -100) 200) 200)))
EOF
)
# step at 170th second
slave_step="(* $time_offset (equal 0.1 (sum 1.0) 170))"
min_sync_time=215
max_sync_time=240
run_test || test_fail
check_sync || test_fail
nodes=4
subnets="1 2 4 | 1 3 4"
phc2sys_node=4
phc2sys_phc_base=3
phc2sys_uds="3:1 2:1"
max_sync_time=290
run_test || test_fail
check_sync || test_fail
check_any_log_message 4 "\[[12].\..*select.*out-of-domain" "eth1" || test_fail
check_any_log_message 4 "\[10.\..*select.*out-of-domain" "eth0" || test_fail
check_any_log_message 4 "\[20.\..*select.*out-of-domain" "eth1" || test_fail
check_any_log_message 4 "\[25.\..*select.*out-of-domain" "eth1" || test_fail
test_pass