From b69cb06664ad74f5907f3a6675657b7d4b3daa44 Mon Sep 17 00:00:00 2001 From: Rob N Date: Thu, 27 Apr 2023 01:50:44 +1000 Subject: [PATCH] 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 Signed-off-by: Rob Norris Closes #14791 Closes #14797 --- .../zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh index 4572f64947a1..0218c2ea1033 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted.ksh @@ -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"