Skip to content

Commit 56e2ef5

Browse files
Yujie-Liurli9
authored andcommitted
programs/kernel-selftests/parse: handle duplicate sub tests in test_vxlan_mdb
The patch "[PATCH net-next 9/9] selftests: vxlan_mdb: Add MDB bulk deletion test" introduces a new net selftest called flush. There are some different sub tests but they have the same name in the test summary. Not sure what is the proper name to tell them apart, here just name the duplicate sub test with a "_1" suffix to differentiate them. linux/tools/testing/selftests/net$ vim test_vxlan_mdb.sh run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \"dst_port 22222\"" log_test $? 0 "Flush by unspecified UDP destination port" run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.2" log_test $? 0 "Flush by unspecified UDP destination port" run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep \" vni 20011\"" log_test $? 0 "Flush by unspecified destination VNI" run_cmd "bridge -n $ns1_v4 -d -s mdb get dev vx0 grp 239.1.1.1 src_vni 10010 | grep 198.51.100.2" log_test $? 0 "Flush by unspecified destination VNI" Add corresponding spec to cover this case. Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Yujie Liu <[email protected]> Signed-off-by: Philip Li <[email protected]>
1 parent fe6af29 commit 56e2ef5

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

programs/kernel-selftests/parse

+21
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,27 @@ class NetStater < Stater
184184
if @test_script == 'test_vxlan_mdb.sh'
185185
# selftests: net: test_vxlan_mdb.sh
186186
case line
187+
when /^# TEST: (Flush by unspecified UDP destination port)\s+\[\s*(OK|FAIL|SKIP)\s*\]/,
188+
/^# TEST: (Flush by unspecified destination VNI)\s+\[\s*(OK|FAIL|SKIP)\s*\]/
189+
# Control path: Flush
190+
# -------------------
191+
# TEST: Flush by unspecified destination IP - IPv6 [ OK ]
192+
# TEST: Flush by specified UDP destination port [ OK ]
193+
# TEST: Flush by unspecified UDP destination port [ OK ] <--
194+
# TEST: Flush by device's UDP destination port [ OK ]
195+
# TEST: Flush by unspecified UDP destination port [ OK ] <--
196+
# TEST: Flush by specified destination VNI [ OK ]
197+
# TEST: Flush by specified destination VNI [ OK ]
198+
# TEST: Flush by unspecified destination VNI [ OK ] <--
199+
# TEST: Flush by destination VNI equal to source VNI [ OK ]
200+
# TEST: Flush by unspecified destination VNI [ OK ] <--
201+
# TEST: Flush by VLAN ID [ OK ]
202+
stat_name = "#{@test_prefix}.#{@test_case}.#{$1}"
203+
if stats.key? stat_name
204+
stats.add "#{stat_name}_1", $2
205+
else
206+
stats.add stat_name, $2
207+
end
187208
when /^# TEST: (.+?)\s+\[\s*(OK|FAIL|SKIP)\s*\]/
188209
# TEST: IP multicast - first VTEP [ OK ]
189210
stats.add "#{@test_prefix}.#{@test_case}.#{$1}", $2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# timeout set to 3600
2+
# selftests: net: test_vxlan_mdb.sh
3+
#
4+
# Control path: Flush
5+
# -------------------
6+
# TEST: Flush all [ OK ]
7+
# TEST: Flush by port [ OK ]
8+
# TEST: Flush by wrong port [ OK ]
9+
# TEST: Flush by specified source VNI [ OK ]
10+
# TEST: Flush by unspecified source VNI [ OK ]
11+
# TEST: Flush by "permanent" state [ OK ]
12+
# TEST: Flush by "nopermanent" state [ OK ]
13+
# TEST: Flush by specified routing protocol [ OK ]
14+
# TEST: Flush by unspecified routing protocol [ OK ]
15+
# TEST: Flush by specified destination IP - IPv4 [ OK ]
16+
# TEST: Flush by unspecified destination IP - IPv4 [ OK ]
17+
# TEST: Flush by specified destination IP - IPv6 [ OK ]
18+
# TEST: Flush by unspecified destination IP - IPv6 [ OK ]
19+
# TEST: Flush by specified UDP destination port [ OK ]
20+
# TEST: Flush by unspecified UDP destination port [ OK ]
21+
# TEST: Flush by device's UDP destination port [ OK ]
22+
# TEST: Flush by unspecified UDP destination port [ OK ]
23+
# TEST: Flush by specified destination VNI [ OK ]
24+
# TEST: Flush by unspecified destination VNI [ OK ]
25+
# TEST: Flush by destination VNI equal to source VNI [ OK ]
26+
# TEST: Flush by unspecified destination VNI [ OK ]
27+
# TEST: Flush by VLAN ID [ OK ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_all.pass: 1
2+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_port.pass: 1
3+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_wrong_port.pass: 1
4+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_specified_source_VNI.pass: 1
5+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_source_VNI.pass: 1
6+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_permanent_state.pass: 1
7+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_nopermanent_state.pass: 1
8+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_specified_routing_protocol.pass: 1
9+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_routing_protocol.pass: 1
10+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_specified_destination_IP_-_IPv4.pass: 1
11+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_destination_IP_-_IPv4.pass: 1
12+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_specified_destination_IP_-_IPv6.pass: 1
13+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_destination_IP_-_IPv6.pass: 1
14+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_specified_UDP_destination_port.pass: 1
15+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_UDP_destination_port.pass: 1
16+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_device's_UDP_destination_port.pass: 1
17+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_UDP_destination_port_1.pass: 1
18+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_specified_destination_VNI.pass: 1
19+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_destination_VNI.pass: 1
20+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_destination_VNI_equal_to_source_VNI.pass: 1
21+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_unspecified_destination_VNI_1.pass: 1
22+
net.test_vxlan_mdb.sh.Control_path_Flush.Flush_by_VLAN_ID.pass: 1

0 commit comments

Comments
 (0)