]> granicus.if.org Git - zfs/commitdiff
ZTS: fix "not found" errors
authorLOLi <loli10K@users.noreply.github.com>
Tue, 27 Nov 2018 17:39:37 +0000 (18:39 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 27 Nov 2018 17:39:37 +0000 (09:39 -0800)
This commit fixes several "not found" errors caused by calling undefined
or incorrect shell functions in the following ZFS Test Suite groups:

   * alloc_class
   * channel_program/lua_core
   * channel_program/synctask_core
   * cli_root/zpool_import
   * cli_user/misc

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: bunder2015 <omfgbunder@gmail.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8152

14 files changed:
tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh
tests/zfs-tests/tests/functional/alloc_class/alloc_class_013_pos.ksh
tests/zfs-tests/tests/functional/alloc_class/cleanup.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.exists.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.nvlist_to_lua.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
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.return_recursive_table.ksh
tests/zfs-tests/tests/functional/channel_program/lua_core/tst.timeout.ksh
tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.destroy_fs.ksh
tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.destroy_snap.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_cachefile_shared_device.ksh
tests/zfs-tests/tests/functional/cli_user/misc/setup.ksh
tests/zfs-tests/tests/functional/cli_user/misc/zpool_upgrade_001_neg.ksh

index eeb541f47b2b5f53af0775fcd4fb3ab118e576c1..b03a8b4c87933f34afd225dd6b6c33a81893b853 100755 (executable)
@@ -24,7 +24,7 @@
 
 verify_runnable "global"
 
-claim= "Removing a special device from a pool succeeds."
+claim="Removing a special device from a pool succeeds."
 
 log_assert $claim
 log_onexit cleanup
index b817bdacf572623b96a3e13a31b319a0bdfe0981..22a8f1a97dc0141fcdd80148f77ec30de9f3b360 100755 (executable)
@@ -24,7 +24,7 @@
 
 verify_runnable "global"
 
-claim= "Removing a dedup device from a pool succeeds."
+claim="Removing a dedup device from a pool succeeds."
 
 log_assert $claim
 log_onexit cleanup
index 6f7e1d61a57a1171a000b191beaebb5aa83ad21e..c12d5973b4e9e4929472d9705fef0c2769d2d25b 100755 (executable)
@@ -21,7 +21,7 @@
 
 verify_runnable "global"
 
-pool_cleanup
+default_cleanup
 disk_cleanup
 
 log_pass
index e46fe2131589d7b97002ce39aecc561bd9aaf461..d486c25f44879afdfda341e8d01f2e6e064a417d 100755 (executable)
@@ -37,7 +37,7 @@ log_must_program $TESTPOOL $ZCP_ROOT/lua_core/tst.exists.zcp \
     $TESTPOOL $TESTPOOL/$TESTFS $TESTPOOL/$TESTFS@$TESTSNAP \
     $TESTPOOL/$TESTCLONE
 
-log_mustnot_checkerr_program "not in the target pool" \
+log_mustnot_checkerror_program "not in the target pool" \
     $TESTPOOL - <<-EOF
        return zfs.exists('rpool')
 EOF
index cd7b3c17ae734c063068591b39e6ffbcbd4a5b37..eaba6427c96ca902a8a370145662e36b3c38b197 100755 (executable)
@@ -14,8 +14,6 @@
 # Copyright (c) 2016 by Delphix. All rights reserved.
 #
 
-verify_runnable "global"
-
 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
 
 #
@@ -23,6 +21,8 @@ verify_runnable "global"
 #      run C program which tests passing different nvlists to lua
 #
 
+verify_runnable "global"
+
 log_assert "nvlist arguments can be passed to LUA."
 
 log_must nvlist_to_lua $TESTPOOL
index b5626e549d6d4d63b617d359e02bd1fab488fca0..10afa6727847d8dedef8ffa73b87427da5e4e2a4 100755 (executable)
@@ -14,8 +14,6 @@
 # Copyright (c) 2016 by Delphix. All rights reserved.
 #
 
-verify_runnable "global"
-
 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
 
 #
index dce26011321b09a1a21778ff008d34f27f6202bd..8b4ef6e760b027a533af6113ad737438a8a3f3bb 100755 (executable)
@@ -14,8 +14,6 @@
 # Copyright (c) 2016 by Delphix. All rights reserved.
 #
 
-verify_runnable "global"
-
 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
 
 #
index 78009dbbe52e2bf0062e68277d29fae5b03663f0..18c035e0464bd1c0a48fde36117e4005c50c014b 100755 (executable)
@@ -14,8 +14,6 @@
 # Copyright (c) 2016 by Delphix. All rights reserved.
 #
 
-verify_runnable "global"
-
 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
 
 #
index 33274c51d50925467b480dba2203078927acc2a6..9256e86771af64c892fcdf834acd75d798fbb1e7 100755 (executable)
@@ -14,8 +14,6 @@
 # Copyright (c) 2016, 2017 by Delphix. All rights reserved.
 #
 
-verify_runnable "global"
-
 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
 
 #
index 18f246889994602a273887613fcb3bd6a2f2e4cf..45a3fdb66a6fa8f66ca5f313d683f6b6a08e4e5b 100755 (executable)
 # Copyright (c) 2016, 2017 by Delphix. All rights reserved.
 #
 
-verify_runnable "global"
-
 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
 
+verify_runnable "global"
+
 fs=$TESTPOOL/$TESTFS/testchild
 
 function cleanup
index 8650322ad06504477d66435dbb61b99282f17daa..571d7f87c1b55ecb93101e3033b84630f59a27d0 100755 (executable)
 # Copyright (c) 2016, 2017 by Delphix. All rights reserved.
 #
 
-verify_runnable "global"
-
 . $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
 
+verify_runnable "global"
+
 snap=$TESTPOOL/$TESTFS@$TESTSNAP
 
 function cleanup
index 7508574190740d47615edfddcd8af53e56ca6f03..23d79c69075e38b177099a66f1ee4286c6cad770 100755 (executable)
@@ -90,7 +90,7 @@ function test_shared_device
        typeset checksum2=$(dev_checksum $sharedvdev)
 
        if [[ $checksum1 == $checksum2 ]]; then
-               log_pos "Device hasn't been modified by original pool"
+               log_pass "Device hasn't been modified by original pool"
        else
                log_fail "Device has been modified by original pool." \
                    "Checksum mismatch: $checksum1 != $checksum2."
index 1ef25e4dc5b23273819b978a3718d1baa7a20d58..bcf6a2296d5757f4ace58d5b0872afb2ee307b47 100755 (executable)
@@ -55,7 +55,7 @@ default_setup_noexit "$DISK" "" "volume"
 log_must zfs snapshot $TESTPOOL/$TESTFS@snap
 log_must zfs clone $TESTPOOL/$TESTFS@snap $TESTPOOL/$TESTFS/clone
 # create a file in the filesystem that isn't in the above snapshot
-touch /$TESTDIR/file.txt
+touch $TESTDIR/file.txt
 
 
 # create a non-default property and a child we can use to test inherit
@@ -116,28 +116,28 @@ then
 
        # Now create several virtual disks to test zpool with
 
-       mkfile $MINVDEVSIZE /$TESTDIR/disk1.dat
-       mkfile $MINVDEVSIZE /$TESTDIR/disk2.dat
-       mkfile $MINVDEVSIZE /$TESTDIR/disk3.dat
-       mkfile $MINVDEVSIZE /$TESTDIR/disk-additional.dat
-       mkfile $MINVDEVSIZE /$TESTDIR/disk-export.dat
-       mkfile $MINVDEVSIZE /$TESTDIR/disk-offline.dat
-       mkfile $MINVDEVSIZE /$TESTDIR/disk-spare1.dat
-       mkfile $MINVDEVSIZE /$TESTDIR/disk-spare2.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk1.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk2.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk3.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk-additional.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk-export.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk-offline.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk-spare1.dat
+       mkfile $MINVDEVSIZE $TEST_BASE_DIR/disk-spare2.dat
 
        # and create a pool we can perform attach remove replace,
        # etc. operations with
-       log_must zpool create $TESTPOOL.virt mirror /$TESTDIR/disk1.dat \
-       /$TESTDIR/disk2.dat /$TESTDIR/disk3.dat /$TESTDIR/disk-offline.dat \
-       spare /$TESTDIR/disk-spare1.dat
+       log_must zpool create $TESTPOOL.virt mirror $TEST_BASE_DIR/disk1.dat \
+       $TEST_BASE_DIR/disk2.dat $TEST_BASE_DIR/disk3.dat \
+       $TEST_BASE_DIR/disk-offline.dat spare $TEST_BASE_DIR/disk-spare1.dat
 
 
        # Offline one of the disks to test online
-       log_must zpool offline $TESTPOOL.virt /$TESTDIR/disk-offline.dat
+       log_must zpool offline $TESTPOOL.virt $TEST_BASE_DIR/disk-offline.dat
 
 
        # create an exported pool to test import
-       log_must zpool create $TESTPOOL.exported /$TESTDIR/disk-export.dat
+       log_must zpool create $TESTPOOL.exported $TEST_BASE_DIR/disk-export.dat
        log_must zpool export $TESTPOOL.exported
 
        set -A props $POOL_PROPS
@@ -154,8 +154,8 @@ then
 
        # copy a v1 pool from cli_root
        cp $STF_SUITE/tests/functional/cli_root/zpool_upgrade/blockfiles/zfs-pool-v1.dat.bz2 \
-           /$TESTDIR
-       log_must bunzip2 /$TESTDIR/zfs-pool-v1.dat.bz2
-       log_must zpool import -d /$TESTDIR v1-pool
+           $TEST_BASE_DIR/
+       log_must bunzip2 $TEST_BASE_DIR/zfs-pool-v1.dat.bz2
+       log_must zpool import -d $TEST_BASE_DIR/ v1-pool
 fi
 log_pass
index f058bf5c6e4500f1b07fc413afd4aa20a95ac094..aa380010574fd6e04d5c7573d484c69908af69d6 100755 (executable)
@@ -47,7 +47,6 @@ verify_runnable "global"
 
 log_assert "zpool upgrade returns an error when run as a user"
 
-log_onexit cleanup
 # zpool upgrade returns 0 when it can't do anything
 log_must zpool upgrade $TESTPOOL.virt