Skip to content

Commit b33b873

Browse files
r-c-nshuahkh
authored andcommitted
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. 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>
1 parent 06c2afb commit b33b873

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/mincore/mincore_selftest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ TEST(check_huge_pages)
150150
MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB,
151151
-1, 0);
152152
if (addr == MAP_FAILED) {
153-
if (errno == ENOMEM)
154-
SKIP(return, "No huge pages available.");
153+
if (errno == ENOMEM || errno == EINVAL)
154+
SKIP(return, "No huge pages available or CONFIG_HUGETLB_PAGE disabled.");
155155
else
156156
TH_LOG("mmap error: %s", strerror(errno));
157157
}

0 commit comments

Comments
 (0)