From 10f251191f16d53d8a64a934e83c3bfe6cd9195f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 7 Apr 2017 09:30:05 -0700 Subject: [PATCH] OpenZFS 7629 - Fix for 7290 neglected to remove some escape sequences Authored by: John Wren Kennedy Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Reviewed-by: George Melikov Ported-by: Brian Behlendorf Porting Notes: - Multiple changes in this commit were applied in c1d9abf. OpenZFS-issue: https://www.illumos.org/issues/7629 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/f5fb56d Closes #5980 --- tests/zfs-tests/include/libtest.shlib | 130 ------------------ .../zfs_rollback/zfs_rollback_common.kshlib | 2 +- .../mv_files/mv_files_common.kshlib | 4 +- 3 files changed, 3 insertions(+), 133 deletions(-) diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index 4a6a15ec4..d9d23d52d 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -2050,136 +2050,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 /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/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib index 9faf8dfcc..8f79113dc 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rollback/zfs_rollback_common.kshlib @@ -125,7 +125,7 @@ function setup_snap_env # to disk before taking a snapshot. # if [[ $dtst == $VOL ]]; then - log_must $LOCKFS -f $TESTDIR1 + log_must lockfs -f $TESTDIR1 fi fi log_must zfs snapshot $snap diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib b/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib index b18889fe1..c48c07d8d 100644 --- a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib +++ b/tests/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 -- 2.40.0