From 647672e21f689d180185fa9c068c974f7418b446 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Wed, 24 Aug 2016 10:10:26 +0000 Subject: [PATCH] Skip ls tests that use sparse files if these are not supported. Some of the ls(1) tests create really large sparse files to validate the number formatting features of ls(1). Unfortunately, those tests fail if the underlying test file system does not support sparse files, as is the case when /tmp is mounted on tmpfs. Before running these tests, check if the test file system supports sparse files by using getconf(1) and skip them if not. Note that the support for this query was just added to getconf(1) in r304694. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D7609 --- bin/ls/tests/ls_tests.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh index 2291bab0c1e4..32ead0314852 100755 --- a/bin/ls/tests/ls_tests.sh +++ b/bin/ls/tests/ls_tests.sh @@ -84,6 +84,14 @@ create_test_inputs2() { create_test_dir + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files probably" \ + "not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi + for filesize in 1 512 $(( 2 * $KB )) $(( 10 * $KB )) $(( 512 * $KB )); \ do atf_check -e ignore -o empty -s exit:0 \