mirror_zfs/contrib/pyzfs/libzfs_core
Antonio Russo 81f981cd82 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
2021-01-23 15:47:06 -08:00
..
bindings Remove code for zfs remap 2019-06-24 16:44:01 -07:00
test ZTS: avoid piping to special devices 2021-01-23 15:47:06 -08:00
__init__.py Replace ZFS on Linux references with OpenZFS 2020-10-16 13:01:24 -07:00
_constants.py Change the error handling for invalid property values 2020-08-01 08:41:31 -07:00
_error_translation.py Change the error handling for invalid property values 2020-08-01 08:41:31 -07:00
_libzfs_core.py Implement bookmark copying 2020-02-11 13:19:12 -08:00
_nvlist.py Fix typos in contrib/ 2019-08-30 09:44:43 -07:00
ctypes.py pyzfs: python3 support (library 2/2) 2019-01-06 10:39:41 -08:00
exceptions.py Fix cstyle warnings 2020-03-17 15:42:27 -07:00