mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
ZTS: Make DVA pattern in zdb tests more robust
Ensure the capture ends at the first DVA in case there are multiple DVAs on the same line by only capturing up to the first '>' character. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9851
This commit is contained in:
parent
70835c5b75
commit
914bd02f29
@ -53,7 +53,7 @@ log_note "file $init_data has object number $obj"
|
||||
|
||||
output=$(zdb -ddddddbbbbbb $TESTPOOL/$TESTFS $obj 2> /dev/null \
|
||||
|grep -m 1 "L0 DVA" |head -n1)
|
||||
dva=$(sed -Ene 's/^.+DVA\[0\]=<(.+)>.*$/\1/p' <<< "$output")
|
||||
dva=$(sed -Ene 's/^.+DVA\[0\]=<([^>]+)>.*$/\1/p' <<< "$output")
|
||||
log_note "block 0 of $init_data has a DVA of $dva"
|
||||
cksum_expected=$(sed -Ene 's/^.+ cksum=([a-z0-9:]+)$/\1/p' <<< "$output")
|
||||
log_note "expecting cksum $cksum_expected"
|
||||
|
@ -74,7 +74,7 @@ log_note "file $init_data has object number $obj"
|
||||
|
||||
output=$(zdb -ddddddbbbbbb $TESTPOOL/$TESTFS $obj 2> /dev/null \
|
||||
|grep -m 1 "L0 DVA" |head -n1)
|
||||
dva=$(sed -Ene 's/^.+DVA\[0\]=<(.+)>.*$/\1/p' <<< "$output")
|
||||
dva=$(sed -Ene 's/^.+DVA\[0\]=<([^>]+)>.*$/\1/p' <<< "$output")
|
||||
log_note "block 0 of $init_data has a DVA of $dva"
|
||||
|
||||
# use the length reported by zdb -ddddddbbbbbb
|
||||
|
Loading…
Reference in New Issue
Block a user