Commit df7cf5cc authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4261fa35
...@@ -68,10 +68,11 @@ send_uc_ipv4() ...@@ -68,10 +68,11 @@ send_uc_ipv4()
check_rcv() check_rcv()
{ {
local if_name=$1 local if_name=$1; shift
local type=$2 local type=$1; shift
local pattern=$3 local pattern=$1; shift
local should_receive=$4 local should_receive=$1; shift
local test_name="$1"; shift
local should_fail= local should_fail=
[ $should_receive = true ] && should_fail=0 || should_fail=1 [ $should_receive = true ] && should_fail=0 || should_fail=1
...@@ -81,7 +82,7 @@ check_rcv() ...@@ -81,7 +82,7 @@ check_rcv()
check_err_fail "$should_fail" "$?" "reception" check_err_fail "$should_fail" "$?" "reception"
log_test "$if_name: $type" log_test "$test_name: $type"
} }
mc_route_prepare() mc_route_prepare()
...@@ -106,6 +107,7 @@ run_test() ...@@ -106,6 +107,7 @@ run_test()
{ {
local send_if_name=$1; shift local send_if_name=$1; shift
local rcv_if_name=$1; shift local rcv_if_name=$1; shift
local test_name="$1"; shift
local smac=$(mac_get $send_if_name) local smac=$(mac_get $send_if_name)
local rcv_dmac=$(mac_get $rcv_if_name) local rcv_dmac=$(mac_get $rcv_if_name)
...@@ -150,61 +152,61 @@ run_test() ...@@ -150,61 +152,61 @@ run_test()
check_rcv $rcv_if_name "Unicast IPv4 to primary MAC address" \ check_rcv $rcv_if_name "Unicast IPv4 to primary MAC address" \
"$smac > $rcv_dmac, ethertype IPv4 (0x0800)" \ "$smac > $rcv_dmac, ethertype IPv4 (0x0800)" \
true true "$test_name"
check_rcv $rcv_if_name "Unicast IPv4 to macvlan MAC address" \ check_rcv $rcv_if_name "Unicast IPv4 to macvlan MAC address" \
"$smac > $MACVLAN_ADDR, ethertype IPv4 (0x0800)" \ "$smac > $MACVLAN_ADDR, ethertype IPv4 (0x0800)" \
true true "$test_name"
xfail_on_veth $h1 \ xfail_on_veth $h1 \
check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \ check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \
"$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \ "$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \
false false "$test_name"
check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address, promisc" \ check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address, promisc" \
"$smac > $UNKNOWN_UC_ADDR2, ethertype IPv4 (0x0800)" \ "$smac > $UNKNOWN_UC_ADDR2, ethertype IPv4 (0x0800)" \
true true "$test_name"
xfail_on_veth $h1 \ xfail_on_veth $h1 \
check_rcv $rcv_if_name \ check_rcv $rcv_if_name \
"Unicast IPv4 to unknown MAC address, allmulti" \ "Unicast IPv4 to unknown MAC address, allmulti" \
"$smac > $UNKNOWN_UC_ADDR3, ethertype IPv4 (0x0800)" \ "$smac > $UNKNOWN_UC_ADDR3, ethertype IPv4 (0x0800)" \
false false "$test_name"
check_rcv $rcv_if_name "Multicast IPv4 to joined group" \ check_rcv $rcv_if_name "Multicast IPv4 to joined group" \
"$smac > $JOINED_MACV4_MC_ADDR, ethertype IPv4 (0x0800)" \ "$smac > $JOINED_MACV4_MC_ADDR, ethertype IPv4 (0x0800)" \
true true "$test_name"
xfail_on_veth $h1 \ xfail_on_veth $h1 \
check_rcv $rcv_if_name \ check_rcv $rcv_if_name \
"Multicast IPv4 to unknown group" \ "Multicast IPv4 to unknown group" \
"$smac > $UNKNOWN_MACV4_MC_ADDR1, ethertype IPv4 (0x0800)" \ "$smac > $UNKNOWN_MACV4_MC_ADDR1, ethertype IPv4 (0x0800)" \
false false "$test_name"
check_rcv $rcv_if_name "Multicast IPv4 to unknown group, promisc" \ check_rcv $rcv_if_name "Multicast IPv4 to unknown group, promisc" \
"$smac > $UNKNOWN_MACV4_MC_ADDR2, ethertype IPv4 (0x0800)" \ "$smac > $UNKNOWN_MACV4_MC_ADDR2, ethertype IPv4 (0x0800)" \
true true "$test_name"
check_rcv $rcv_if_name "Multicast IPv4 to unknown group, allmulti" \ check_rcv $rcv_if_name "Multicast IPv4 to unknown group, allmulti" \
"$smac > $UNKNOWN_MACV4_MC_ADDR3, ethertype IPv4 (0x0800)" \ "$smac > $UNKNOWN_MACV4_MC_ADDR3, ethertype IPv4 (0x0800)" \
true true "$test_name"
check_rcv $rcv_if_name "Multicast IPv6 to joined group" \ check_rcv $rcv_if_name "Multicast IPv6 to joined group" \
"$smac > $JOINED_MACV6_MC_ADDR, ethertype IPv6 (0x86dd)" \ "$smac > $JOINED_MACV6_MC_ADDR, ethertype IPv6 (0x86dd)" \
true true "$test_name"
xfail_on_veth $h1 \ xfail_on_veth $h1 \
check_rcv $rcv_if_name "Multicast IPv6 to unknown group" \ check_rcv $rcv_if_name "Multicast IPv6 to unknown group" \
"$smac > $UNKNOWN_MACV6_MC_ADDR1, ethertype IPv6 (0x86dd)" \ "$smac > $UNKNOWN_MACV6_MC_ADDR1, ethertype IPv6 (0x86dd)" \
false false "$test_name"
check_rcv $rcv_if_name "Multicast IPv6 to unknown group, promisc" \ check_rcv $rcv_if_name "Multicast IPv6 to unknown group, promisc" \
"$smac > $UNKNOWN_MACV6_MC_ADDR2, ethertype IPv6 (0x86dd)" \ "$smac > $UNKNOWN_MACV6_MC_ADDR2, ethertype IPv6 (0x86dd)" \
true true "$test_name"
check_rcv $rcv_if_name "Multicast IPv6 to unknown group, allmulti" \ check_rcv $rcv_if_name "Multicast IPv6 to unknown group, allmulti" \
"$smac > $UNKNOWN_MACV6_MC_ADDR3, ethertype IPv6 (0x86dd)" \ "$smac > $UNKNOWN_MACV6_MC_ADDR3, ethertype IPv6 (0x86dd)" \
true true "$test_name"
tcpdump_cleanup $rcv_if_name tcpdump_cleanup $rcv_if_name
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment