mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
Stop using "zstreamdump" in tests/
zstreamdump was replaced with "zstream dump"; let's stop using the old name, compat symlink or no. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes #12277
This commit is contained in:
parent
942121cfcb
commit
126615303d
@ -188,7 +188,6 @@ export ZFS_FILES='zdb
|
|||||||
zed
|
zed
|
||||||
zgenhostid
|
zgenhostid
|
||||||
zstream
|
zstream
|
||||||
zstreamdump
|
|
||||||
zfs_ids_to_path
|
zfs_ids_to_path
|
||||||
zpool_influxdb'
|
zpool_influxdb'
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ for recsize in 512 1024 2048 4096 8192 16384; do
|
|||||||
grep -q "EMBEDDED" $tmpdir/recv.zdb || \
|
grep -q "EMBEDDED" $tmpdir/recv.zdb || \
|
||||||
log_fail "Obj $recv_obj not embedded in $recvfs"
|
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"
|
"WRITE_EMBEDDED object = $send_obj offset = 0"
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ for recsize in 1024 4096 16384; do
|
|||||||
grep -q "EMBEDDED" $tmpdir/recv.zdb || \
|
grep -q "EMBEDDED" $tmpdir/recv.zdb || \
|
||||||
log_fail "Obj $recv_obj not embedded in $recvfs"
|
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"
|
"WRITE_EMBEDDED object = $send_obj offset = 0"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -584,13 +584,13 @@ function mess_send_file
|
|||||||
# The random offset might truncate the send stream to be
|
# The random offset might truncate the send stream to be
|
||||||
# smaller than the DRR_BEGIN record. If this happens, then
|
# smaller than the DRR_BEGIN record. If this happens, then
|
||||||
# the receiving system won't have enough info to create the
|
# 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.
|
# 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 }')
|
grep DRR_BEGIN | awk '{ print $5 }')
|
||||||
while [ "$nr_begins" -eq 0 ]; do
|
while [ "$nr_begins" -eq 0 ]; do
|
||||||
offset=$(($RANDOM * $RANDOM % $filesize))
|
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 }')
|
grep DRR_BEGIN | awk '{ print $5 }')
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -741,7 +741,7 @@ function stream_has_features
|
|||||||
shift
|
shift
|
||||||
|
|
||||||
[[ -f $file ]] || log_fail "Couldn't find file: $file"
|
[[ -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}')
|
awk '/features =/ {features = $3} END {print features}')
|
||||||
typeset -A feature
|
typeset -A feature
|
||||||
feature[dedup]="1"
|
feature[dedup]="1"
|
||||||
@ -774,7 +774,7 @@ function stream_has_features
|
|||||||
# comparing. This function does not currently handle incremental streams
|
# comparing. This function does not currently handle incremental streams
|
||||||
# that remove data.
|
# that remove data.
|
||||||
#
|
#
|
||||||
# $1 The zstreamdump output file
|
# $1 The zstream dump output file
|
||||||
# $2 The dataset to compare against
|
# $2 The dataset to compare against
|
||||||
# This can be a source of a send or recv target (fs, not snapshot)
|
# This can be a source of a send or recv target (fs, not snapshot)
|
||||||
# $3 The percentage below which verification is deemed a failure
|
# $3 The percentage below which verification is deemed a failure
|
||||||
@ -791,7 +791,7 @@ function verify_stream_size
|
|||||||
[[ -f $stream ]] || log_fail "No such file: $stream"
|
[[ -f $stream ]] || log_fail "No such file: $stream"
|
||||||
datasetexists $ds || log_fail "No such dataset: $ds"
|
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')
|
's/ Total payload size = \(.*\) (0x.*)/\1/p')
|
||||||
|
|
||||||
typeset inc_size=0
|
typeset inc_size=0
|
||||||
|
@ -63,17 +63,17 @@ for recsize in "${recsize_prop_vals[@]}"; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Generate the streams and zstreamdump output.
|
# Generate the streams and zstream dump output.
|
||||||
log_must zfs snapshot $sendfs@now
|
log_must zfs snapshot $sendfs@now
|
||||||
log_must eval "zfs send -c $sendfs@now >$stream"
|
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"
|
log_must eval "zfs recv -d $recvfs <$stream"
|
||||||
cmp_ds_cont $sendfs $recvfs
|
cmp_ds_cont $sendfs $recvfs
|
||||||
verify_stream_size $stream $sendfs
|
verify_stream_size $stream $sendfs
|
||||||
log_mustnot stream_has_features $stream embed_data
|
log_mustnot stream_has_features $stream embed_data
|
||||||
|
|
||||||
log_must eval "zfs send -c -e $sendfs@now >$stream2"
|
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"
|
log_must eval "zfs recv -d $recvfs2 <$stream2"
|
||||||
cmp_ds_cont $sendfs $recvfs2
|
cmp_ds_cont $sendfs $recvfs2
|
||||||
verify_stream_size $stream2 $sendfs
|
verify_stream_size $stream2 $sendfs
|
||||||
@ -101,9 +101,9 @@ for recsize in "${recsize_prop_vals[@]}"; do
|
|||||||
log_fail "Obj $recv2_obj not embedded in $recvfs2"
|
log_fail "Obj $recv2_obj not embedded in $recvfs2"
|
||||||
|
|
||||||
grep -q "WRITE_EMBEDDED object = $send_obj offset = 0" $dump && \
|
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 || \
|
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
|
done
|
||||||
|
|
||||||
log_pass "Compressed streams can contain embedded blocks."
|
log_pass "Compressed streams can contain embedded blocks."
|
||||||
|
@ -21,12 +21,12 @@
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Description:
|
# Description:
|
||||||
# Verify compression features show up in zstreamdump
|
# Verify compression features show up in zstream dump
|
||||||
#
|
#
|
||||||
# Strategy:
|
# Strategy:
|
||||||
# 1. Create a full compressed send stream
|
# 1. Create a full compressed send stream
|
||||||
# 2. Verify zstreamdump shows this stream has the relevant features
|
# 2. Verify zstream dump shows this stream has the relevant features
|
||||||
# 3. Verify zstreamdump's accounting of logical and compressed size is correct
|
# 3. Verify zstream dump's accounting of logical and compressed size is correct
|
||||||
# 4. Verify the toname from a resume token
|
# 4. Verify the toname from a resume token
|
||||||
# 5. Verify it fails with corrupted resume token
|
# 5. Verify it fails with corrupted resume token
|
||||||
# 6. Verify it fails with missing resume token
|
# 6. Verify it fails with missing resume token
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
verify_runnable "both"
|
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
|
log_onexit cleanup_pool $POOL2
|
||||||
|
|
||||||
typeset sendfs=$POOL2/fs
|
typeset sendfs=$POOL2/fs
|
||||||
@ -49,7 +49,7 @@ log_must zfs snapshot $sendfs@full
|
|||||||
|
|
||||||
log_must eval "zfs send -c $sendfs@full >$BACKDIR/full"
|
log_must eval "zfs send -c $sendfs@full >$BACKDIR/full"
|
||||||
log_must stream_has_features $BACKDIR/full lz4 compressed
|
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)}' \
|
lsize=$(awk '/^WRITE [^0]/ {lsize += $24} END {printf("%d", lsize)}' \
|
||||||
$BACKDIR/dump.out)
|
$BACKDIR/dump.out)
|
||||||
@ -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 $bad_resume_token 2>&1"
|
||||||
log_mustnot eval "zstream 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."
|
||||||
|
@ -134,7 +134,7 @@ function check
|
|||||||
[[ -f $stream ]] && log_must rm $stream
|
[[ -f $stream ]] && log_must rm $stream
|
||||||
log_must eval "zfs send $flags $send_snap >$stream"
|
log_must eval "zfs send $flags $send_snap >$stream"
|
||||||
$verify eval "zfs recv $recv_ds <$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')
|
's/ Total write size = \(.*\) (0x.*)/\1/p')
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user