Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
*** 23,33 ****
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
! # Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/tests/functional/migration/migration.cfg
#
--- 23,33 ----
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
! # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
#
. $STF_SUITE/tests/functional/migration/migration.cfg
#
*** 41,51 ****
#
# Where:
# srcdir: is the directory where the testfile is
# cmd: is the command to be executed.
# E.g.
! # $TAR cf $TESTDIR/tar$$.tar
#
function prepare #srcdir cmd
{
typeset srcdir=$1
typeset cmd=$2
--- 41,51 ----
#
# Where:
# srcdir: is the directory where the testfile is
# cmd: is the command to be executed.
# E.g.
! # tar cf $TESTDIR/tar$$.tar
#
function prepare #srcdir cmd
{
typeset srcdir=$1
typeset cmd=$2
*** 80,90 ****
# destdir: is the directory where the command is to be executed on
# oldsuma: is the first part of the values returned by sum
# oldsumb: is the second part of the values returned by sum
# cmd: is the command to be executed;
# E.g.
! # "$TAR xf $TESTDIR/tar$$.tar"
#
function migrate #destdir oldsuma oldsumb cmd
{
typeset destdir=$1
typeset oldsuma=$2
--- 80,90 ----
# destdir: is the directory where the command is to be executed on
# oldsuma: is the first part of the values returned by sum
# oldsumb: is the second part of the values returned by sum
# cmd: is the command to be executed;
# E.g.
! # "tar xf $TESTDIR/tar$$.tar"
#
function migrate #destdir oldsuma oldsumb cmd
{
typeset destdir=$1
typeset oldsuma=$2
*** 97,117 ****
(( $? != 0 )) && return 1
$cmd
(( $? != 0 )) && return 1
! sumy=`$SUM ./$BNAME`
! suma=`$ECHO $sumy | $AWK '{print $1}'`
! sumb=`$ECHO $sumy | $AWK '{print $2}'`
if (( $oldsuma != $suma )); then
! log_note "$SUM values are not the same"
retval=1
fi
if (( $oldsumb != $sumb )); then
! log_note "$SUM values are not the same"
retval=1
fi
cd $cwd
(( $? != 0 )) && return 1
--- 97,117 ----
(( $? != 0 )) && return 1
$cmd
(( $? != 0 )) && return 1
! sumy=`sum ./$BNAME`
! suma=`echo $sumy | awk '{print $1}'`
! sumb=`echo $sumy | awk '{print $2}'`
if (( $oldsuma != $suma )); then
! log_note "sum values are not the same"
retval=1
fi
if (( $oldsumb != $sumb )); then
! log_note "sum values are not the same"
retval=1
fi
cd $cwd
(( $? != 0 )) && return 1
*** 128,151 ****
cwd=$PWD
cd $destdir
(( $? != 0 )) && return 1
! $CPIO -iv < $archive
(( $? != 0 )) && return 1
! sumy=`$SUM ./$BNAME`
! suma=`$ECHO $sumy | $AWK '{print $1}'`
! sumb=`$ECHO $sumy | $AWK '{print $2}'`
if (( $oldsuma != $suma )); then
! log_note "$SUM values are not the same"
retval=1
fi
if (( $oldsumb != $sumb )); then
! log_note "$SUM values are not the same"
retval=1
fi
cd $cwd
(( $? != 0 )) && return 1
--- 128,151 ----
cwd=$PWD
cd $destdir
(( $? != 0 )) && return 1
! cpio -iv < $archive
(( $? != 0 )) && return 1
! sumy=`sum ./$BNAME`
! suma=`echo $sumy | awk '{print $1}'`
! sumb=`echo $sumy | awk '{print $2}'`
if (( $oldsuma != $suma )); then
! log_note "sum values are not the same"
retval=1
fi
if (( $oldsumb != $sumb )); then
! log_note "sum values are not the same"
retval=1
fi
cd $cwd
(( $? != 0 )) && return 1