]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
btrfs: fix grep warning at _require_btrfs_mkfs_uuid_option()
authorFilipe Manana <fdmanana@suse.com>
Wed, 6 Mar 2024 15:01:57 +0000 (15:01 +0000)
committerZorro Lang <zlang@kernel.org>
Mon, 11 Mar 2024 04:50:09 +0000 (12:50 +0800)
commit07fa85f1123203546276040a9fd04a8aeda3f41c
tree90fdf6a1e9c78d8baf5198d486336157f771c868
parent9b6df9a01ac8ee3f28a2a24d71e45792e21b6d48
btrfs: fix grep warning at _require_btrfs_mkfs_uuid_option()

When running _require_btrfs_mkfs_uuid_option(), some grep versions
complain about escaping the dash characters and make the tests that
use this function fail like this:

  btrfs/313       2s - output mismatch (see /root/fstests/results//btrfs_normal/btrfs/313.out.bad)
      --- tests/btrfs/313.out 2024-03-05 18:48:34.929372495 +0000
      +++ /root/fstests/results//btrfs_normal/btrfs/313.out.bad 2024-03-05 20:52:27.745166101 +0000
      @@ -1,5 +1,8 @@
       QA output created by 313
       ---- clone_uuids_verify_tempfsid ----
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
       Mounting original device
       On disk fsid: FSID
      ...
      (Run 'diff -u /root/fstests/tests/btrfs/313.out /root/fstests/results//btrfs_normal/btrfs/313.out.bad'  to see the entire diff)
  btrfs/314       3s - output mismatch (see /root/fstests/results//btrfs_normal/btrfs/314.out.bad)
      --- tests/btrfs/314.out 2024-03-05 18:48:34.929372495 +0000
      +++ /root/fstests/results//btrfs_normal/btrfs/314.out.bad 2024-03-05 20:52:32.880237216 +0000
      @@ -1,6 +1,9 @@
       QA output created by 314

       From non-tempfsid SCRATCH_MNT to tempfsid TEST_DIR/314/tempfsid_mnt
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
       wrote 9000/9000 bytes at offset 0
      ...

So fix this by not escaping anymore the dashes and using the -- separator
before the regex pattern parameter.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
common/btrfs