diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2017-11-09 16:44:34 -0800 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2017-11-10 12:33:58 +0800 |
commit | c0c26cecab8a39e9c16ac57018a51e8f021dcf06 (patch) | |
tree | 26b64323b516f508c3497f1d1379c9f2e4014c02 | |
parent | ee3f35961f3c9b7d2994da4f8ed205dec2577101 (diff) | |
download | xfstests-c0c26cecab8a39e9c16ac57018a51e8f021dcf06.tar.gz |
common/fuzzy: ignore padding fields on xfs
Padding fields are never checked and can have arbitrary values (if we
ever put them to use there'll be a feature flag) so there's no point
in fuzz-testing them.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
-rw-r--r-- | common/fuzzy | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/common/fuzzy b/common/fuzzy index 86492687bf..3d86e1c865 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -79,6 +79,14 @@ _scratch_scrub() { esac } +# Filter out any keys with an array index >= 10, collapse any array range +# ("[1-195]") to the first item, and ignore padding fields. +__filter_xfs_db_keys() { + sed -e '/\([a-z]*\)\[\([0-9][0-9]\+\)\].*/d' \ + -e 's/\([a-zA-Z0-9_]*\)\[\([0-9]*\)-[0-9]*\]/\1[\2]/g' \ + -e '/pad/d' +} + # Filter the xfs_db print command's field debug information # into field name and type. __filter_xfs_db_print_fields() { @@ -87,15 +95,13 @@ __filter_xfs_db_print_fields() { filter='^' fi grep ' = ' | while read key equals value; do - # Filter out any keys with an array index >= 10, and - # collapse any array range ("[1-195]") to the first item. - fuzzkey="$(echo "${key}" | sed -e '/\([a-z]*\)\[\([0-9][0-9]\+\)\].*/d' -e 's/\([a-zA-Z0-9_]*\)\[\([0-9]*\)-[0-9]*\]/\1[\2]/g')" + fuzzkey="$(echo "${key}" | __filter_xfs_db_keys)" if [ -z "${fuzzkey}" ]; then continue elif [[ "${value}" == "["* ]]; then echo "${value}" | sed -e 's/^.//g' -e 's/.$//g' -e 's/,/\n/g' | while read subfield; do echo "${fuzzkey}.${subfield}" - done + done | __filter_xfs_db_keys else echo "${fuzzkey}" fi |