]> git.proxmox.com Git - mirror_zfs.git/commitdiff
tests: lua_core: use herewords for single-line programs
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Wed, 23 Mar 2022 19:45:25 +0000 (20:45 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 2 Apr 2022 01:02:03 +0000 (18:02 -0700)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13259

tests/zfs-tests/tests/functional/channel_program/lua_core/tst.exists.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.integer_illegal.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.integer_overflow.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.language_functions_neg.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.language_functions_pos.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.return_large.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.return_nvlist_neg.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.return_nvlist_pos.ksh

index eba01b17c80e738eea9dc30eb60eed45acfa0b24..34f29d9c039d5f633f1951095751374ac55ca758 100755 (executable)
@@ -38,8 +38,6 @@ log_must_program $TESTPOOL $ZCP_ROOT/lua_core/tst.exists.zcp \
     $TESTPOOL/$TESTCLONE
 
 log_mustnot_checkerror_program "not in the target pool" \
-    $TESTPOOL - <<-EOF
-       return zfs.exists('rpool')
-EOF
+    $TESTPOOL - <<<"return zfs.exists('rpool')"
 
 log_pass "zfs.exists() gives correct results"
index c34f2afd9e1899adb42da8d25f4a2c77469e2d07..1c70bc85920a166321bb8f530cdc0c0574d573e2 100755 (executable)
@@ -32,9 +32,7 @@ set -A args "1.0" \
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot_checkerror_program "malformed number" $TESTPOOL - <<-EOF
-               return ${args[i]}
-       EOF
+       log_mustnot_checkerror_program "malformed number" $TESTPOOL - <<<"return ${args[i]}"
        ((i = i + 1))
 done
 
index c129bae51b0457ca05de7c10e2e49bf23c810155..be212979249984893d9b02cdcb8a603c8c651da3 100755 (executable)
@@ -25,8 +25,6 @@ verify_runnable "global"
 
 log_assert "overflowing a 64-bit integer should wrap around"
 
-log_must_program $TESTPOOL - <<-EOF
-       assert(18446744073709551615 + 1 == (-18446744073709551616))
-EOF
+log_must_program $TESTPOOL - <<<"assert(18446744073709551615 + 1 == (-18446744073709551616))"
 
 log_pass "overflowing a 64-bit integer should wrap around"
index 0125d76c7036cc2889f4946caf8125641f597140..3f91db2be9c3cbf2f12bc7e58b7367cb2bfc6698 100755 (executable)
@@ -43,9 +43,7 @@ log_assert "Runtime errors in lua scripts fail as expected."
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_mustnot_checkerror_program "execution failed" $TESTPOOL - <<-EOF
-               ${args[i]}
-       EOF
+       log_mustnot_checkerror_program "execution failed" $TESTPOOL - <<<"${args[i]}"
        ((i = i + 1))
 done
 
index 924d8e2c694416541345031e579ea22e570475a6..019622cf84cc5af6277c85d900b33fa87638fa7b 100755 (executable)
@@ -33,9 +33,7 @@ log_assert "Simple lua scripts pass."
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
-       log_must_program $TESTPOOL - <<-EOF
-               ${args[i]}
-       EOF
+       log_must_program $TESTPOOL - <<<"${args[i]}"
        ((i = i + 1))
 done
 
index bbaeb54f59a58895cc5052c419dd9c28fc6fb618..ae42665cd9f5cd3393a2e418a28f24b62600fd22 100755 (executable)
@@ -41,8 +41,7 @@ log_must zfs create $fs
 output_lines=$(log_must zfs program $TESTPOOL \
     $ZCP_ROOT/lua_core/tst.return_large.zcp | wc -l)
 
-[[ $output_lines -lt 5000 ]] &&
-    log_fail "Expected return of full list but only got $output_lines lines"
+log_must [ $output_lines -ge 5000 ]
 
 #
 # Make sure we fail if the return is over the memory limit
index 10afa6727847d8dedef8ffa73b87427da5e4e2a4..a8d4dd31d84bef10f4be26a3f19e6a94eb89026d 100755 (executable)
@@ -45,17 +45,13 @@ set -A args 'function() return 1 end' \
 typeset -i last_index=$((${#args[*]} - 1))
 for i in $(seq 0 $last_index); do
        log_note "running program: ${args[i]}"
-       log_mustnot_checkerror_program "execution failed" $TESTPOOL - <<-EOF
-               return ${args[i]}
-       EOF
+       log_mustnot_checkerror_program "execution failed" $TESTPOOL - <<<"return ${args[i]}"
        ((i = i + 1))
 done
 
 for i in $(seq 0 $last_index); do
        log_note "running program: ${args[i]}"
-       log_mustnot_checkerror_program "execution failed" $TESTPOOL - <<-EOF
-               error(${args[i]})
-       EOF
+       log_mustnot_checkerror_program "execution failed" $TESTPOOL - <<<"error(${args[i]})"
        ((i = i + 1))
 done
 
index 8b4ef6e760b027a533af6113ad737438a8a3f3bb..75ade2b45d12f4dce09d65e0ee8020535b5a33c3 100755 (executable)
@@ -39,18 +39,14 @@ log_assert "Returning valid lua constructs works."
 typeset -i i=0
 while (( i < ${#args[*]} )); do
        log_note "running program: return ${args[i]}"
-       log_must_program $TESTPOOL - <<-EOF
-               return ${args[i]}
-       EOF
+       log_must_program $TESTPOOL - <<<"return ${args[i]}"
        ((i = i + 1))
 done
 
 typeset -i i=0
 while (( i < ${#args[*]} )); do
        log_note "running program: error(${args[i]})"
-       log_mustnot_checkerror_program "in function 'error'" $TESTPOOL - <<-EOF
-               error(${args[i]})
-       EOF
+       log_mustnot_checkerror_program "in function 'error'" $TESTPOOL - <<<"error(${args[i]})"
        ((i = i + 1))
 done