[PATCH] fstests: print symbolic names for fiemap flags

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



My nightly btrfs tests are failing on my configs with -o compress because the
extents have FIEMAP_EXTENT_ENCODED set, which throws the golden output off.

Fix this by changing the filter helper to spit out symbolic names for SHARED and
LAST (these tests only care about SHARED).  Then change the golden output to
match the new output of the filter.  With this patch my -o compress configs now
pass these tests.

Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
---
 common/punch          | 16 +++++++++++++++-
 tests/generic/352.out |  4 ++--
 tests/generic/353.out |  8 ++++----
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/common/punch b/common/punch
index b6c337e7..b6b8a0b9 100644
--- a/common/punch
+++ b/common/punch
@@ -119,7 +119,21 @@ _filter_fiemap_flags()
 			next;
 		}
 		$5 ~ /0x[[:xdigit:]]+/ {
-			print $1, $2, $5;
+			flags = strtonum($5);
+			flag_str = "none";
+			set = 0;
+
+			if (and(flags, 0x2000)) {
+				flag_str = "shared";
+				set = 1;
+			}
+			if (and(flags, 0x1)) {
+				if (set) {
+					flag_str = flag_str"|";
+				}
+				flag_str = flag_str"last";
+			}
+			print $1, $2, flag_str
 		}' |
 	_coalesce_extents
 }
diff --git a/tests/generic/352.out b/tests/generic/352.out
index a87c5073..4ff66c21 100644
--- a/tests/generic/352.out
+++ b/tests/generic/352.out
@@ -1,5 +1,5 @@
 QA output created by 352
 wrote 131072/131072 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0: [0..2097151]: 0x2000
-1: [2097152..2097407]: 0x2001
+0: [0..2097151]: shared
+1: [2097152..2097407]: shared|last
diff --git a/tests/generic/353.out b/tests/generic/353.out
index b7184a61..4f6e0b92 100644
--- a/tests/generic/353.out
+++ b/tests/generic/353.out
@@ -5,11 +5,11 @@ linked 65536/65536 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 before sync:
 SCRATCH_MNT/file1
-0: [0..127]: 0x2001
+0: [0..127]: shared|last
 SCRATCH_MNT/file2
-0: [0..127]: 0x2001
+0: [0..127]: shared|last
 after sync:
 SCRATCH_MNT/file1
-0: [0..127]: 0x2001
+0: [0..127]: shared|last
 SCRATCH_MNT/file2
-0: [0..127]: 0x2001
+0: [0..127]: shared|last
-- 
2.26.3




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux