Skip to content

Commit df7cf5c

Browse files
vladimirolteandavem330
authored andcommitted
selftests: net: local_termination: parameterize test name
There are upcoming tests which verify the RX filtering of a bridge (or bridge port), but under differing vlan_filtering conditions. Since we currently print $h2 (the DUT) in the log_test() output, it becomes necessary to make a further distinction between tests, to not give the user the impression that the exact same thing is run twice. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4261fa3 commit df7cf5c

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

tools/testing/selftests/net/forwarding/local_termination.sh

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ send_uc_ipv4()
6868

6969
check_rcv()
7070
{
71-
local if_name=$1
72-
local type=$2
73-
local pattern=$3
74-
local should_receive=$4
71+
local if_name=$1; shift
72+
local type=$1; shift
73+
local pattern=$1; shift
74+
local should_receive=$1; shift
75+
local test_name="$1"; shift
7576
local should_fail=
7677

7778
[ $should_receive = true ] && should_fail=0 || should_fail=1
@@ -81,7 +82,7 @@ check_rcv()
8182

8283
check_err_fail "$should_fail" "$?" "reception"
8384

84-
log_test "$if_name: $type"
85+
log_test "$test_name: $type"
8586
}
8687

8788
mc_route_prepare()
@@ -106,6 +107,7 @@ run_test()
106107
{
107108
local send_if_name=$1; shift
108109
local rcv_if_name=$1; shift
110+
local test_name="$1"; shift
109111
local smac=$(mac_get $send_if_name)
110112
local rcv_dmac=$(mac_get $rcv_if_name)
111113

@@ -150,61 +152,61 @@ run_test()
150152

151153
check_rcv $rcv_if_name "Unicast IPv4 to primary MAC address" \
152154
"$smac > $rcv_dmac, ethertype IPv4 (0x0800)" \
153-
true
155+
true "$test_name"
154156

155157
check_rcv $rcv_if_name "Unicast IPv4 to macvlan MAC address" \
156158
"$smac > $MACVLAN_ADDR, ethertype IPv4 (0x0800)" \
157-
true
159+
true "$test_name"
158160

159161
xfail_on_veth $h1 \
160162
check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \
161163
"$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \
162-
false
164+
false "$test_name"
163165

164166
check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address, promisc" \
165167
"$smac > $UNKNOWN_UC_ADDR2, ethertype IPv4 (0x0800)" \
166-
true
168+
true "$test_name"
167169

168170
xfail_on_veth $h1 \
169171
check_rcv $rcv_if_name \
170172
"Unicast IPv4 to unknown MAC address, allmulti" \
171173
"$smac > $UNKNOWN_UC_ADDR3, ethertype IPv4 (0x0800)" \
172-
false
174+
false "$test_name"
173175

174176
check_rcv $rcv_if_name "Multicast IPv4 to joined group" \
175177
"$smac > $JOINED_MACV4_MC_ADDR, ethertype IPv4 (0x0800)" \
176-
true
178+
true "$test_name"
177179

178180
xfail_on_veth $h1 \
179181
check_rcv $rcv_if_name \
180182
"Multicast IPv4 to unknown group" \
181183
"$smac > $UNKNOWN_MACV4_MC_ADDR1, ethertype IPv4 (0x0800)" \
182-
false
184+
false "$test_name"
183185

184186
check_rcv $rcv_if_name "Multicast IPv4 to unknown group, promisc" \
185187
"$smac > $UNKNOWN_MACV4_MC_ADDR2, ethertype IPv4 (0x0800)" \
186-
true
188+
true "$test_name"
187189

188190
check_rcv $rcv_if_name "Multicast IPv4 to unknown group, allmulti" \
189191
"$smac > $UNKNOWN_MACV4_MC_ADDR3, ethertype IPv4 (0x0800)" \
190-
true
192+
true "$test_name"
191193

192194
check_rcv $rcv_if_name "Multicast IPv6 to joined group" \
193195
"$smac > $JOINED_MACV6_MC_ADDR, ethertype IPv6 (0x86dd)" \
194-
true
196+
true "$test_name"
195197

196198
xfail_on_veth $h1 \
197199
check_rcv $rcv_if_name "Multicast IPv6 to unknown group" \
198200
"$smac > $UNKNOWN_MACV6_MC_ADDR1, ethertype IPv6 (0x86dd)" \
199-
false
201+
false "$test_name"
200202

201203
check_rcv $rcv_if_name "Multicast IPv6 to unknown group, promisc" \
202204
"$smac > $UNKNOWN_MACV6_MC_ADDR2, ethertype IPv6 (0x86dd)" \
203-
true
205+
true "$test_name"
204206

205207
check_rcv $rcv_if_name "Multicast IPv6 to unknown group, allmulti" \
206208
"$smac > $UNKNOWN_MACV6_MC_ADDR3, ethertype IPv6 (0x86dd)" \
207-
true
209+
true "$test_name"
208210

209211
tcpdump_cleanup $rcv_if_name
210212
}

0 commit comments

Comments
 (0)