Re: [PATCH v2] fstests: btrfs: redirect stdout of "btrfs subvolume snapshot" to fix output change

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



On Sat, Apr 06, 2024 at 03:48:47PM +1030, Qu Wenruo wrote:
> [BUG]
> All the touched test cases would fail after btrfs-progs commit
> 5f87b467a9e7 ("btrfs-progs: subvolume: output the prompt line only when
> the ioctl succeeded") due to golden output mismatch.
> 
> [CAUSE]
> Although the patch I sent to the mail list doesn't change the output at
> all but only a timing change, David uses this patch to unify the output
> of "btrfs subvolume create" and "btrfs subvolume snapshot".
> 
> Unfortunately this changes the output and causes mismatch with
> golden output.
> 
> [FIX]
> Just redirect stdout of "btrfs subvolume snapshot" to $seqres.full.
> Any error from "btrfs subvolume" subgroup would lead to error messages
> into stderr, and cause golden output mismatch.
> 
> This can be comprehensively greped by
> 'grep -IR "Create a" tests/btrfs/*.out' command.
> 
> In fact, we have around 274 "btrfs subvolume snapshot|create" calls in the
> existing test cases, meanwhile only around 61 calls are populating
> golden output (22 for subvolume creation, and 39 for snapshot creation).
> 
> Thus majority of the snapshot/subvolume creation is not populating
> golden output already.

That's an interesting find, so we actually already do prefer not to use
golden output. There are recent tests that do use it though, so it's not
done consistently.

> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
> ---
> This is just a quick fix for the test failures, if accepted, further
> cleanup would be done for unnecessary golden output for "btrfs
> subvolume" subgroup.

I like it and this looks like the direction we can take for more
commands, thanks.




[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