summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-06-11 14:34:03 +0200
committerJim Meyering <meyering@redhat.com>2011-01-30 20:44:10 +0100
commit5106653c26ab41aefa1810bb4cfa722eccdd4751 (patch)
tree530b144c76735a61567ad4f4b8d34fd7330ba0be /tests
parentdc05bc7ee26495af613a1741d8c53e171862ddab (diff)
downloadcoreutils-5106653c26ab41aefa1810bb4cfa722eccdd4751.tar.xz
tests: accommodate varying filefrag -v "flags" output
* tests/cp/sparse-fiemap: Accommodate values other than "eof" in the "flags" column of filefrag -v output
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cp/sparse-fiemap3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index dc0cf6059..b6b110390 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -68,10 +68,11 @@ $PERL -e 1 || skip_test_ 'skipping part of this test; you lack perl'
# Extract logical block number and length pairs from filefrag -v output.
# The initial sed is to remove the "eof" from the normally-empty "flags" field.
+# Similarly, remove flags values like "unknown,delalloc,eof".
# That is required when that final extent has no number in the "expected" field.
f()
{
- sed 's/ eof$//' $@ \
+ sed 's/ [a-z,][a-z,]*$//' $@ \
| awk '/^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END {print ""}'
}