diff mbox series

[act] UBUNTU SAUCE: ubuntu_kernel_selftests: keep executing selftests even if selftests/bpf fail to build

Message ID 20210610164044.91134-1-paolo.pisati@canonical.com
State New
Headers show
Series [act] UBUNTU SAUCE: ubuntu_kernel_selftests: keep executing selftests even if selftests/bpf fail to build | expand

Commit Message

Paolo Pisati June 10, 2021, 4:40 p.m. UTC
On recent kernel releases (5.13+), kernel selftests/bpf depends on an
unreleased clang version (clang-13) and FTBFS otherwise: make selftests
continue even if selftests/bpf fail to build.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 ubuntu_kernel_selftests/ubuntu_kernel_selftests.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andrea Righi June 11, 2021, 7:35 a.m. UTC | #1
On Thu, Jun 10, 2021 at 06:40:44PM +0200, Paolo Pisati wrote:
> On recent kernel releases (5.13+), kernel selftests/bpf depends on an
> unreleased clang version (clang-13) and FTBFS otherwise: make selftests
> continue even if selftests/bpf fail to build.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>

Simple and clean way to prevent lots of false-positive test failures.
Looks good to me.

Acked-by: Andrea Righi <andrea.righi@canonical.com>

> ---
>  ubuntu_kernel_selftests/ubuntu_kernel_selftests.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
> index 0f4c46d2..a4b38a0b 100644
> --- a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
> +++ b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
> @@ -223,7 +223,8 @@ class ubuntu_kernel_selftests(test.test):
>                  os.environ["LLVM_OBJCOPY"] = "llvm-objcopy-9"
>                  os.environ["LLVM_READELF"] = "llvm-readelf-9"
>              cmd = "make -C linux/tools/testing/selftests TARGETS=bpf SKIP_TARGETS= KDIR=/usr/src/linux-headers-{}".format(platform.release())
> -            utils.system(cmd)
> +            # keep running selftests/net, even if selftests/bpf build fails
> +            utils.system(cmd, ignore_status=True)
>          cmd = "sudo make -C linux/tools/testing/selftests TARGETS=%s run_tests" % test_name
>          self.results = utils.system_output(cmd, retain_output=True)
>  
> -- 
> 2.31.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Po-Hsu Lin June 11, 2021, 10:56 a.m. UTC | #2
I tried to start the net test without building bpf,
it looks like we just need bpf for these two tests:

# selftests: net: udpgro_bench.sh
# Missing xdp_dummy helper. Build bpf selftest first
not ok 23 selftests: net: udpgro_bench.sh # exit=255
# selftests: net: udpgro.sh
# Missing xdp_dummy helper. Build bpf selftest first
not ok 24 selftests: net: udpgro.sh # exit=255

So +1 on this reasonable fix, we don't need to miss the whole net
tests just because of these two.

(Maybe we can make it just build the needed helpler in the future.)

Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Applied and pushed.


Thanks
Sam
diff mbox series

Patch

diff --git a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
index 0f4c46d2..a4b38a0b 100644
--- a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
+++ b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
@@ -223,7 +223,8 @@  class ubuntu_kernel_selftests(test.test):
                 os.environ["LLVM_OBJCOPY"] = "llvm-objcopy-9"
                 os.environ["LLVM_READELF"] = "llvm-readelf-9"
             cmd = "make -C linux/tools/testing/selftests TARGETS=bpf SKIP_TARGETS= KDIR=/usr/src/linux-headers-{}".format(platform.release())
-            utils.system(cmd)
+            # keep running selftests/net, even if selftests/bpf build fails
+            utils.system(cmd, ignore_status=True)
         cmd = "sudo make -C linux/tools/testing/selftests TARGETS=%s run_tests" % test_name
         self.results = utils.system_output(cmd, retain_output=True)