From: Jim Meyering Date: Fri, 11 Jun 2010 12:34:03 +0000 (+0200) Subject: tests: accommodate varying filefrag -v "flags" output X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd7bf0fe65d1c470ff0d9be6e7353df93be01c7f;p=thirdparty%2Fcoreutils.git tests: accommodate varying filefrag -v "flags" output * tests/cp/sparse-fiemap: Accommodate values other than "eof" in the "flags" column of filefrag -v output --- diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap index dc0cf60595..b6b1103909 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 ""}' }