selftests/mincore: fix skip condition for check_huge_pages test
PATCH 1/1 selftests/mincore: fix skip condition for check_huge_pages test
The check_huge_pages test was failing instead of skipping on qemu-armv7 because the skip condition wasn't handled properly. Add an additional check to fix it.
--- tools/testing/selftests/mincore/mincore_selftest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/mincore/mincore_selftest.c +2 -2
@@ -150,8 +149,8 @@ TEST(check_huge_pages)MAP_PRIVATE |MAP_ANONYMOUS |MAP_HUGETLB , -1, 0);if (addr ==MAP_FAILED ) { -if (errno ==ENOMEM ) -SKIP (return,"No huge pages available." ); +if (errno ==ENOMEM || errno ==EINVAL ) +SKIP (return,"No huge pages available or CONFIG_HUGETLB_PAGE disabled." );else TH_LOG ("mmap error: %s" ,strerror (errno)); }
Signature · 1 line
2.25.1
Quoted 8 lines · Ricardo Cañuelo
The
check_huge_pagestest was failing instead of skipping on qemu-armv7 because the skip condition wasn't handled properly. Add an additional check to fix it.
This is how I tested it on Linux next tag: next-20230516. Installed tuxmake [1], and tuxrun [2].
$ tuxmake --runtime podman --target-arch arm --toolchain gcc-12 \ --kconfig defconfig \ --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/lkft.config \ --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/systemd.config \ --kconfig-add CONFIG_ARM_TI_CPUFREQ=y --kconfig-add CONFIG_SERIAL_8250_OMAP=y --kconfig-add CONFIG_POSIX_MQUEUE=y \ --kconfig-add CONFIG_OF=y --kconfig-add CONFIG_SYN_COOKIES=y--kconfig-add CONFIG_SCHEDSTATS=y --kconfig-add CONFIG_AHCI_DWC=y \ dtbs dtbs-legacy headers kernel kselftest modules \ --results-hook "tuxrun --runtime podman --device qemu-armv7 --boot-args rw --tuxmake ./ --rootfs https://storage.tuxboot.com/debian/bookworm/armhf/rootfs.ext4.xz --parameters SKIPFILE=skipfile-lkft.yaml --parameters KSELFTEST='\$BUILD'/kselftest.tar.xz --tests kselftest-mincore --timeouts boot=30"
Cheers,
Anders
[1] https://tuxmake.org/
[2] https://tuxrun.org/
Quoted 22 lines
--- tools/testing/selftests/mincore/mincore_selftest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tools/testing/selftests/mincore/mincore_selftest.c +2
-2@@ -150,8 +149,8 @@ TEST(check_huge_pages)MAP_PRIVATE |MAP_ANONYMOUS |MAP_HUGETLB , -1, 0);if (addr ==MAP_FAILED ) { -if (errno ==ENOMEM ) -SKIP (return,"No huge pages available." ); +if (errno ==ENOMEM || errno ==EINVAL ) +SKIP (return,"No huge pages available or CONFIG_HUGETLB_PAGE disabled." );else TH_LOG ("mmap error: %s" ,strerror (errno)); }Signature · 1 line
2.25.1
Signature · 3 lines
Anders Roxell [email protected] M: +46 708 22 71 05 | IRC: roxell
Hi Shuah,
Quoted 8 lines · Ricardo Cañuelo
The
check_huge_pagestest was failing instead of skipping on qemu-armv7 because the skip condition wasn't handled properly. Add an additional check to fix it.
Gentle ping about this, I still haven't seen it merged.
Cheers,
Ricardo
Quoted 8 lines · Ricardo Cañuelo
The
check_huge_pagestest was failing instead of skipping on qemu-armv7 because the skip condition wasn't handled properly. Add an additional check to fix it.
Quoted 19 lines
--- tools/testing/selftests/mincore/mincore_selftest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tools/testing/selftests/mincore/mincore_selftest.c +2
-2@@ -150,8 +149,8 @@ TEST(check_huge_pages)MAP_PRIVATE |MAP_ANONYMOUS |MAP_HUGETLB , -1, 0);if (addr ==MAP_FAILED ) { -if (errno ==ENOMEM ) -SKIP (return,"No huge pages available." ); +if (errno ==ENOMEM || errno ==EINVAL ) +SKIP (return,"No huge pages available or CONFIG_HUGETLB_PAGE disabled." );else TH_LOG ("mmap error: %s" ,strerror (errno)); }
Signature · 2 lines
BR, Muhammad Usama Anjum