Skip to content

Commit

Permalink
selftests/mincore: fix skip condition for check_huge_pages test
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Closes: https://lore.kernel.org/all/CA+G9fYuoB8Ug8PcTU-YGmemL7_eeEksXFihvxWF6OikD7sK7pA@mail.gmail.com
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
  • Loading branch information
Ricardo Cañuelo authored and Shuah Khan committed Jul 13, 2023
1 parent 06c2afb commit b33b873
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/mincore/mincore_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,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));
}
Expand Down

0 comments on commit b33b873

Please sign in to comment.