* presence indicates DRR_WRITE_EMBEDDED records are permitted
* (optional) "compressok" -> (value ignored)
* presence indicates compressed DRR_WRITE records are permitted
- * (optional) "rawok" -> (value ignored)
+ * (optional) "rawok" -> (value ignored)
* presence indicates raw encrypted records should be used.
+ * (optional) "resume_object" and "resume_offset" -> (uint64)
+ * if present, resume send stream from specified object and offset.
* (optional) "fd" -> file descriptor to use as a cookie for progress
* tracking (int32)
* }
{"rawok", DATA_TYPE_BOOLEAN, ZK_OPTIONAL},
{"fd", DATA_TYPE_INT32, ZK_OPTIONAL},
{"redactbook", DATA_TYPE_STRING, ZK_OPTIONAL},
- {"resumeobj", DATA_TYPE_UINT64, ZK_OPTIONAL},
- {"resumeoff", DATA_TYPE_UINT64, ZK_OPTIONAL},
- {"bytes", DATA_TYPE_UINT64, ZK_OPTIONAL},
+ {"resume_object", DATA_TYPE_UINT64, ZK_OPTIONAL},
+ {"resume_offset", DATA_TYPE_UINT64, ZK_OPTIONAL},
+ {"bytes", DATA_TYPE_UINT64, ZK_OPTIONAL},
};
static int
# $1 The ZFS send command
# $2 The filesystem where the streams are sent
# $3 The receive filesystem
+# $4 Test dry-run (optional)
#
function resume_test
{
- sendcmd=$1
- streamfs=$2
- recvfs=$3
+ typeset sendcmd=$1
+ typeset streamfs=$2
+ typeset recvfs=$3
+ typeset dryrun=${4:-1}
stream_num=1
log_must eval "$sendcmd >/$streamfs/$stream_num"
stream_num=$((stream_num+1))
token=$(zfs get -Hp -o value receive_resume_token $recvfs)
+
+ # Do a dry-run
+ [ $dryrun -ne 0 ] && \
+ log_must eval "zfs send -nvt $token > /dev/null"
+
log_must eval "zfs send -t $token >/$streamfs/$stream_num"
[[ -f /$streamfs/$stream_num ]] || \
log_fail "NO FILE /$streamfs/$stream_num"