[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9dbaae62-fc18-4f87-a6a9-8226e7266473@ti.com>
Date: Tue, 5 Nov 2024 16:44:43 +0530
From: MD Danish Anwar <danishanwar@...com>
To: Paolo Abeni <pabeni@...hat.com>, <geliang@...nel.org>,
<liuhangbin@...il.com>, <dan.carpenter@...aro.org>, <jiri@...nulli.us>,
<n.zhandarovich@...tech.ru>, <aleksander.lobakin@...el.com>,
<lukma@...x.de>, <horms@...nel.org>, <jan.kiszka@...mens.com>,
<diogo.ivo@...mens.com>, <shuah@...nel.org>, <kuba@...nel.org>,
<edumazet@...gle.com>, <davem@...emloft.net>, <andrew+netdev@...n.ch>
CC: <linux-kselftest@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<srk@...com>, Vignesh Raghavendra <vigneshr@...com>,
Roger Quadros
<rogerq@...nel.org>, <m-malladi@...com>
Subject: Re: [PATCH net-next v2 4/4] selftests: hsr: Add test for VLAN
On 31/10/24 8:11 pm, Paolo Abeni wrote:
> On 10/24/24 12:30, MD Danish Anwar wrote:
>> @@ -183,9 +232,21 @@ trap cleanup_all_ns EXIT
>> setup_hsr_interfaces 0
>> do_complete_ping_test
>>
>> +# Run VLAN Test
>> +if $vlan; then
>> + setup_vlan_interfaces
>> + hsr_vlan_ping
>> +fi
>> +
>> setup_ns ns1 ns2 ns3
>>
>> setup_hsr_interfaces 1
>> do_complete_ping_test
>>
>> +# Run VLAN Test
>> +if $vlan; then
>> + setup_vlan_interfaces
>> + hsr_vlan_ping
>> +fi
>
> The new tests should be enabled by default. Indeed ideally the test
> script should be able to run successfully on kernel not supporting such
> feature; you could cope with that looking for the hsr exposed feature
> and skipping the vlan test when the relevant feature is not present.
>
Sure Paolo, I will make the new tests enabled by default. During the
test I will check the exposed feature `ethtool -k hsr1 | grep
"vlan-challenged"` and if vlan is not supported, skip the vlan test.
Below will be my API to run VLAN tests,
run_vlan_tests() {
vlan_challenged_hsr1=$(ip net exec "$ns1" ethtool -k hsr1 | grep
"vlan-challenged" | awk '{print $2}')
vlan_challenged_hsr2=$(ip net exec "$ns1" ethtool -k hsr2 | grep
"vlan-challenged" | awk '{print $2}')
vlan_challenged_hsr3=$(ip net exec "$ns1" ethtool -k hsr3 | grep
"vlan-challenged" | awk '{print $2}')
if [[ "$vlan_challenged_hsr1" = "off" || "$vlan_challenged_hsr2" =
"off" || "$vlan_challenged_hsr3" = "off" ]]; then
setup_vlan_interfaces
hsr_vlan_ping
else
echo "INFO: Not Running VLAN tests as the device does not support VLAN"
fi
}
I will call this function after the ping test.
Let me know if this looks okay to you.
Thanks for the review.
> Cheers,
>
> Paolo
>
--
Thanks and Regards,
Danish
Powered by blists - more mailing lists