public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chandra Seetharaman <sekharan@us.ibm.com>
To: Lukas Czerner <lczerner@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 07/10 v2] xfstests: Prepare for config section
Date: Fri, 02 Aug 2013 18:53:51 -0500	[thread overview]
Message-ID: <1375487631.4155.75.camel@chandra-dt.ibm.com> (raw)
In-Reply-To: <1373539085-8577-8-git-send-email-lczerner@redhat.com>

On Thu, 2013-07-11 at 12:38 +0200, Lukas Czerner wrote:
> This stupid patch only put the indentation in place so we will be able

I would suggest to remove "stupid" :).

You can simply say that this patch just indents the script to make the
review of next patch easier.
 
> to clearly see and review changes made in the second patch which will

s/second/next/

> add a loop (instead of allways-true condition introduced in this patch)

s/allways/always/

> adding support for config sections. There are no changes in the logic,
> only indentation changes.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> ---
>  check | 314 +++++++++++++++++++++++++++++++++---------------------------------
>  1 file changed, 157 insertions(+), 157 deletions(-)
> 
> diff --git a/check b/check
> index 428eba1..677650c 100755
> --- a/check
> +++ b/check
> @@ -356,186 +356,186 @@ END	{ if (NR > 0) {
> 
>  trap "_wrapup; exit \$status" 0 1 2 3 15
> 
> -mkdir -p $RESULT_BASE
> -if [ ! -d $RESULT_BASE ]; then
> -	echo "failed to create results directory $RESULTS_BASE"
> -	exit 1;
> -fi
> +if true; then
> +	mkdir -p $RESULT_BASE
> +	if [ ! -d $RESULT_BASE ]; then
> +		echo "failed to create results directory $RESULTS_BASE"
> +		exit 1;
> +	fi
> 
> -seq="check"
> -check="$RESULT_BASE/check"
> +	seq="check"
> +	check="$RESULT_BASE/check"
> 
>  # don't leave old full output behind on a clean run
> -rm -f $check.full
> +	rm -f $check.full
> 
> -[ -f $check.time ] || touch $check.time
> +	[ -f $check.time ] || touch $check.time
> 
>  # print out our test configuration
> -echo "FSTYP         -- `_full_fstyp_details`"
> -echo "PLATFORM      -- `_full_platform_details`"
> -if [ ! -z "$SCRATCH_DEV" ]; then
> -  echo "MKFS_OPTIONS  -- `_scratch_mkfs_options`"
> -  echo "MOUNT_OPTIONS -- `_scratch_mount_options`"
> -fi
> -echo
> -
> -
> -if [ ! -z "$SCRATCH_DEV" ]; then
> -  umount $SCRATCH_DEV 2>/dev/null
> -  # call the overridden mkfs - make sure the FS is built
> -  # the same as we'll create it later.
> -
> -  if ! _scratch_mkfs $flag >$tmp.err 2>&1
> -  then
> -      echo "our local _scratch_mkfs routine ..."
> -      cat $tmp.err
> -      echo "check: failed to mkfs \$SCRATCH_DEV using specified options"
> -      exit 1
> -  fi
> -
> -  # call the overridden mount - make sure the FS mounts with
> -  # the same options that we'll mount with later.
> -  if ! _scratch_mount >$tmp.err 2>&1
> -  then
> -      echo "our local mount routine ..."
> -      cat $tmp.err
> -      echo "check: failed to mount \$SCRATCH_DEV using specified options"
> -      exit 1
> -  fi
> -fi
> -
> -seqres="$check"
> -_check_test_fs
> -
> -for seq in $list
> -do
> -    err=false
> +	echo "FSTYP         -- `_full_fstyp_details`"
> +	echo "PLATFORM      -- `_full_platform_details`"
> +	if [ ! -z "$SCRATCH_DEV" ]; then
> +		echo "MKFS_OPTIONS  -- `_scratch_mkfs_options`"
> +		echo "MOUNT_OPTIONS -- `_scratch_mount_options`"
> +	fi
> +	echo
> 
> -    # the filename for the test and the name output are different.
> -    # we don't include the tests/ directory in the name output.
> -    seqnum=`echo $seq | sed -e "s;$SRC_DIR/;;"`
> 
> -    # Similarly, the result directory needs to replace the tests/
> -    # part of the test location.
> -    group=`dirname $seq`
> -    export RESULT_DIR=`echo $group | sed -e "s;$SRC_DIR;$RESULT_BASE;"`
> -    mkdir -p $RESULT_DIR
> -    seqres="$RESULT_BASE/$seqnum"
> +	if [ ! -z "$SCRATCH_DEV" ]; then
> +		umount $SCRATCH_DEV 2>/dev/null
> +		# call the overridden mkfs - make sure the FS is built
> +		# the same as we'll create it later.
> 
> -    echo -n "$seqnum"
> +		if ! _scratch_mkfs $flag >$tmp.err 2>&1
> +		then
> +			echo "our local _scratch_mkfs routine ..."
> +			cat $tmp.err
> +			echo "check: failed to mkfs \$SCRATCH_DEV using specified options"
> +			exit 1
> +		fi
> 
> -    if $showme
> -    then
> -	echo
> -	continue
> -    elif [ ! -f $seq ]
> -    then
> -	echo " - no such test?"
> -    else
> -	# really going to try and run this one
> -	#
> -	rm -f $seqres.out.bad
> -
> -	# check if we really should run it
> -	if [ -s $tmp.xlist ]; then
> -		if grep $seqnum $tmp.xlist > /dev/null 2>&1 ; then
> -			echo "       [expunged]"
> -			continue
> +		# call the overridden mount - make sure the FS mounts with
> +		# the same options that we'll mount with later.
> +		if ! _scratch_mount >$tmp.err 2>&1
> +		then
> +			echo "our local mount routine ..."
> +			cat $tmp.err
> +			echo "check: failed to mount \$SCRATCH_DEV using specified options"
> +			exit 1
>  		fi
>  	fi
> 
> -	# slashes now in names, sed barfs on them so use grep
> -	lasttime=`grep -w ^$seqnum $check.time | awk '// {print $2}'`
> -	if [ "X$lasttime" != X ]; then
> -		echo -n " ${lasttime}s ..."
> -	else
> -		echo -n "	"	# prettier output with timestamps.
> -	fi
> -	rm -f core $seqres.notrun
> +	seqres="$check"
> +	_check_test_fs
> 
> -	start=`_wallclock`
> -	$timestamp && echo -n "	["`date "+%T"`"]"
> -	[ ! -x $seq ] && chmod u+x $seq # ensure we can run it
> -	$LOGGER_PROG "run xfstest $seqnum"
> -	./$seq >$tmp.rawout 2>&1
> -	sts=$?
> -	$timestamp && _timestamp
> -	stop=`_wallclock`
> +	for seq in $list
> +	do
> +		err=false
> 
> -	_fix_malloc <$tmp.rawout >$tmp.out
> -	rm -f $tmp.rawout
> +		# the filename for the test and the name output are different.
> +		# we don't include the tests/ directory in the name output.
> +		seqnum=`echo $seq | sed -e "s;$SRC_DIR/;;"`
> 
> -	if [ -f core ]
> -	then
> -	    echo -n " [dumped core]"
> -	    mv core $RESULT_BASE/$seqnum.core
> -	    err=true
> -	fi
> +		# Similarly, the result directory needs to replace the tests/
> +		# part of the test location.
> +		group=`dirname $seq`
> +		export RESULT_DIR=`echo $group | sed -e "s;$SRC_DIR;$RESULT_BASE;"`
> +		mkdir -p $RESULT_DIR
> +		seqres="$RESULT_BASE/$seqnum"
> 
> -	if [ -f $seqres.notrun ]
> -	then
> -	    $timestamp || echo -n " [not run] "
> -	    $timestamp && echo " [not run]" && echo -n "	$seqnum -- "
> -	    cat $seqres.notrun
> -	    notrun="$notrun $seqnum"
> -	else
> -	    if [ $sts -ne 0 ]
> -	    then
> -		echo -n " [failed, exit status $sts]"
> -		err=true
> -	    fi
> -	    if [ ! -f $seq.out ]
> -	    then
> -		echo " - no qualified output"
> -		err=true
> -	    else
> -		if diff $seq.out $tmp.out >/dev/null 2>&1
> +		echo -n "$seqnum"
> +
> +		if $showme
> +		then
> +			echo
> +			continue
> +		elif [ ! -f $seq ]
>  		then
> -		    if $err
> -		    then
> -			:
> -		    else
> -			echo "$seqnum `expr $stop - $start`" >>$tmp.time
> -			echo -n " `expr $stop - $start`s"
> -		    fi
> -		    echo ""
> +			echo " - no such test?"
>  		else
> -		    echo " - output mismatch (see $seqres.out.bad)"
> -		    mv $tmp.out $seqres.out.bad
> -		    $diff $seq.out $seqres.out.bad | {
> -		        if test "$DIFF_LENGTH" -le 0; then
> -				cat
> +			# really going to try and run this one
> +			#
> +			rm -f $seqres.out.bad
> +
> +			# check if we really should run it
> +			if [ -s $tmp.xlist ]; then
> +				if grep $seqnum $tmp.xlist > /dev/null 2>&1 ; then
> +					echo "       [expunged]"
> +					continue
> +				fi
> +			fi
> +
> +			# slashes now in names, sed barfs on them so use grep
> +			lasttime=`grep -w ^$seqnum $check.time | awk '// {print $2}'`
> +			if [ "X$lasttime" != X ]; then
> +				echo -n " ${lasttime}s ..."
>  			else
> -				head -n "$DIFF_LENGTH"
> -			fi; } | \
> -			sed -e 's/^\(.\)/    \1/'
> -		    echo "     ..."
> -		    echo "     (Run '$diff $seq.out $seqres.out.bad' to see the" \
> -			 "entire diff)"
> -		    err=true
> -		fi
> -	    fi
> -	fi
> +				echo -n "	"	# prettier output with timestamps.
> +			fi
> +			rm -f core $seqres.notrun
> +
> +			start=`_wallclock`
> +			$timestamp && echo -n "	["`date "+%T"`"]"
> +			[ ! -x $seq ] && chmod u+x $seq # ensure we can run it
> +			$LOGGER_PROG "run xfstest $seqnum"
> +			./$seq >$tmp.rawout 2>&1
> +			sts=$?
> +			$timestamp && _timestamp
> +			stop=`_wallclock`
> +
> +			_fix_malloc <$tmp.rawout >$tmp.out
> +			rm -f $tmp.rawout
> +
> +			if [ -f core ]
> +			then
> +				echo -n " [dumped core]"
> +				mv core $RESULT_BASE/$seqnum.core
> +			    err=true
> +			fi
> 
> -    fi
> +			if [ -f $seqres.notrun ]
> +			then
> +				$timestamp || echo -n " [not run] "
> +				$timestamp && echo " [not run]" && echo -n "	$seqnum -- "
> +				cat $seqres.notrun
> +				notrun="$notrun $seqnum"
> +			else
> +				if [ $sts -ne 0 ]
> +				then
> +					echo -n " [failed, exit status $sts]"
> +					err=true
> +				fi
> +				if [ ! -f $seq.out ]
> +				then
> +					echo " - no qualified output"
> +					err=true
> +				else
> +					if diff $seq.out $tmp.out >/dev/null 2>&1
> +					then
> +						if $err
> +						then
> +							:
> +						else
> +							echo "$seqnum `expr $stop - $start`" >>$tmp.time
> +							echo -n " `expr $stop - $start`s"
> +						fi
> +						echo ""
> +					else
> +						echo " - output mismatch (see $seqres.out.bad)"
> +						mv $tmp.out $seqres.out.bad
> +						$diff $seq.out $seqres.out.bad | {
> +						if test "$DIFF_LENGTH" -le 0; then
> +							cat
> +						else
> +							head -n "$DIFF_LENGTH"
> +						fi; } | \
> +						sed -e 's/^\(.\)/    \1/'
> +						echo "     ..."
> +						echo "     (Run '$diff $seq.out $seqres.out.bad' to see the entire diff)"
> +						err=true
> +					fi
> +				fi
> +			fi
> +		fi
> 
> -    # come here for each test, except when $showme is true
> -    #
> -    if $err
> -    then
> -	bad="$bad $seqnum"
> -	n_bad=`expr $n_bad + 1`
> -	quick=false
> -    fi
> -    if [ ! -f $seqres.notrun ]
> -    then
> -	try="$try $seqnum"
> -	n_try=`expr $n_try + 1`
> -        _check_test_fs
> -    fi
> +		# come here for each test, except when $showme is true
> +		#
> +		if $err
> +		then
> +			bad="$bad $seqnum"
> +			n_bad=`expr $n_bad + 1`
> +			quick=false
> +		fi
> +		if [ ! -f $seqres.notrun ]
> +		then
> +			try="$try $seqnum"
> +			n_try=`expr $n_try + 1`
> +			_check_test_fs
> +		fi
> 
> -    seq="after_$seqnum"
> -done
> +		 seq="after_$seqnum"
> +	done
> +fi
> 
>  interrupt=false
>  status=`expr $n_bad`


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-08-02 23:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 10:37 [RFC][PATCH 00/10 v2] xfstests: Add support for config section Lukas Czerner
2013-07-11 10:37 ` [PATCH 01/10 v2] xfstests: Run all tests when nothing is specified Lukas Czerner
2013-08-02 23:48   ` Chandra Seetharaman
2013-10-16 19:36   ` Rich Johnston
2013-07-11 10:37 ` [PATCH 02/10 v2] xfstests: Export all important variables in common/config Lukas Czerner
2013-08-02 23:49   ` Chandra Seetharaman
2013-07-11 10:37 ` [PATCH 03/10 v2] xfstests: Refactor code for obtaining test list Lukas Czerner
2013-08-02 23:49   ` Chandra Seetharaman
2013-07-11 10:37 ` [PATCH 04/10 v2] xfstests: Allow to recheck options in common/rc Lukas Czerner
2013-08-02 23:50   ` Chandra Seetharaman
2013-07-11 10:38 ` [PATCH 05/10 v2] xfstests: Allow to re-read configuration Lukas Czerner
2013-08-02 23:51   ` Chandra Seetharaman
2013-07-11 10:38 ` [PATCH 06/10 v2] xfstests: Allow to specify RESULT_BASE directory Lukas Czerner
2013-08-02 23:51   ` Chandra Seetharaman
2013-07-11 10:38 ` [PATCH 07/10 v2] xfstests: Prepare for config section Lukas Czerner
2013-08-02 23:53   ` Chandra Seetharaman [this message]
2013-07-11 10:38 ` [PATCH 08/10 v2] xfstests: Add support for sections in config file Lukas Czerner
2013-08-03  0:05   ` Chandra Seetharaman
2013-07-11 10:38 ` [PATCH 09/10 v2] xfstests: Allow to recreate TEST_DEV Lukas Czerner
2013-08-03  0:13   ` Chandra Seetharaman
2013-07-11 10:38 ` [PATCH 10/10 v2] xfstests: Remount file system if MOUNT_OPTIONS changed Lukas Czerner
2013-08-03  0:14   ` Chandra Seetharaman
2013-10-16 20:51   ` Rich Johnston
2013-10-17 10:49     ` [PATCH 10/10 v2] xfstests: Remount file system if MOUNT_OPTIONS changedx Lukáš Czerner
2013-08-16 15:43 ` [RFC][PATCH 00/10 v2] xfstests: Add support for config section Rich Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375487631.4155.75.camel@chandra-dt.ibm.com \
    --to=sekharan@us.ibm.com \
    --cc=lczerner@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox