diff --git a/usr/src/test/zfs-tests/include/libtest.shlib b/usr/src/test/zfs-tests/include/libtest.shlib index 4c97362b71b4..3a3c1c466d1c 100644 --- a/usr/src/test/zfs-tests/include/libtest.shlib +++ b/usr/src/test/zfs-tests/include/libtest.shlib @@ -28,9 +28,6 @@ . ${STF_TOOLS}/contrib/include/logapi.shlib -ZFS=${ZFS:-/usr/sbin/zfs} -ZPOOL=${ZPOOL:-/usr/sbin/zpool} - # Determine whether a dataset is mounted # # $1 dataset name @@ -263,7 +260,7 @@ function create_bookmark snapexists $fs_vol@$snap || \ log_fail "$fs_vol@$snap must exist." - log_must $ZFS bookmark $fs_vol@$snap $fs_vol#$bkmark + log_must zfs bookmark $fs_vol@$snap $fs_vol#$bkmark } function default_mirror_setup @@ -558,7 +555,7 @@ function destroy_bookmark log_fail "'$bkmarkp' does not existed." fi - log_must $ZFS destroy $bkmark + log_must zfs destroy $bkmark } # Return 0 if a snapshot exists; $? otherwise @@ -578,7 +575,7 @@ function snapexists # function bkmarkexists { - $ZFS list -H -t bookmark "$1" > /dev/null 2>&1 + zfs list -H -t bookmark "$1" > /dev/null 2>&1 return $? } @@ -1585,136 +1582,6 @@ function cleanup_devices #vdevs return 0 } -# -# Verify the rsh connectivity to each remote host in RHOSTS. -# -# Return 0 if remote host is accessible; otherwise 1. -# $1 remote host name -# $2 username -# -function verify_rsh_connect #rhost, username -{ - typeset rhost=$1 - typeset username=$2 - typeset rsh_cmd="rsh -n" - typeset cur_user= - - getent hosts $rhost >/dev/null 2>&1 - if (($? != 0)); then - log_note "$rhost cannot be found from" \ - "administrative database." - return 1 - fi - - ping $rhost 3 >/dev/null 2>&1 - if (($? != 0)); then - log_note "$rhost is not reachable." - return 1 - fi - - if ((${#username} != 0)); then - rsh_cmd="$rsh_cmd -l $username" - cur_user="given user \"$username\"" - else - cur_user="current user \"`logname`\"" - fi - - if ! $rsh_cmd $rhost true; then - log_note "rsh to $rhost is not accessible" \ - "with $cur_user." - return 1 - fi - - return 0 -} - -# -# Verify the remote host connection via rsh after rebooting -# $1 remote host -# -function verify_remote -{ - rhost=$1 - - # - # The following loop waits for the remote system rebooting. - # Each iteration will wait for 150 seconds. there are - # total 5 iterations, so the total timeout value will - # be 12.5 minutes for the system rebooting. This number - # is an approxiate number. - # - typeset -i count=0 - while ! verify_rsh_connect $rhost; do - sleep 150 - ((count = count + 1)) - if ((count > 5)); then - return 1 - fi - done - return 0 -} - -# -# Replacement function for /usr/bin/rsh. This function will include -# the /usr/bin/rsh and meanwhile return the execution status of the -# last command. -# -# $1 usrname passing down to -l option of /usr/bin/rsh -# $2 remote machine hostname -# $3... command string -# - -function rsh_status -{ - typeset ruser=$1 - typeset rhost=$2 - typeset -i ret=0 - typeset cmd_str="" - typeset rsh_str="" - - shift; shift - cmd_str="$@" - - err_file=/tmp/${rhost}.$$.err - if ((${#ruser} == 0)); then - rsh_str="rsh -n" - else - rsh_str="rsh -n -l $ruser" - fi - - $rsh_str $rhost /usr/bin/ksh -c "'$cmd_str; \ - print -u 2 \"status=\$?\"'" \ - >/dev/null 2>$err_file - ret=$? - if (($ret != 0)); then - cat $err_file - rm -f $std_file $err_file - log_fail "rsh itself failed with exit code $ret..." - fi - - ret=$(grep -v 'print -u 2' $err_file | grep 'status=' | \ - cut -d= -f2) - (($ret != 0)) && cat $err_file >&2 - - rm -f $err_file >/dev/null 2>&1 - return $ret -} - -# -# Get the SUNWstc-fs-zfs package installation path in a remote host -# $1 remote host name -# -function get_remote_pkgpath -{ - typeset rhost=$1 - typeset pkgpath="" - - pkgpath=$(rsh -n $rhost "pkginfo -l SUNWstc-fs-zfs | grep BASEDIR: |\ - cut -d: -f2") - - echo $pkgpath -} - #/** # A function to find and locate free disks on a system or from given # disks as the parameter. It works by locating disks that are in use diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh index d12b1dc9a584..45f44be179d2 100644 --- a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_001_pos.ksh @@ -142,11 +142,11 @@ i=0 while ((i < ${#bookmark[@]})); do for opt in "${options[@]}"; do for prop in ${bookmark_props[@]}; do - eval "$ZFS get $opt $prop ${bookmark[i]} > \ + eval "zfs get $opt $prop ${bookmark[i]} > \ $TESTDIR/$TESTFILE0" ret=$? if [[ $ret != 0 ]]; then - log_fail "$ZFS get returned: $ret" + log_fail "zfs get returned: $ret" fi check_return_value ${bookmark[i]} "$prop" "$opt" done diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh index 0d70fba54e32..0341d4dc2d96 100644 --- a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_005_neg.ksh @@ -112,10 +112,10 @@ function test_options_bookmarks for dst in ${bookmark[@]}; do for opt in $opts; do for prop in $props; do - $ZFS get $opt -- $prop $dst > /dev/null 2>&1 + zfs get $opt -- $prop $dst > /dev/null 2>&1 ret=$? if [[ $ret == 0 ]]; then - log_fail "$ZFS get $opt -- $prop " \ + log_fail "zfs get $opt -- $prop " \ "$dst unexpectedly succeeded." fi done diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh index b81a974370c6..800d7ac5bdbc 100644 --- a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_008_pos.ksh @@ -103,7 +103,7 @@ for dst in ${bookmark[@]}; do while (( i < opt_numb )); do (( item = $RANDOM % ${#options[@]} )) (( depth_item = $RANDOM % ${#depth_options[@]} )) - log_must eval "$ZFS get -${depth_options[depth_item]} ${options[item]} $bookmark_props $dst > /dev/null 2>&1" + log_must eval "zfs get -${depth_options[depth_item]} ${options[item]} $bookmark_props $dst > /dev/null 2>&1" (( i += 1 )) done done diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib index f08ae1abdd54..15921201c7b4 100644 --- a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib @@ -122,7 +122,7 @@ function setup_snap_env # before taking a snapshot. # if [[ $dtst == $VOL ]]; then - log_must /usr/sbin/lockfs -f $TESTDIR1 + log_must lockfs -f $TESTDIR1 fi log_must zfs snapshot $snap fi diff --git a/usr/src/test/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib b/usr/src/test/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib index 4957b8ea92aa..485e591dc0ab 100644 --- a/usr/src/test/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib +++ b/usr/src/test/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib @@ -57,11 +57,11 @@ do (( i = i + 1 )) done -\sleep 1 +sleep 1 for pid in \$PIDS do - \wait \$pid + wait \$pid (( \$? == 127 )) && exit 1 done exit 0