From a9beeaf5da46f1deac03f328ee7db175114bb503 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 5 Jul 2023 14:05:10 -0400 Subject: [PATCH] Account for e2fsprogs output format changes. The filefrag program in e2fsprogs-v1.42.10-10-g29758d2f now includes an extra flag, and changes how the `unknown` flag is output. We essentially adjust for this "new" golden value on the fly if we encounter it. We don't expect future changes to the output. Signed-off-by: Auke Kok --- tests/tests/setattr_more.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/tests/setattr_more.sh b/tests/tests/setattr_more.sh index af05b89f..c15a507a 100644 --- a/tests/tests/setattr_more.sh +++ b/tests/tests/setattr_more.sh @@ -55,10 +55,17 @@ scoutfs setattr -t 67305985.999999999 -V 1 -s 1 "$FILE" 2>&1 | t_filter_fs TZ=GMT stat -c "%z" "$FILE" rm "$FILE" +# +# With e2fsprogs-v1.42.10-10-g29758d2f, the output of filefrag 'flags' changes +# significantly. First, the _LAST flag is now output. Second, the 'unknown' +# flag is now printed out as 'unknown_loc'. To compensate for this, we check +# and replace the "correct" output for new versions here with the expected +# value. +# echo "== large offline extents are created" touch "$FILE" scoutfs setattr -V 1 -o -s $((10007 * 4096)) "$FILE" 2>&1 | t_filter_fs -filefrag -v -b4096 "$FILE" 2>&1 | t_filter_fs +filefrag -v -b4096 "$FILE" 2>&1 | sed 's/last,unknown_loc,eof$/unknown,eof/' | t_filter_fs rm "$FILE" # had a bug where we were creating extents that were too long