RE: [PATCH] selftests: net: devlink_port_split.py: skip the test if no devlink device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Po-Hsu Lin <po-hsu.lin@xxxxxxxxxxxxx>
> Sent: Thursday, May 20, 2021 1:50 PM
> To: linux-kernel@xxxxxxxxxxxxxxx; linux-kselftest@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx
> Cc: po-hsu.lin@xxxxxxxxxxxxx; shuah@xxxxxxxxxx; kuba@xxxxxxxxxx; davem@xxxxxxxxxxxxx; skhan@xxxxxxxxxxxxxxxxxxx
> Subject: [PATCH] selftests: net: devlink_port_split.py: skip the test if no devlink device
> 
> When there is no devlink device, the following command will return:
>   $ devlink -j dev show
>   {dev:{}}
> 
> This will cause IndexError when trying to access the first element in dev of this json dataset. Use the kselftest framework skip code to
> skip this test in this case.
> 
> Example output with this change:
>   # selftests: net: devlink_port_split.py
>   # no devlink device was found, test skipped
>   ok 7 selftests: net: devlink_port_split.py # SKIP
> 
> Link: https://bugs.launchpad.net/bugs/1928889
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@xxxxxxxxxxxxx>

Reviewed-by: Danielle Ratson <danieller@xxxxxxxxxx>





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux