]> git.proxmox.com Git - mirror_zfs.git/commit
ZTS: avoid piping to special devices
authorAntonio Russo <aerusso@aerusso.net>
Tue, 19 Jan 2021 19:53:35 +0000 (12:53 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 23 Jan 2021 23:47:06 +0000 (15:47 -0800)
commit81f981cd82b04e8d8b27f7d5b5827fa9a25b847c
tree7083c5938fc9bf23deea789437bcaf43d34aea60
parent3790aa8176713b98f1b5c8275d537c7eacdc2bcc
ZTS: avoid piping to special devices

As described in #11445, the kernel interface kernel_{read,write} no
longer act on special devices.  In the ZTS, zfs send and receive are
tested by piping to these devices, leading to spurious failures (for
positive tests) and may mask errors (for negative tests).

Until a more permanent mechanism to address this deficiency is
developed, clean up the output from the ZTS by avoiding directly piping
to or from /dev/null and /dev/zero.

For /dev/zero input, simply use a pipe: `cat </dev/zero |` .

However, for /dev/null output, the shell semantics for pipe failures
means that zfs send error codes will be masked by the successful
`| cat >/dev/null` command execution.  In that case, use a temporary
file under $TEST_BASE_DIR for output in favor.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Signed-off-by: Antonio Russo <aerusso@aerusso.net>
Closes #11478
14 files changed:
contrib/pyzfs/libzfs_core/test/test_libzfs_core.py
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_005_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send-b.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_004_neg.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_encrypted_unloaded.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_raw.ksh
tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh
tests/zfs-tests/tests/functional/redacted_send/redacted_resume.ksh
tests/zfs-tests/tests/functional/removal/removal_with_send.ksh
tests/zfs-tests/tests/functional/rsend/send_invalid.ksh
tests/zfs-tests/tests/functional/rsend/send_partial_dataset.ksh