Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/zfs-tests/include/commands.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ export ZFS_FILES='zdb
zed
zgenhostid
zstream
zstreamdump
zfs_ids_to_path
zpool_influxdb'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ for recsize in 512 1024 2048 4096 8192 16384; do
grep -q "EMBEDDED" $tmpdir/recv.zdb || \
log_fail "Obj $recv_obj not embedded in $recvfs"

cat $stream | zstreamdump -v | log_must grep -q \
cat $stream | zstream dump -v | log_must grep -q \
"WRITE_EMBEDDED object = $send_obj offset = 0"
done

Expand Down Expand Up @@ -96,7 +96,7 @@ for recsize in 1024 4096 16384; do
grep -q "EMBEDDED" $tmpdir/recv.zdb || \
log_fail "Obj $recv_obj not embedded in $recvfs"

cat $stream | zstreamdump -v | log_must grep -q \
cat $stream | zstream dump -v | log_must grep -q \
"WRITE_EMBEDDED object = $send_obj offset = 0"
done

Expand Down
12 changes: 6 additions & 6 deletions tests/zfs-tests/tests/functional/rsend/rsend.kshlib
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,13 @@ function mess_send_file
# The random offset might truncate the send stream to be
# smaller than the DRR_BEGIN record. If this happens, then
# the receiving system won't have enough info to create the
# partial dataset at all. We use zstreamdump to check for
# partial dataset at all. We use zstream dump to check for
# this and retry in this case.
nr_begins=$(head -c $offset $file | zstreamdump | \
nr_begins=$(head -c $offset $file | zstream dump | \
grep DRR_BEGIN | awk '{ print $5 }')
while [ "$nr_begins" -eq 0 ]; do
offset=$(($RANDOM * $RANDOM % $filesize))
nr_begins=$(head -c $offset $file | zstreamdump | \
nr_begins=$(head -c $offset $file | zstream dump | \
grep DRR_BEGIN | awk '{ print $5 }')
done

Expand Down Expand Up @@ -741,7 +741,7 @@ function stream_has_features
shift

[[ -f $file ]] || log_fail "Couldn't find file: $file"
typeset flags=$(cat $file | zstreamdump | \
typeset flags=$(cat $file | zstream dump | \
awk '/features =/ {features = $3} END {print features}')
typeset -A feature
feature[dedup]="1"
Expand Down Expand Up @@ -774,7 +774,7 @@ function stream_has_features
# comparing. This function does not currently handle incremental streams
# that remove data.
#
# $1 The zstreamdump output file
# $1 The zstream dump output file
# $2 The dataset to compare against
# This can be a source of a send or recv target (fs, not snapshot)
# $3 The percentage below which verification is deemed a failure
Expand All @@ -791,7 +791,7 @@ function verify_stream_size
[[ -f $stream ]] || log_fail "No such file: $stream"
datasetexists $ds || log_fail "No such dataset: $ds"

typeset stream_size=$(cat $stream | zstreamdump | sed -n \
typeset stream_size=$(cat $stream | zstream dump | sed -n \
's/ Total payload size = \(.*\) (0x.*)/\1/p')

typeset inc_size=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ for recsize in "${recsize_prop_vals[@]}"; do
fi
done

# Generate the streams and zstreamdump output.
# Generate the streams and zstream dump output.
log_must zfs snapshot $sendfs@now
log_must eval "zfs send -c $sendfs@now >$stream"
log_must eval "zstreamdump -v <$stream >$dump"
log_must eval "zstream dump -v <$stream >$dump"
log_must eval "zfs recv -d $recvfs <$stream"
cmp_ds_cont $sendfs $recvfs
verify_stream_size $stream $sendfs
log_mustnot stream_has_features $stream embed_data

log_must eval "zfs send -c -e $sendfs@now >$stream2"
log_must eval "zstreamdump -v <$stream2 >$dump2"
log_must eval "zstream dump -v <$stream2 >$dump2"
log_must eval "zfs recv -d $recvfs2 <$stream2"
cmp_ds_cont $sendfs $recvfs2
verify_stream_size $stream2 $sendfs
Expand Down Expand Up @@ -101,9 +101,9 @@ for recsize in "${recsize_prop_vals[@]}"; do
log_fail "Obj $recv2_obj not embedded in $recvfs2"

grep -q "WRITE_EMBEDDED object = $send_obj offset = 0" $dump && \
log_fail "Obj $obj embedded in zstreamdump output"
log_fail "Obj $obj embedded in zstream dump output"
grep -q "WRITE_EMBEDDED object = $send_obj offset = 0" $dump2 || \
log_fail "Obj $obj not embedded in zstreamdump output"
log_fail "Obj $obj not embedded in zstream dump output"
done

log_pass "Compressed streams can contain embedded blocks."
12 changes: 6 additions & 6 deletions tests/zfs-tests/tests/functional/rsend/send-c_zstreamdump.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@

#
# Description:
# Verify compression features show up in zstreamdump
# Verify compression features show up in zstream dump
#
# Strategy:
# 1. Create a full compressed send stream
# 2. Verify zstreamdump shows this stream has the relevant features
# 3. Verify zstreamdump's accounting of logical and compressed size is correct
# 2. Verify zstream dump shows this stream has the relevant features
# 3. Verify zstream dump's accounting of logical and compressed size is correct
# 4. Verify the toname from a resume token
# 5. Verify it fails with corrupted resume token
# 6. Verify it fails with missing resume token
#

verify_runnable "both"

log_assert "Verify zstreamdump correctly interprets compressed send streams."
log_assert "Verify zstream dump correctly interprets compressed send streams."
log_onexit cleanup_pool $POOL2

typeset sendfs=$POOL2/fs
Expand All @@ -49,7 +49,7 @@ log_must zfs snapshot $sendfs@full

log_must eval "zfs send -c $sendfs@full >$BACKDIR/full"
log_must stream_has_features $BACKDIR/full lz4 compressed
cat $BACKDIR/full | zstreamdump -v > $BACKDIR/dump.out
cat $BACKDIR/full | zstream dump -v > $BACKDIR/dump.out

lsize=$(awk '/^WRITE [^0]/ {lsize += $24} END {printf("%d", lsize)}' \
$BACKDIR/dump.out)
Expand All @@ -72,4 +72,4 @@ bad_resume_token="1-1162e8285b-100789c6360"
log_mustnot eval "zstream token $bad_resume_token 2>&1"
log_mustnot eval "zstream token 2>&1"

log_pass "zstreamdump correctly interprets compressed send streams."
log_pass "zstream dump correctly interprets compressed send streams."
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function check
[[ -f $stream ]] && log_must rm $stream
log_must eval "zfs send $flags $send_snap >$stream"
$verify eval "zfs recv $recv_ds <$stream"
typeset stream_size=$(cat $stream | zstreamdump | sed -n \
typeset stream_size=$(cat $stream | zstream dump | sed -n \
's/ Total write size = \(.*\) (0x.*)/\1/p')

#
Expand Down