mbox series

[F-oem-5.10/F-oem-5.13,H/I/Unstable,SRU,0/1] selftests: net: devlink_port_split.py: skip the test if no devlink device

Message ID 20210701080442.52267-1-po-hsu.lin@canonical.com
Headers show
Series selftests: net: devlink_port_split.py: skip the test if no devlink device | expand

Message

Po-Hsu Lin July 1, 2021, 8:04 a.m. UTC
[Impact]
If there is no devlink device available, the devlink_port_split.py in
kselftest/net will fail with:
 # selftests: net: devlink_port_split.py
 # Traceback (most recent call last):
 # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 277, in <module>
 # main()
 # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 242, in main
 # dev = list(devs.keys())[0]
 # IndexError: list index out of range
 not ok 43 selftests: net: devlink_port_split.py # exit=1

[Fix]
* 25173dd4093a24 selftests: net: devlink_port_split.py: skip the test
if no devlink device

This test only exist in our source tree since Hirsute, this patch can
be cherry-picked into all affected kernels.

[Test Plan]
Run this test manually from the patched source tree, the test will be
skipped when there is no devlink device:
  # selftests: net: devlink_port_split.py
  # no devlink device was found, test skipped
  ok 7 selftests: net: devlink_port_split.py # SKIP

[Where problems could occur]
Change limited to testing tool, if this change is incorrect it might
cause false-negative result in our test report.


Po-Hsu Lin (1):
  selftests: net: devlink_port_split.py: skip the test if no devlink
    device

 tools/testing/selftests/net/devlink_port_split.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Krzysztof Kozlowski July 1, 2021, 9:29 a.m. UTC | #1
On 01/07/2021 10:04, Po-Hsu Lin wrote:
> [Impact]
> If there is no devlink device available, the devlink_port_split.py in
> kselftest/net will fail with:
>  # selftests: net: devlink_port_split.py
>  # Traceback (most recent call last):
>  # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 277, in <module>
>  # main()
>  # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 242, in main
>  # dev = list(devs.keys())[0]
>  # IndexError: list index out of range
>  not ok 43 selftests: net: devlink_port_split.py # exit=1
> 
> [Fix]
> * 25173dd4093a24 selftests: net: devlink_port_split.py: skip the test
> if no devlink device
> 
> This test only exist in our source tree since Hirsute, this patch can
> be cherry-picked into all affected kernels.
> 
> [Test Plan]
> Run this test manually from the patched source tree, the test will be
> skipped when there is no devlink device:
>   # selftests: net: devlink_port_split.py
>   # no devlink device was found, test skipped
>   ok 7 selftests: net: devlink_port_split.py # SKIP
> 
> [Where problems could occur]
> Change limited to testing tool, if this change is incorrect it might
> cause false-negative result in our test report.
> 
> 
> Po-Hsu Lin (1):
>   selftests: net: devlink_port_split.py: skip the test if no devlink
>     device
> 
>  tools/testing/selftests/net/devlink_port_split.py | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 



Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof
Paolo Pisati July 2, 2021, 2:16 p.m. UTC | #2
On Thu, Jul 01, 2021 at 04:04:41PM +0800, Po-Hsu Lin wrote:
> [Impact]
> If there is no devlink device available, the devlink_port_split.py in
> kselftest/net will fail with:
>  # selftests: net: devlink_port_split.py
>  # Traceback (most recent call last):
>  # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 277, in <module>
>  # main()
>  # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 242, in main
>  # dev = list(devs.keys())[0]
>  # IndexError: list index out of range
>  not ok 43 selftests: net: devlink_port_split.py # exit=1

I upstreamed a similar fix the other day:

https://lore.kernel.org/lkml/162492240312.3183.18165138324418989489.git-patchwork-notify@kernel.org/T/

but yours look nicer, so:

Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
AceLan Kao July 7, 2021, 6:16 a.m. UTC | #3
applied to oem-5.10, thanks
Acked-By: AceLan Kao <acelan.kao@canonical.com>
AceLan Kao July 14, 2021, 9:43 a.m. UTC | #4
applied to oem-5.13, thanks
Acked-By: AceLan Kao <acelan.kao@canonical.com>
Kleber Sacilotto de Souza July 15, 2021, 1:31 p.m. UTC | #5
On 01.07.21 10:04, Po-Hsu Lin wrote:
> [Impact]
> If there is no devlink device available, the devlink_port_split.py in
> kselftest/net will fail with:
>   # selftests: net: devlink_port_split.py
>   # Traceback (most recent call last):
>   # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 277, in <module>
>   # main()
>   # File "/tmp/autopkgtest.ojlWKQ/build.XZw/src/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/net/./devlink_port_split.py", line 242, in main
>   # dev = list(devs.keys())[0]
>   # IndexError: list index out of range
>   not ok 43 selftests: net: devlink_port_split.py # exit=1
> 
> [Fix]
> * 25173dd4093a24 selftests: net: devlink_port_split.py: skip the test
> if no devlink device
> 
> This test only exist in our source tree since Hirsute, this patch can
> be cherry-picked into all affected kernels.
> 
> [Test Plan]
> Run this test manually from the patched source tree, the test will be
> skipped when there is no devlink device:
>    # selftests: net: devlink_port_split.py
>    # no devlink device was found, test skipped
>    ok 7 selftests: net: devlink_port_split.py # SKIP
> 
> [Where problems could occur]
> Change limited to testing tool, if this change is incorrect it might
> cause false-negative result in our test report.
> 
> 
> Po-Hsu Lin (1):
>    selftests: net: devlink_port_split.py: skip the test if no devlink
>      device
> 
>   tools/testing/selftests/net/devlink_port_split.py | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 


Applied to hirsute:linux.

Thanks,
Kleber