Skip to content

Commit

Permalink
HSR/PRP: Add tests
Browse files Browse the repository at this point in the history
Test setup used:
ip link add link veth1 type veth peer name veth2
ip link set dev veth1 up
ip link set dev veth2 up
ip link add name hsr0 type hsr slave1 veth1 slave2 veth2 version 1 proto 0
ip link set dev hsr0 up

And same but with PRP:
ip link add name prp0 type hsr slave1 veth1 slave2 veth2 proto 1

Supervision frames are automatically sent out by the kernel on HSR/PRP
interfaces.

Signed-off-by: Casper Andersson <[email protected]>
  • Loading branch information
cappe987 committed Feb 1, 2024
1 parent 7f7a2a6 commit 33b82d5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/TESTLIST
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ nhrp-trace nhrp-trace.pcap nhrp-trace.out -v
nhrp nhrp.pcapng nhrp.out -v
pb_nhrp_1 pb_nhrp_1.pcap pb_nhrp_1.out -v

# HSR/PRP tests
hsr hsr.pcap hsr.out -e
prp prp.pcap prp.out -e

# Undefined behavior tests
ip-snmp-leftshift-unsigned ip-snmp-leftshift-unsigned.pcap ip-snmp-leftshift-unsigned.out
ip6-snmp-oid-unsigned ip6-snmp-oid-unsigned.pcap ip6-snmp-oid-unsigned.out
Expand Down
24 changes: 24 additions & 0 deletions tests/hsr.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1 10:27:45.556140 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6787, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
2 10:27:45.556152 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6787, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
3 10:27:46.580164 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6788, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
4 10:27:46.580176 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6788, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
5 10:27:46.900124 7a:32:3c:8c:19:05 > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6789, LanId B, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38836, PathId 0, DANH 7a:32:3c:8c:19:05
6 10:27:46.900137 3a:d6:01:92:63:1d > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6789, LanId A, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38836, PathId 0, DANH 7a:32:3c:8c:19:05
7 10:27:47.604149 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6790, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
8 10:27:47.604158 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6790, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
9 10:27:48.628147 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6791, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
10 10:27:48.628158 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6791, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
11 10:27:48.920143 7a:32:3c:8c:19:05 > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6792, LanId B, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38837, PathId 0, DANH 7a:32:3c:8c:19:05
12 10:27:48.920154 3a:d6:01:92:63:1d > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6792, LanId A, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38837, PathId 0, DANH 7a:32:3c:8c:19:05
13 10:27:49.652077 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6793, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
14 10:27:49.652086 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6793, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
15 10:27:50.676324 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6794, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
16 10:27:50.676332 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6794, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
17 10:27:50.932131 7a:32:3c:8c:19:05 > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6795, LanId B, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38838, PathId 0, DANH 7a:32:3c:8c:19:05
18 10:27:50.932147 3a:d6:01:92:63:1d > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6795, LanId A, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38838, PathId 0, DANH 7a:32:3c:8c:19:05
19 10:27:51.700163 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6796, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
20 10:27:51.700174 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6796, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
21 10:27:52.724026 7a:32:3c:8c:19:05 > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6797, LanId B, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
22 10:27:52.724036 3a:d6:01:92:63:1d > ff:ff:ff:ff:ff:ff, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6797, LanId A, NetId 0, ethertype ARP (0x0806), Request who-has 142.250.74.110 tell 192.168.0.10, length 46
23 10:27:52.948107 7a:32:3c:8c:19:05 > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6798, LanId B, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38839, PathId 0, DANH 7a:32:3c:8c:19:05
24 10:27:52.948116 3a:d6:01:92:63:1d > 01:15:4e:00:01:00, ethertype HSR (0x892f), length 66: LSDUsize 52, SeqNr 6798, LanId A, NetId 0, ethertype HSR/PRP Supervision (0x88fb), Version 1, SeqNr 38839, PathId 0, DANH 7a:32:3c:8c:19:05
Binary file added tests/hsr.pcap
Binary file not shown.
14 changes: 14 additions & 0 deletions tests/prp.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
1 10:34:30.580215 c6:81:06:cb:35:98 > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3263, LanId A, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
2 10:34:30.580224 b2:f0:66:9b:81:1c > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3263, LanId B, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
3 10:34:31.028126 c6:81:06:cb:35:98 > 01:15:4e:00:01:00, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3264, LanId A, ethertype HSR/PRP Supervision (0x88fb), length 66: Version 1, SeqNr 36486, PathId 0, VDAN/DANP c6:81:06:cb:35:98
4 10:34:31.028135 b2:f0:66:9b:81:1c > 01:15:4e:00:01:00, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3264, LanId B, ethertype HSR/PRP Supervision (0x88fb), length 66: Version 1, SeqNr 36486, PathId 0, VDAN/DANP c6:81:06:cb:35:98
5 10:34:31.604157 c6:81:06:cb:35:98 > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3265, LanId A, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
6 10:34:31.604167 b2:f0:66:9b:81:1c > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3265, LanId B, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
7 10:34:32.628138 c6:81:06:cb:35:98 > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3266, LanId A, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
8 10:34:32.628148 b2:f0:66:9b:81:1c > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3266, LanId B, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
9 10:34:33.044029 c6:81:06:cb:35:98 > 01:15:4e:00:01:00, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3267, LanId A, ethertype HSR/PRP Supervision (0x88fb), length 66: Version 1, SeqNr 36487, PathId 0, VDAN/DANP c6:81:06:cb:35:98
10 10:34:33.044039 b2:f0:66:9b:81:1c > 01:15:4e:00:01:00, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3267, LanId B, ethertype HSR/PRP Supervision (0x88fb), length 66: Version 1, SeqNr 36487, PathId 0, VDAN/DANP c6:81:06:cb:35:98
11 10:34:33.652277 c6:81:06:cb:35:98 > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3268, LanId A, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
12 10:34:33.652284 b2:f0:66:9b:81:1c > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3268, LanId B, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
13 10:34:34.676144 c6:81:06:cb:35:98 > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3269, LanId A, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
14 10:34:34.676155 b2:f0:66:9b:81:1c > ff:ff:ff:ff:ff:ff, PRP trailer (0x88fb), LSDUsize 52, SeqNr 3269, LanId B, ethertype ARP (0x0806), length 66: Request who-has 142.250.74.142 tell 192.168.0.10, length 52
Binary file added tests/prp.pcap
Binary file not shown.

0 comments on commit 33b82d5

Please sign in to comment.