diff options
author | Ryan Moeller <[email protected]> | 2021-10-08 14:14:26 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-10-08 11:14:26 -0700 |
commit | 97bbeeb9380385ce5541d0be9ec3fd6f9c9f1d00 (patch) | |
tree | 2ed1bd915cdb598b5b08b968f3ed27a60b03530f /tests/zfs-tests | |
parent | 9d1407e8f24825d74ba7cf228de545c0d1a0ce8f (diff) |
Fail invalid incremental recursive send gracefully
zfs send -R -i snap1 pool/ds@snap1 is an invalid invocation of zfs send
because the incremental source and target snapshots are the same. We
have an error message for this condition, but we don't make it there
because of a failed assert while iterating through the dataset's
snapshots.
Check for NULL to avoid the assert so we can make it to the error
message.
Test this form of invalid send invocation in rsend tests. Fix the
rsend_016_neg test while here: log_neg itself doesn't fail the test,
and writing to /dev/null is not supported on all Linux kernels.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Paul Dagnelie <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #11121
Closes #12533
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh index 6dfb3423f..26573bfb5 100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh @@ -24,10 +24,22 @@ # # Strategy: # 1. Perform a zfs incremental send from a bookmark that doesn't exist +# 2. Perform a zfs incremental replication send with incremental source +# same as target (#11121) # verify_runnable "both" -log_neg eval "zfs send -i \#bla $POOl/$FS@final > /dev/null" +function cleanup +{ + rm -f $TEST_BASE_DIR/devnull +} + +log_onexit cleanup + +log_mustnot eval "zfs send -i \#bla $POOl/$FS@final > $TEST_BASE_DIR/devnull" + +log_must eval "zfs send -R -i snapA $POOL/vol@snapA 2>&1 " \ + "> $TEST_BASE_DIR/devnull | grep -q WARNING" log_pass "Ensure that error conditions cause appropriate failures." |