forked from mlichvar/linuxptp-testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
35-auth
executable file
·83 lines (70 loc) · 1.94 KB
/
35-auth
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
83
#!/bin/bash
. test.common
test_start "ptp4l with authentication"
if ! pmc --spp 1 --sa_file /dev/null -i lo |& grep -q 'sad is empty'; then
echo "Missing authentication support"
exit 0
fi
cat > tmp/sa1.conf <<-EOF
[security_association]
spp 10
1 AES128 HEX:FAF48EBA01E7C5966A76CB787AED4E7B
2 AES256 B64:PKTF9VQz94qPaoAzW4eE3JtFoQ8Ov1OTQSojalWyMbs=
3 SHA256-128 HEX:EE91D469B3A8ADC6AC8EB28E21794C706E08FDE48863828A7B0281AFCA81B17D
4 SHA256 26 abcdefghijklmnopqrstuvwxyz
EOF
cat > tmp/sa2.conf <<-EOF
[security_association]
spp 10
1 AES128 HEX:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2 AES256 B64:PKTF9VQz94qPaoAzW4eE3JtFoQ8Ov1OTQSojalWyMbs=
3 SHA256-128 HEX:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
4 SHA256 32 HEX:CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
EOF
nodes=4
pmc_node=4
transparent_nodes="2"
subnets="1 2 | 2 3 4 | 1 3 | 1 3 | 1 3"
# don't break order of messages received by pmc
jitter="(* $default_jitter (equal 5.1 subnet 0))"
master_conf="spp 10
sa_file tmp/sa1.conf
active_key_id 1
[eth2]
active_key_id 2
[eth3]
active_key_id 3
[eth4]
active_key_id 4"
slave_conf="$master_conf"
transparent_conf="spp 10
sa_file tmp/sa1.conf
active_key_id 1
clock_type E2E_TC"
pmc_conf="GET PORT_DATA_SET"
pmc_uds="3:1"
extra_pmc_options="--spp 10 --sa_file tmp/sa1.conf --active_key_id 1"
log_packets=1
run_ptp4l || test_fail
check_sync || test_fail
check_pmc_output ".*portState SLAVE
.*portState PASSIVE
.*portState PASSIVE
.*portState PASSIVE" || test_fail
slave_conf="spp 10
sa_file tmp/sa2.conf
active_key_id 2
[eth2]
active_key_id 3
[eth3]
active_key_id 4
[eth4]
active_key_id 1"
extra_pmc_options="--spp 10 --sa_file tmp/sa2.conf --active_key_id 2"
run_ptp4l || test_fail
check_sync && test_fail
check_pmc_output ".*portState MASTER
.*portState UNCALIBRATED
.*portState MASTER
.*portState MASTER" || test_fail
test_pass