All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: misc-test/034: Avoid debug log populating stdout
@ 2019-07-24  5:07 Qu Wenruo
  2019-07-24 10:52 ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Qu Wenruo @ 2019-07-24  5:07 UTC (permalink / raw)
  To: linux-btrfs

When running misc-test/034, we got unexpected log output:
      [TEST/misc]   033-filename-length-limit
      [TEST/misc]   034-metadata-uuid
  Checking btrfstune logic
  Checking dump-super output
  Checking output after fsid change
  Checking for incompat textual representation
  Checking setting fsid back to original
  Testing btrfs-image restore

This is caused by commit 2570cff076b1 ("btrfs-progs: test: cleanup misc-tests/034")
which uses _log facility which also populates stdout.

Revert to echo "$*" >> "$RESULTS" to remove the noise.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/misc-tests/034-metadata-uuid/test.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/misc-tests/034-metadata-uuid/test.sh b/tests/misc-tests/034-metadata-uuid/test.sh
index 3ef110cda823..3a6771a85a61 100755
--- a/tests/misc-tests/034-metadata-uuid/test.sh
+++ b/tests/misc-tests/034-metadata-uuid/test.sh
@@ -31,7 +31,7 @@ read_metadata_uuid() {
 check_btrfstune() {
 	local fsid
 
-	_log "Checking btrfstune logic"
+	echo "Checking btrfstune logic" >> "$RESULTS"
 	# test with random uuid
 	run_check $SUDO_HELPER "$TOP/btrfstune" -m "$TEST_DEV"
 
@@ -66,7 +66,7 @@ check_dump_super_output() {
 	local dev_item_match
 	local old_metadata_uuid
 
-	_log "Checking dump-super output"
+	echo "Checking dump-super output" >> "$RESULTS"
 	# assert that metadata/fsid match on non-changed fs
 	fsid=$(read_fsid "$TEST_DEV")
 	metadata_uuid=$(read_metadata_uuid "$TEST_DEV")
@@ -78,7 +78,7 @@ check_dump_super_output() {
 	[ $dev_item_match = "[match]" ] || _fail "dev_item.fsid doesn't match on non-metadata uuid fs"
 
 
-	_log "Checking output after fsid change"
+	echo "Checking output after fsid change" >> "$RESULTS"
 	# change metadatauuid and ensure everything in the output is still correct
 	old_metadata_uuid=$metadata_uuid
 	run_check $SUDO_HELPER "$TOP/btrfstune" -M d88c8333-a652-4476-b225-2e9284eb59f1 "$TEST_DEV"
@@ -91,13 +91,13 @@ check_dump_super_output() {
 	[ "$fsid" = "d88c8333-a652-4476-b225-2e9284eb59f1" ] || _fail "btrfstune metadata_uuid change failed"
 	[ "$old_metadata_uuid" = "$metadata_uuid" ] || _fail "metadata_uuid changed unexpectedly"
 
-	_log "Checking for incompat textual representation"
+	echo "Checking for incompat textual representation" >> "$RESULTS"
 	# check for textual output of the new incompat feature
 	run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super \
 		"$TEST_DEV" | grep -q METADATA_UUID
 	[ $? -eq 0 ] || _fail "Didn't find textual representation of METADATA_UUID feature"
 
-	_log "Checking setting fsid back to original"
+	echo "Checking setting fsid back to original" >> "$RESULTS"
 	# ensure that  setting the fsid back to the original works
 	run_check $SUDO_HELPER "$TOP/btrfstune" -M "$old_metadata_uuid" "$TEST_DEV"
 
@@ -116,7 +116,7 @@ check_image_restore() {
 	local fsid_restored
 	local metadata_uuid_restored
 
-	_log "Testing btrfs-image restore"
+	echo "Testing btrfs-image restore" >> "$RESULTS"
 	run_check_mkfs_test_dev
 	run_check $SUDO_HELPER "$TOP/btrfstune" -m "$TEST_DEV"
 	fsid=$(read_fsid "$TEST_DEV")
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs-progs: misc-test/034: Avoid debug log populating stdout
  2019-07-24  5:07 [PATCH] btrfs-progs: misc-test/034: Avoid debug log populating stdout Qu Wenruo
@ 2019-07-24 10:52 ` David Sterba
  2019-07-24 11:47   ` Qu Wenruo
  0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2019-07-24 10:52 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Wed, Jul 24, 2019 at 01:07:05PM +0800, Qu Wenruo wrote:
> When running misc-test/034, we got unexpected log output:
>       [TEST/misc]   033-filename-length-limit
>       [TEST/misc]   034-metadata-uuid
>   Checking btrfstune logic
>   Checking dump-super output
>   Checking output after fsid change
>   Checking for incompat textual representation
>   Checking setting fsid back to original
>   Testing btrfs-image restore
> 
> This is caused by commit 2570cff076b1 ("btrfs-progs: test: cleanup misc-tests/034")
> which uses _log facility which also populates stdout.
> 
> Revert to echo "$*" >> "$RESULTS" to remove the noise.

Yes to remove the noise but the idea was to avoid manual redirections to
$RESULTS, so we need a new helper or adjust _log.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs-progs: misc-test/034: Avoid debug log populating stdout
  2019-07-24 10:52 ` David Sterba
@ 2019-07-24 11:47   ` Qu Wenruo
  2019-07-24 13:19     ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Qu Wenruo @ 2019-07-24 11:47 UTC (permalink / raw)
  To: dsterba, Qu Wenruo, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 1163 bytes --]



On 2019/7/24 下午6:52, David Sterba wrote:
> On Wed, Jul 24, 2019 at 01:07:05PM +0800, Qu Wenruo wrote:
>> When running misc-test/034, we got unexpected log output:
>>       [TEST/misc]   033-filename-length-limit
>>       [TEST/misc]   034-metadata-uuid
>>   Checking btrfstune logic
>>   Checking dump-super output
>>   Checking output after fsid change
>>   Checking for incompat textual representation
>>   Checking setting fsid back to original
>>   Testing btrfs-image restore
>>
>> This is caused by commit 2570cff076b1 ("btrfs-progs: test: cleanup misc-tests/034")
>> which uses _log facility which also populates stdout.
>>
>> Revert to echo "$*" >> "$RESULTS" to remove the noise.
> 
> Yes to remove the noise but the idea was to avoid manual redirections to
> $RESULTS, so we need a new helper or adjust _log.
> 

OK, I'll change _log to avoid populating stdout.

BTW, the reason I didn't change _log is at commit e547fdb16667
("btrfs-progs: tests, add more common helpers") it's using _log in
_run_mayfail(), but now it's not.

So some commits are doing conflicting modification during that cleanup.

Thanks,
Qu


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs-progs: misc-test/034: Avoid debug log populating stdout
  2019-07-24 11:47   ` Qu Wenruo
@ 2019-07-24 13:19     ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2019-07-24 13:19 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: dsterba, Qu Wenruo, linux-btrfs

On Wed, Jul 24, 2019 at 07:47:33PM +0800, Qu Wenruo wrote:
> 
> 
> On 2019/7/24 下午6:52, David Sterba wrote:
> > On Wed, Jul 24, 2019 at 01:07:05PM +0800, Qu Wenruo wrote:
> >> When running misc-test/034, we got unexpected log output:
> >>       [TEST/misc]   033-filename-length-limit
> >>       [TEST/misc]   034-metadata-uuid
> >>   Checking btrfstune logic
> >>   Checking dump-super output
> >>   Checking output after fsid change
> >>   Checking for incompat textual representation
> >>   Checking setting fsid back to original
> >>   Testing btrfs-image restore
> >>
> >> This is caused by commit 2570cff076b1 ("btrfs-progs: test: cleanup misc-tests/034")
> >> which uses _log facility which also populates stdout.
> >>
> >> Revert to echo "$*" >> "$RESULTS" to remove the noise.
> > 
> > Yes to remove the noise but the idea was to avoid manual redirections to
> > $RESULTS, so we need a new helper or adjust _log.
> > 
> 
> OK, I'll change _log to avoid populating stdout.

There are more calls to 'echo ... $RESULTS' in several tests, so that
would be good to unify.

> BTW, the reason I didn't change _log is at commit e547fdb16667
> ("btrfs-progs: tests, add more common helpers") it's using _log in
> _run_mayfail(), but now it's not.

I see, the code has evolved. The helpers like run_mayfail are allowed to
use the raw calls (or can use own internal helpers if that makes sense),
and we can make _log exclusively used by tests, once it does print to
stdout.

> So some commits are doing conflicting modification during that cleanup.

Yeah.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-24 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24  5:07 [PATCH] btrfs-progs: misc-test/034: Avoid debug log populating stdout Qu Wenruo
2019-07-24 10:52 ` David Sterba
2019-07-24 11:47   ` Qu Wenruo
2019-07-24 13:19     ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.