/tests/zfs-tests/tests/functional/rsend/rsend_019_pos.ksh

https://github.com/adilger/zfs · Korn Shell · 54 lines · 17 code · 9 blank · 28 comment · 1 complexity · d7831bdaad1875950eb2f354ca5234cd MD5 · raw file

  1. #!/bin/ksh
  2. #
  3. # This file and its contents are supplied under the terms of the
  4. # Common Development and Distribution License ("CDDL"), version 1.0.
  5. # You may only use this file in accordance with the terms of version
  6. # 1.0 of the CDDL.
  7. #
  8. # A full copy of the text of the CDDL should have accompanied this
  9. # source. A copy of the CDDL is also available via the Internet at
  10. # http://www.illumos.org/license/CDDL.
  11. #
  12. #
  13. # Copyright (c) 2014, 2016 by Delphix. All rights reserved.
  14. #
  15. . $STF_SUITE/include/libtest.shlib
  16. . $STF_SUITE/tests/functional/rsend/rsend.kshlib
  17. #
  18. # Description:
  19. # Verify resumability of a full and incremental ZFS send/receive in the
  20. # presence of a corrupted stream.
  21. #
  22. # Strategy:
  23. # 1. Start a full ZFS send, redirect output to a file
  24. # 2. Mess up the contents of the stream state file on disk
  25. # 3. Try ZFS receive, which should fail with a checksum mismatch error
  26. # 4. ZFS send to the stream state file again using the receive_resume_token
  27. # 5. ZFS receive and verify the receive completes successfully
  28. # 6. Repeat steps on an incremental ZFS send
  29. # 7. Repeat the entire procedure for a dataset at the pool root
  30. #
  31. verify_runnable "both"
  32. log_assert "Verify resumability of a full and incremental ZFS send/receive " \
  33. "in the presence of a corrupted stream"
  34. log_onexit resume_cleanup $sendfs $streamfs
  35. sendfs=$POOL/sendfs
  36. recvfs=$POOL3/recvfs
  37. streamfs=$POOL2/stream
  38. for sendfs in $POOL2/sendfs $POOL3; do
  39. test_fs_setup $sendfs $recvfs $streamfs
  40. resume_test "zfs send -v $sendfs@a" $streamfs $recvfs
  41. resume_test "zfs send -v -i @a $sendfs@b" $streamfs $recvfs
  42. file_check $sendfs $recvfs
  43. done
  44. log_pass "Verify resumability of a full and incremental ZFS send/receive " \
  45. "in the presence of a corrupted stream"