Skip to content

Commit b0e9c3b

Browse files
Sebastian Andrzej Siewiordavem330
authored andcommitted
selftests: hsr: Extend the testsuite to also cover HSRv1.
The testsuite already has simply tests for HSRv0. The testuite would have been able to notice the v1 breakage if it was there at the time. Extend the testsuite to also cover HSRv1. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d53f23f commit b0e9c3b

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

tools/testing/selftests/net/hsr/hsr_ping.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ do_complete_ping_test()
203203

204204
setup_hsr_interfaces()
205205
{
206-
echo "INFO: preparing interfaces."
206+
local HSRv="$1"
207+
208+
echo "INFO: preparing interfaces for HSRv${HSRv}."
207209
# Three HSR nodes. Each node has one link to each of its neighbour, two links in total.
208210
#
209211
# ns1eth1 ----- ns2eth1
@@ -219,10 +221,10 @@ setup_hsr_interfaces()
219221
ip link add ns1eth2 netns "$ns1" type veth peer name ns3eth1 netns "$ns3"
220222
ip link add ns3eth2 netns "$ns3" type veth peer name ns2eth2 netns "$ns2"
221223

222-
# HSRv0.
223-
ip -net "$ns1" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version 0 proto 0
224-
ip -net "$ns2" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 supervision 45 version 0 proto 0
225-
ip -net "$ns3" link add name hsr3 type hsr slave1 ns3eth1 slave2 ns3eth2 supervision 45 version 0 proto 0
224+
# HSRv0/1
225+
ip -net "$ns1" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version $HSRv proto 0
226+
ip -net "$ns2" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 supervision 45 version $HSRv proto 0
227+
ip -net "$ns3" link add name hsr3 type hsr slave1 ns3eth1 slave2 ns3eth2 supervision 45 version $HSRv proto 0
226228

227229
# IP for HSR
228230
ip -net "$ns1" addr add 100.64.0.1/24 dev hsr1
@@ -259,7 +261,16 @@ for i in "$ns1" "$ns2" "$ns3" ;do
259261
ip -net $i link set lo up
260262
done
261263

262-
setup_hsr_interfaces
264+
setup_hsr_interfaces 0
265+
do_complete_ping_test
266+
cleanup
267+
268+
for i in "$ns1" "$ns2" "$ns3" ;do
269+
ip netns add $i || exit $ksft_skip
270+
ip -net $i link set lo up
271+
done
272+
273+
setup_hsr_interfaces 1
263274
do_complete_ping_test
264275

265276
exit $ret

0 commit comments

Comments
 (0)