diff options
author | Pádraig Brady <P@draigBrady.com> | 2016-01-14 02:18:58 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-01-15 14:14:05 +0000 |
commit | b955a4fb6d503aa49242ea7d3addf528ae4bbe73 (patch) | |
tree | 530c2332f3d8a51c783204aa5a6d05f9ee401dd2 /tests/cp | |
parent | 89f7adb158aa3cb8f217d18ed895d02bc37753eb (diff) | |
download | coreutils-b955a4fb6d503aa49242ea7d3addf528ae4bbe73.tar.xz |
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.
Diffstat (limited to 'tests/cp')
-rwxr-xr-x | tests/cp/fiemap-extents.sh | 11 |
1 files 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 |