]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: hugetlb_dio: check for initial conditions to skip in the start
authorMuhammad Usama Anjum <usama.anjum@collabora.com>
Fri, 1 Nov 2024 14:15:57 +0000 (19:15 +0500)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 7 Nov 2024 22:14:59 +0000 (14:14 -0800)
commit0268d4579901821ff17259213c2d8c9679995d48
tree4064df8b5ccca20b44602588a9bc37599bfbbc46
parent652e1a51465f2e8e75590bc3dd1e3a3b61020568
selftests: hugetlb_dio: check for initial conditions to skip in the start

The test should be skipped if initial conditions aren't fulfilled in the
start instead of failing and outputting non-compliant TAP logs.  This kind
of failure pollutes the results.  The initial conditions are:

- The test should only execute if /tmp file can be allocated.
- The test should only execute if huge pages are free.

Before:
TAP version 13
1..4
Bail out! Error opening file
: Read-only file system (30)
 # Planned tests != run tests (4 != 0)
 # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0

After:
TAP version 13
1..0 # SKIP Unable to allocate file: Read-only file system

Link: https://lkml.kernel.org/r/20241101141557.3159432-1-usama.anjum@collabora.com
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Fixes: 3a103b5315b7 ("selftest: mm: Test if hugepage does not get leaked during __bio_release_pages()")
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Donet Tom <donettom@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/hugetlb_dio.c