fstests: btrfs/048: amend property validation cases
PATCH 1/1 fstests: btrfs/048: amend property validation cases
Add more property validation cases which are fixed by the patches [1]
[1]
btrfs: fix vanished compression property after failed set
btrfs: fix zstd compression parameter
--- tests/btrfs/048 | 25 +++++++++++++++++++++++++ tests/btrfs/048.out | 16 ++++++++++++++++ 2 files changed, 41 insertions(+)
tests/btrfs/048 +25 -0
@@ -6,6 +6,11 @@ # # Btrfs properties test. The btrfs properties feature was introduced in the # linux kernel 3.14. +# Fails without the kernel patches: +# btrfs: fix property validate fail should not increment generation +# btrfs: open code btrfs_set_prop in inherit_prop +# btrfs: fix vanished compression property after failed set +# btrfs: fix zstd compression parameter # seq=`basename $0` seqres=$RESULT_DIR/$seq
@@ -34,6 +39,7 @@ _supported_os Linux _require_test _require_scratch _require_btrfs_command "property" +_require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq
@@ -203,5 +209,24 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 compression touch $SCRATCH_MNT/sv1/file2 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression +echo -e "\nTesting argument validation, should fail" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch + +echo -e "\nTesting if property is persistent across failed validation" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +$BTRFS_UTIL_PROG property get $SCRATCH_MNT compression + +echo -e "\nTesting generation is unchanged after failed validation" +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' + status=0 exit
tests/btrfs/048.out +16 -0
@@ -76,3 +76,19 @@ compression=zlib Testing subvolume property inheritance compression=lzo compression=lzo + +Testing argument validation, should fail +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument + +Testing if property is persistent across failed validation +ERROR: failed to set compression for /mnt/scratch: Invalid argument +compression=lzo + +Testing generation is unchanged after failed validation +generation 7 +ERROR: failed to set compression for /mnt/scratch: Invalid argument +generation 7
Signature · 1 line
2.17.1
PATCH v2 1/1 fstests: btrfs/048: amend property validation cases
Add more property validation cases which are fixed by the patches [1]
[1]
btrfs: fix vanished compression property after failed set
btrfs: fix zstd compression parameter
---
v2: correct kernel patch titles in the test header and change log
tests/btrfs/048 | 23 +++++++++++++++++++++++ tests/btrfs/048.out | 16 ++++++++++++++++ 2 files changed, 39 insertions(+)
tests/btrfs/048 +23 -0
@@ -6,6 +6,9 @@ # # Btrfs properties test. The btrfs properties feature was introduced in the # linux kernel 3.14. +# Fails without the kernel patches: +# btrfs: fix vanished compression property after failed set +# btrfs: fix zstd compression parameter # seq=`basename $0` seqres=$RESULT_DIR/$seq
@@ -34,6 +37,7 @@ _supported_os Linux _require_test _require_scratch _require_btrfs_command "property" +_require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq
@@ -203,5 +207,24 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 compression touch $SCRATCH_MNT/sv1/file2 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression +echo -e "\nTesting argument validation, should fail" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch + +echo -e "\nTesting if property is persistent across failed validation" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +$BTRFS_UTIL_PROG property get $SCRATCH_MNT compression + +echo -e "\nTesting generation is unchanged after failed validation" +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' + status=0 exit
tests/btrfs/048.out +16 -0
@@ -76,3 +76,19 @@ compression=zlib Testing subvolume property inheritance compression=lzo compression=lzo + +Testing argument validation, should fail +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument + +Testing if property is persistent across failed validation +ERROR: failed to set compression for /mnt/scratch: Invalid argument +compression=lzo + +Testing generation is unchanged after failed validation +generation 7 +ERROR: failed to set compression for /mnt/scratch: Invalid argument +generation 7
Signature · 1 line
2.17.1
Quoted 6 lines · Anand Jain
Add more property validation cases which are fixed by the patches [1]
[1]
btrfs: fix vanished compression property after failed set
btrfs: fix zstd compression parameterSigned-off-by Anand Jain <[email protected]>
Quoted 79 lines
---
v2: correct kernel patch titles in the test header and change logtests/btrfs/048 | 23 +++++++++++++++++++++++ tests/btrfs/048.out | 16 ++++++++++++++++ 2 files changed, 39 insertions(+)tests/btrfs/048 +23
-0@@ -6,6 +6,9 @@ # # Btrfs properties test. The btrfs properties feature was introduced in the # linux kernel 3.14. +# Fails without the kernel patches: +# btrfs: fix vanished compression property after failed set +# btrfs: fix zstd compression parameter # seq=`basename $0` seqres=$RESULT_DIR/$seq@@ -34,6 +37,7 @@ _supported_os Linux _require_test _require_scratch _require_btrfs_command "property" +_require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq@@ -203,5 +207,24 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 compression touch $SCRATCH_MNT/sv1/file2 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression +echo -e "\nTesting argument validation, should fail" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch + +echo -e "\nTesting if property is persistent across failed validation" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +$BTRFS_UTIL_PROG property get $SCRATCH_MNT compression + +echo -e "\nTesting generation is unchanged after failed validation" +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' + status=0 exittests/btrfs/048.out +16
-0@@ -76,3 +76,19 @@ compression=zlib Testing subvolume property inheritance compression=lzo compression=lzo + +Testing argument validation, should fail +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument + +Testing if property is persistent across failed validation +ERROR: failed to set compression for /mnt/scratch: Invalid argument +compression=lzo + +Testing generation is unchanged after failed validation +generation 7 +ERROR: failed to set compression for /mnt/scratch: Invalid argument +generation 7
Quoted 11 lines · Nikolay Borisov
Quoted 6 lines · Anand Jain
Add more property validation cases which are fixed by the patches [1]
[1]
btrfs: fix vanished compression property after failed set
btrfs: fix zstd compression parameterSigned-off-by Anand Jain <[email protected]>Reviewed-by Nikolay Borisov <[email protected]>
Thanks for the test and the review!
But this looks like a targeted regression test that may fail an existing test. It's better to write a new test for this.
Thanks,
Eryu
Quoted 80 lines
Quoted 80 lines
---
v2: correct kernel patch titles in the test header and change logtests/btrfs/048 | 23 +++++++++++++++++++++++ tests/btrfs/048.out | 16 ++++++++++++++++ 2 files changed, 39 insertions(+)tests/btrfs/048 +23
-0@@ -6,6 +6,9 @@ # # Btrfs properties test. The btrfs properties feature was introduced in the # linux kernel 3.14. +# Fails without the kernel patches: +# btrfs: fix vanished compression property after failed set +# btrfs: fix zstd compression parameter # seq=`basename $0` seqres=$RESULT_DIR/$seq@@ -34,6 +37,7 @@ _supported_os Linux _require_test _require_scratch _require_btrfs_command "property" +_require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq@@ -203,5 +207,24 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 compression touch $SCRATCH_MNT/sv1/file2 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression +echo -e "\nTesting argument validation, should fail" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch + +echo -e "\nTesting if property is persistent across failed validation" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +$BTRFS_UTIL_PROG property get $SCRATCH_MNT compression + +echo -e "\nTesting generation is unchanged after failed validation" +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' + status=0 exittests/btrfs/048.out +16
-0@@ -76,3 +76,19 @@ compression=zlib Testing subvolume property inheritance compression=lzo compression=lzo + +Testing argument validation, should fail +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument + +Testing if property is persistent across failed validation +ERROR: failed to set compression for /mnt/scratch: Invalid argument +compression=lzo + +Testing generation is unchanged after failed validation +generation 7 +ERROR: failed to set compression for /mnt/scratch: Invalid argument +generation 7
Quoted 9 lines · Eryu Guan
Quoted 8 lines · Nikolay Borisov
Quoted 5 lines · Anand Jain
Add more property validation cases which are fixed by the patches [1]
[1]
btrfs: fix vanished compression property after failed set
btrfs: fix zstd compression parameter
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Anand Jain <[email protected]>Reviewed-by Nikolay Borisov <[email protected]>Thanks for the test and the review!
But this looks like a targeted regression test that may fail an existing test. It's better to write a new test for this.
Regression is only when fstests is upgraded. This test case mentions the prerequisite kernel patches [1]. So that should suffice the concern?
Thanks, Anand
Quoted 12 lines
Thanks,
EryuQuoted 8 lines
Quoted 8 lines
---
v2: correct kernel patch titles in the test header and change logtests/btrfs/048 | 23 +++++++++++++++++++++++ tests/btrfs/048.out | 16 ++++++++++++++++ 2 files changed, 39 insertions(+)
Quoted 8 lines
Quoted 8 lines
tests/btrfs/048 line 8
Quoted 8 lines
tests/btrfs/048 +0
-0@@ -6,6 +6,9 @@ # # Btrfs properties test. The btrfs properties feature was introduced in the # linux kernel 3.14.
[1]
Quoted 64 lines
Quoted 64 lines
Quoted 64 lines
tests/btrfs/048 +23
-0+# Fails without the kernel patches: +# btrfs: fix vanished compression property after failed set +# btrfs: fix zstd compression parameter # seq=`basename $0` seqres=$RESULT_DIR/$seq@@ -34,6 +37,7 @@ _supported_os Linux _require_test _require_scratch _require_btrfs_command "property" +_require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq@@ -203,5 +207,24 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 compression touch $SCRATCH_MNT/sv1/file2 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression +echo -e "\nTesting argument validation, should fail" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +echo "***" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch + +echo -e "\nTesting if property is persistent across failed validation" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch +$BTRFS_UTIL_PROG property get $SCRATCH_MNT compression + +echo -e "\nTesting generation is unchanged after failed validation" +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation' + status=0 exittests/btrfs/048.out +16
-0@@ -76,3 +76,19 @@ compression=zlib Testing subvolume property inheritance compression=lzo compression=lzo + +Testing argument validation, should fail +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument + +Testing if property is persistent across failed validation +ERROR: failed to set compression for /mnt/scratch: Invalid argument +compression=lzo + +Testing generation is unchanged after failed validation +generation 7 +ERROR: failed to set compression for /mnt/scratch: Invalid argument +generation 7
Quoted 14 lines · Anand Jain
Quoted 13 lines · Eryu Guan
Quoted 11 lines · Nikolay Borisov
Quoted 6 lines · Anand Jain
Add more property validation cases which are fixed by the patches [1]
[1]
btrfs: fix vanished compression property after failed set
btrfs: fix zstd compression parameterSigned-off-by Anand Jain <[email protected]>Reviewed-by Nikolay Borisov <[email protected]>
Quoted 8 lines
Quoted 4 lines
Thanks for the test and the review!
But this looks like a targeted regression test that may fail an existing test. It's better to write a new test for this.
Regression is only when fstests is upgraded. This test case mentions the prerequisite kernel patches [1]. So that should suffice the concern?
I agree with Anand here, this is an extension to an existing test, which covers specific feature. IMO it's not good to always introduce new tests because every invocation of a test comes with an overhead of spawning processes and whatnot. THis is not a problem for 10 tests, but currently for btrfs we execute around 600 tests each one "wasting" some cycles to spawn bash processes to execute the actual test.
Quoted 99 lines
Thanks, Anand
Quoted 12 lines
Thanks,
EryuQuoted 8 lines
Quoted 8 lines
---
v2: correct kernel patch titles in the test header and change logtests/btrfs/048 | 23 +++++++++++++++++++++++ tests/btrfs/048.out | 16 ++++++++++++++++
2 files changed, 39 insertions(+)Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
tests/btrfs/048 +0
-0@@ -6,6 +6,9 @@ # # Btrfs properties test. The btrfs properties feature wasintroduced in the
# linux kernel 3.14.[1]
Quoted 69 lines
Quoted 69 lines
Quoted 69 lines
tests/btrfs/048 +3
-0+# Fails without the kernel patches: +# btrfs: fix vanished compression property after failed set +# btrfs: fix zstd compression parameter#
seq=basename $0
seqres=$RESULT_DIR/$seqtests/btrfs/048 +0
-0@@ -34,6 +37,7 @@ _supported_os Linux
_require_test
_require_scratch
_require_btrfs_command"property" +_require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq
@@ -203,5 +207,24 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 compression
touch $SCRATCH_MNT/sv1/file2
$BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression +echo -e "\nTesting argument validation, should fail" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' |_filter_scratch
+echo "***"
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' |_filter_scratch
+echo "***"
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' |_filter_scratchtests/btrfs/048 +4
-0+ +echo -e "\nTesting if property is persistent across failed validation" +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo' +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' |
_filter_scratch
+$BTRFS_UTIL_PROG property get $SCRATCH_MNT compressiontests/btrfs/048 +4
-0+ +echo -e "\nTesting generation is unchanged after failed validation" +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep'^generation'
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' |_filter_scratch
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT +$BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation'
+
status=0
exittests/btrfs/048.out +0
-0@@ -76,3 +76,19 @@ compression=zlibTesting subvolume property inheritance
compression=lzo
compression=lzotests/btrfs/048.out +16
-0+ +Testing argument validation, should fail +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument +*** +ERROR: failed to set compression for /mnt/scratch: Invalid argument + +Testing if property is persistent across failed validation +ERROR: failed to set compression for /mnt/scratch: Invalid argument +compression=lzo + +Testing generation is unchanged after failed validation +generation 7 +ERROR: failed to set compression for /mnt/scratch: Invalid argument +generation 7
Quoted 26 lines · Nikolay Borisov
Quoted 14 lines · Anand Jain
Quoted 13 lines · Eryu Guan
Quoted 11 lines · Nikolay Borisov
Quoted 6 lines · Anand Jain
Add more property validation cases which are fixed by the patches [1]
[1]
btrfs: fix vanished compression property after failed set
btrfs: fix zstd compression parameterSigned-off-by Anand Jain <[email protected]>Reviewed-by Nikolay Borisov <[email protected]>Quoted 8 lines
Quoted 4 lines
Thanks for the test and the review!
But this looks like a targeted regression test that may fail an existing test. It's better to write a new test for this.
Regression is only when fstests is upgraded. This test case mentions the prerequisite kernel patches [1]. So that should suffice the concern?
Quoted 6 lines
I agree with Anand here, this is an extension to an existing test, which covers specific feature. IMO it's not good to always introduce new tests because every invocation of a test comes with an overhead of spawning processes and whatnot. THis is not a problem for 10 tests, but currently for btrfs we execute around 600 tests each one "wasting" some cycles to spawn bash processes to execute the actual test.
Fair enough. We're having more tests now, and we do consider "merging" some tests into one case.
Thanks,
Eryu