]> granicus.if.org Git - zfs/commit
Refactor checksum operations in tests
authorRyan Moeller <ryan@freqlabs.com>
Thu, 5 Sep 2019 16:51:59 +0000 (12:51 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 5 Sep 2019 16:51:59 +0000 (09:51 -0700)
commit240c015ac6ea629bef1339ed2829148051c2a954
treeb6e37d1ae238f8041c6a9e31417a40a036735a47
parent006e9a40882468be68f276c946bae812b74ac35c
Refactor checksum operations in tests

md5sum in particular but also sha256sum to a lesser extent is used
in several areas of the test suite for computing checksums. The vast
majority of invocations are followed by `| awk '{ print $1 }'`.

Introduce functions to wrap up `md5sum $file | awk '{ print $1 }'` and
likewise for sha256sum. These also serve as a convenient interface for
alternative implementations on other platforms.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #9280
14 files changed:
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_from_encrypted.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_raw.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_raw_incremental.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_shared_device.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.kshlib
tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen_003_pos.ksh
tests/zfs-tests/tests/functional/history/history_003_pos.ksh
tests/zfs-tests/tests/functional/rsend/rsend.kshlib
tests/zfs-tests/tests/functional/rsend/send-c_volume.ksh
tests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh
tests/zfs-tests/tests/functional/rsend/send_encrypted_props.ksh
tests/zfs-tests/tests/functional/slog/slog_replay_fs_001.ksh
tests/zfs-tests/tests/functional/slog/slog_replay_volume.ksh