From b38fccc646eed73b6392d5c4c12e408ae24adfac Mon Sep 17 00:00:00 2001 From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 31 May 2024 16:02:06 +0200 Subject: [PATCH] tests: user_property: Clarify comments Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Reviewed-by: Tino Reichardt Reviewed-by: Allan Jude Signed-off-by: Mateusz Piotrowski <0mp@FreeBSD.org> Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Closes #16248 --- .../zpool_set/user_property_002_neg.ksh | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh index 7c8fcba6e4..e9c7e01708 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_set/user_property_002_neg.ksh @@ -51,13 +51,23 @@ log_onexit cleanup_user_prop $TESTPOOL typeset -a names=() typeset -a values=() -# Too long property name (256 bytes, which is the 256-byte limit minus 1 byte -# for the null byte plus 1 byte to reach back over the limit) -names+=("$(awk 'BEGIN { printf "x:"; while (c++ < (256 - 2 - 1 + 1)) printf "a" }')") +# A property name that is too long consists of 256 or more bytes (which is (1) +# the 256-byte limit (2) minus 1 byte for the null byte (3) plus 1 byte to +# reach back over the limit). +names+=("$(awk ' + BEGIN { + # Print a 2-byte prefix of the name. + printf "x:"; + # Print the remaining 254 bytes. + while (c++ < (256 - 2 - 1 + 1)) + printf "a" + }' +)") values+=("too-long-property-name") -# Too long property value (the limits are 1024 on FreeBSD and 4096 on Linux, so -# pick the right one; the too long value is, e.g., the limit minus 1 bytes for the -# null byte plus 1 byte to reach back over the limit) +# A property value that is too long consists of at least 1024 bytes on FreeBSD +# and 4096 bytes on Linux. +# The smallest too-long value is (1) the limit (2) minus 1 byte for the null +# byte (2) plus 1 byte to reach back over the limit). if is_linux; then typeset ZFS_MAXPROPLEN=4096 else