tests/zdb_encrypted: parse numbers a little more robustly

On FreeBSD, `wc` prints some leading spaces, while on Linux it does not.
So we tell ksh to expect an integer, and it does the rest.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #14791
Closes #14797
This commit is contained in:
Rob N 2023-04-27 01:50:44 +10:00 committed by GitHub
parent d960beca61
commit b69cb06664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,8 +55,8 @@ log_must eval "echo $PASSPHRASE | zfs create -o mountpoint=$TESTDIR2" \
echo 'my great encrypted text' > $file
obj="$(ls -i $file | cut -d' ' -f1)"
size="$(wc -c < $file)"
typeset -i obj=$(ls -i $file | cut -d' ' -f1)
typeset -i size=$(wc -c < $file)
log_note "test file $file is objid $obj, size $size"