All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: fix zstd compression test on a kernel without ztsd support
@ 2019-09-03 12:27 Johannes Thumshirn
  2019-09-03 16:09 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Thumshirn @ 2019-09-03 12:27 UTC (permalink / raw)
  To: David Sterba; +Cc: Linux BTRFS Mailinglist, Johannes Thumshirn

The test-case 'misc-tests/025-zstd-compression' is failing on a kernel
without zstd compression support.

Check if zstd compression is supported by the kernel and if not skip the
test-case.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 tests/misc-tests/025-zstd-compression/test.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/misc-tests/025-zstd-compression/test.sh b/tests/misc-tests/025-zstd-compression/test.sh
index 22795d27500e..f9ff1d089fd5 100755
--- a/tests/misc-tests/025-zstd-compression/test.sh
+++ b/tests/misc-tests/025-zstd-compression/test.sh
@@ -6,6 +6,11 @@ source "$TEST_TOP/common"
 check_prereq btrfs
 check_global_prereq md5sum
 
+if ! [ -f "/sys/fs/btrfs/features/compress_zstd" ]; then
+       _not_run "kernel does not support zstd compression feature"
+       exit
+fi
+
 # Extract the test image
 image=$(extract_image compress.raw.xz)
 
-- 
2.16.4


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

* Re: [PATCH] btrfs-progs: fix zstd compression test on a kernel without ztsd support
  2019-09-03 12:27 [PATCH] btrfs-progs: fix zstd compression test on a kernel without ztsd support Johannes Thumshirn
@ 2019-09-03 16:09 ` David Sterba
  2019-09-04  7:36   ` Johannes Thumshirn
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2019-09-03 16:09 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: David Sterba, Linux BTRFS Mailinglist

On Tue, Sep 03, 2019 at 02:27:21PM +0200, Johannes Thumshirn wrote:
> The test-case 'misc-tests/025-zstd-compression' is failing on a kernel
> without zstd compression support.
> 
> Check if zstd compression is supported by the kernel and if not skip the
> test-case.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  tests/misc-tests/025-zstd-compression/test.sh | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tests/misc-tests/025-zstd-compression/test.sh b/tests/misc-tests/025-zstd-compression/test.sh
> index 22795d27500e..f9ff1d089fd5 100755
> --- a/tests/misc-tests/025-zstd-compression/test.sh
> +++ b/tests/misc-tests/025-zstd-compression/test.sh
> @@ -6,6 +6,11 @@ source "$TEST_TOP/common"
>  check_prereq btrfs
>  check_global_prereq md5sum
>  
> +if ! [ -f "/sys/fs/btrfs/features/compress_zstd" ]; then
> +       _not_run "kernel does not support zstd compression feature"

Sorry, I misled you with this check. The test needs to detect zstd
support in 'btrfs restore'. The only thing I see right now is to grep
for zstd in output of 'ldd', because unlike for btrfs-convert, the help
does not list the optional features.

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

* Re: [PATCH] btrfs-progs: fix zstd compression test on a kernel without ztsd support
  2019-09-03 16:09 ` David Sterba
@ 2019-09-04  7:36   ` Johannes Thumshirn
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2019-09-04  7:36 UTC (permalink / raw)
  To: dsterba, David Sterba, Linux BTRFS Mailinglist

On 03/09/2019 18:09, David Sterba wrote:
>> +if ! [ -f "/sys/fs/btrfs/features/compress_zstd" ]; then
>> +       _not_run "kernel does not support zstd compression feature"
> 
> Sorry, I misled you with this check. The test needs to detect zstd
> support in 'btrfs restore'. The only thing I see right now is to grep
> for zstd in output of 'ldd', because unlike for btrfs-convert, the help
> does not list the optional features.

Well, yes and no. You can compile a btrfs binary with zstd support and
run it on a kernel without. The check would catch this case.

But I see it can't cope with a btrfs binary without zstd support
compiled in indeed.

Let me cook something.

Byte,
	Johannes
-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn@suse.de                                +49 911 74053 689
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5
90409 Nürnberg
Germany
(HRB 247165, AG München)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

end of thread, other threads:[~2019-09-04  7:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 12:27 [PATCH] btrfs-progs: fix zstd compression test on a kernel without ztsd support Johannes Thumshirn
2019-09-03 16:09 ` David Sterba
2019-09-04  7:36   ` Johannes Thumshirn

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.