diff mbox series

fstests: print symbolic names for fiemap flags

Message ID 36864f7a8701651bd7c1734aa57cb520fbf34a49.1636749456.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series fstests: print symbolic names for fiemap flags | expand

Commit Message

Josef Bacik Nov. 12, 2021, 8:37 p.m. UTC
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@toxicpanda.com>
---
 common/punch          | 16 +++++++++++++++-
 tests/generic/352.out |  4 ++--
 tests/generic/353.out |  8 ++++----
 3 files changed, 21 insertions(+), 7 deletions(-)
diff mbox series

Patch

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