Check hugetlbfs support before starting tests in run_hugetlbfs_test.sh.

Otherwise on a system that does not support hugetlbfs the free huge
pages availability check will fail with:
  ./run_hugetlbfs_test.sh: line 47: [: -lt: unary operator expected
  ./run_hugetlbfs_test.sh: line 60: 12577 Aborted                 (core dumped) 
./memfd_test hugetlbfs
  Aborted (core dumped)

And it will left a fuse_mnt process behind, which may cause some
unexpected issues.

Patch tested with a kernel that does not have hugetlbfs support enabled
and the test was skipped as expected.

Po-Hsu Lin (1):
  selftests/memfd: skip hugetlbfs test if not supported

 tools/testing/selftests/memfd/run_hugetlbfs_test.sh | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.34.1


Reply via email to