diff mbox series

mkfs-tests: Only check supported checksums

Message ID 20200210164300.14177-1-marcos@mpdesouza.com (mailing list archive)
State New, archived
Headers show
Series mkfs-tests: Only check supported checksums | expand

Commit Message

Marcos Paulo de Souza Feb. 10, 2020, 4:43 p.m. UTC
From: Marcos Paulo de Souza <mpdesouza@suse.com>

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
 tests/mkfs-tests/019-basic-checksums-mkfs/test.sh  | 11 +++++++----
 tests/mkfs-tests/020-basic-checksums-mount/test.sh |  7 +++----
 2 files changed, 10 insertions(+), 8 deletions(-)

Comments

Johannes Thumshirn Feb. 10, 2020, 5:05 p.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
David Sterba Feb. 11, 2020, 6:39 p.m. UTC | #2
On Mon, Feb 10, 2020 at 01:43:00PM -0300, Marcos Paulo de Souza wrote:
> From: Marcos Paulo de Souza <mpdesouza@suse.com>

Though it's obvious what the patch does, a short summary would be good.
With that updatd patch is now in devel, thanks.
diff mbox series

Patch

diff --git a/tests/mkfs-tests/019-basic-checksums-mkfs/test.sh b/tests/mkfs-tests/019-basic-checksums-mkfs/test.sh
index 61562942..01934cf0 100755
--- a/tests/mkfs-tests/019-basic-checksums-mkfs/test.sh
+++ b/tests/mkfs-tests/019-basic-checksums-mkfs/test.sh
@@ -20,7 +20,10 @@  test_mkfs_checksum()
 	run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV"
 }
 
-test_mkfs_checksum crc32c
-test_mkfs_checksum xxhash
-test_mkfs_checksum sha256
-test_mkfs_checksum blake2
+if ! [ -f "/sys/fs/btrfs/features/supported_checksums" ]; then
+	_not_run "kernel support for checksums missing"
+fi
+
+for csum in $(cat /sys/fs/btrfs/features/supported_checksums); do
+	test_mkfs_checksum "$csum"
+done
diff --git a/tests/mkfs-tests/020-basic-checksums-mount/test.sh b/tests/mkfs-tests/020-basic-checksums-mount/test.sh
index eaac25dd..d52f3e1c 100755
--- a/tests/mkfs-tests/020-basic-checksums-mount/test.sh
+++ b/tests/mkfs-tests/020-basic-checksums-mount/test.sh
@@ -30,7 +30,6 @@  if ! [ -f "/sys/fs/btrfs/features/supported_checksums" ]; then
 	_not_run "kernel support for checksums missing"
 fi
 
-test_mkfs_mount_checksum crc32c
-test_mkfs_mount_checksum xxhash
-test_mkfs_mount_checksum sha256
-test_mkfs_mount_checksum blake2
+for csum in $(cat /sys/fs/btrfs/features/supported_checksums); do
+	test_mkfs_mount_checksum "$csum"
+done