From 3b79c82e0367dfb1be03fd30cb4283056e83659e Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 15 Nov 2014 05:35:24 +0000 Subject: [PATCH] MFC r273627,r273628: r273627: - Print out "Bail out!" in die(..) so prove terminates immediately - Handle the output from newer versions of openssl md5, similar to what pjd@ did in r248304 Sponsored by: EMC / Isilon Storage Division r273628: Move the redirection to stderr out of the cmd variable assignment Putting 2>/dev/null in cmd= escapes the redirection operation, which causes mdconfig to think it's a filename Sponsored by: EMC / Isilon Storage Division git-svn-id: svn://svn.freebsd.org/base/stable/9@274544 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- tools/regression/zfs/misc.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/regression/zfs/misc.sh b/tools/regression/zfs/misc.sh index d96aa2279..b52481e86 100755 --- a/tools/regression/zfs/misc.sh +++ b/tools/regression/zfs/misc.sh @@ -39,6 +39,7 @@ fi die() { echo "${1}" > /dev/stderr + echo "Bail out!" exit 1 } @@ -166,8 +167,8 @@ create_memdisk() if [ -n "${devname}" ]; then devparam="-u ${devname}" fi - cmd="mdconfig -a -t swap -s ${size} ${devparam} 2>/dev/null" - DISKNAME=`${cmd}` || die "failed: ${cmd}" + cmd="mdconfig -a -t swap -s ${size} ${devparam}" + DISKNAME=`$cmd 2>/dev/null` || die "failed: ${cmd}" if [ -n "${devname}" ]; then DISKNAME="${devname}" fi @@ -363,7 +364,7 @@ files_destroy() name_create() { - echo "zfstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5 | cut -b -8`" + echo "zfstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5 | awk '{ print $NF }'`" } names_create() -- 2.45.0