From b955a4fb6d503aa49242ea7d3addf528ae4bbe73 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Thu, 14 Jan 2016 02:18:58 +0000 Subject: tests: support older fallocate number formats * tests/cp/fiemap-extents.sh: Support RHEL6 fallocate which doesn't support IEC suffixes like "MiB" on numbers. Also add some extra framework_failure_ protections. Reported by Assaf Gordon. --- tests/cp/fiemap-extents.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/cp/fiemap-extents.sh b/tests/cp/fiemap-extents.sh index d44a74137..672070ea8 100755 --- a/tests/cp/fiemap-extents.sh +++ b/tests/cp/fiemap-extents.sh @@ -21,14 +21,14 @@ print_ver_ cp require_sparse_support_ -touch fiemap_chk +touch fiemap_chk || framework_failure_ fiemap_capable_ fiemap_chk || skip_ 'this file system lacks FIEMAP support' rm fiemap_chk fallocate --help >/dev/null || skip_ 'The fallocate utility is required' touch falloc.test || framework_failure_ -fallocate -l 1 -o 0 -n falloc.test || +fallocate -l 1 -o 1 -n falloc.test || skip_ 'this file system lacks FALLOCATE support' rm falloc.test @@ -41,6 +41,9 @@ if false; then # which would cause failure of unrelated tests run in parallel. require_file_system_bytes_free_ 800000000 +fallocate -l 1MiB num.test || + skip_ "this fallocate doesn't support numbers with IEX suffixes" + fallocate -l 600MiB space.test || skip_ 'this test needs at least 600MiB free space' @@ -67,14 +70,14 @@ fi # Note the '-l 1' case is an effective noop, and just checks # a file with a trailing hole is copied correctly. for sparse_mode in always auto never; do - for alloc in '-l 4MiB ' '-l 1MiB -o 4MiB' '-l 1'; do + for alloc in '-l 4194304' '-l 1048576 -o 4194304' '-l 1'; do dd count=10 if=/dev/urandom iflag=fullblock of=unwritten.withdata truncate -s 2MiB unwritten.withdata || framework_failure_ fallocate $alloc -n unwritten.withdata || framework_failure_ cp --sparse=$sparse_mode unwritten.withdata cp.test || fail=1 test $(stat -c %s unwritten.withdata) = $(stat -c %s cp.test) || fail=1 cmp unwritten.withdata cp.test || fail=1 - rm unwritten.withdata cp.test + rm unwritten.withdata cp.test || framework_failure_ done done -- cgit v1.2.3-70-g09d2