HomeFreeBSD

ZTS: avoid piping to special devices

Description

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

Details

Provenance
Antonio Russo <aerusso@aerusso.net>Authored on Jan 19 2021, 7:53 PM
GitHub <noreply@github.com>Committed on Jan 19 2021, 7:53 PM
Parents
rG60a2434b295f: libzfs_sendrecv: Use fnv* to verify nvlist/nvpair*
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGf8c4d63a2660: ZTS: avoid piping to special devices (authored by Antonio Russo <aerusso@aerusso.net>).Jan 19 2021, 7:53 PM