]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/mm: hugetlb_fault_after_madv: improve test output
authorDavid Hildenbrand <david@redhat.com>
Thu, 26 Sep 2024 15:20:44 +0000 (17:20 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:28:47 +0000 (21:28 -0700)
commit72c45d95da28d1878b3173904c7b440da6e509c6
tree9f0e9b711a2761500d012e1cd2038d0d7380b55f
parent3bdf94700ce5d385e1c92a8b5ba055dac287e25e
selftests/mm: hugetlb_fault_after_madv: improve test output

Let's improve the test output.  For example, print the proper test result.
Install a SIGBUS handler to catch any SIGBUS instead of crashing the test
on failure.

With unsuitable hugetlb page count:
  $ ./hugetlb_fault_after_madv
  TAP version 13
  1..1
  # [INFO] detected default hugetlb page size: 2048 KiB
  ok 2 # SKIP This test needs one and only one page to execute. Got 0
  # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0

On a failure:
  $ ./hugetlb_fault_after_madv
  TAP version 13
  1..1
  not ok 1 SIGBUS behavior
  Bail out! 1 out of 1 tests failed

On success:
  $ ./hugetlb_fault_after_madv
  TAP version 13
  1..1
  # [INFO] detected default hugetlb page size: 2048 KiB
  ok 1 SIGBUS behavior
  # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0

Link: https://lkml.kernel.org/r/20240926152044.2205129-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Tested-by: Mario Casquero <mcasquer@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/hugetlb_fault_after_madv.c