All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: fstests@vger.kernel.org, arnd@arndb.de, y2038@lists.linaro.org
Subject: Re: [PATCH] generic/402: update test script style
Date: Fri, 25 Oct 2019 00:01:41 +0800	[thread overview]
Message-ID: <20191024160141.GF2543@desktop> (raw)
In-Reply-To: <20191023220401.12335-1-deepa.kernel@gmail.com>

On Wed, Oct 23, 2019 at 03:04:01PM -0700, Deepa Dinamani wrote:
> Removed test result checking, as test result already depends on
> output diff comparison with the golden output.
> 
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>

Thanks! I've folded this into original patch.

Thanks,
Eryu

> ---
>  tests/generic/402     | 33 +++++++--------------------------
>  tests/generic/402.out |  2 +-
>  2 files changed, 8 insertions(+), 27 deletions(-)
> 
> diff --git a/tests/generic/402 b/tests/generic/402
> index dd136ec2..0392c258 100755
> --- a/tests/generic/402
> +++ b/tests/generic/402
> @@ -44,14 +44,11 @@ check_stat()
>  	prev_timestamp="$timestamp;$timestamp"
>  	if [ $prev_timestamp != $stat_timestamp ]; then
>  		echo "$prev_timestamp != $stat_timestamp" | tee -a $seqres.full
> -		return 1
>  	fi
> -	return 0
>  }
>  
>  run_test_individual()
>  {
> -	fail=0
>  	file=$1
>  	timestamp=$2
>  	update_time=$3
> @@ -62,33 +59,24 @@ run_test_individual()
>  		$XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file
>  		if [ $? -ne 0 ]; then
>  			echo "Failed to update times on $file" | tee -a $seqres.full
> -			fail=1
>  		fi
>  	fi
>  
>  	tsclamp=$((timestamp<tsmin?tsmin:timestamp>tsmax?tsmax:timestamp))
>  	echo "Checking file: $file Updated timestamp is $tsclamp"  >> $seqres.full
> -	if ! check_stat $file $tsclamp; then
> -		fail=1
> -	fi
> -	return $fail
> +	check_stat $file $tsclamp
>  }
>  
>  run_test()
>  {
> -	fail=0
>  	update_time=$1
>  
>  	n=1
>  
>  	for TIME in "${TIMESTAMPS[@]}"; do
> -		if ! run_test_individual ${SCRATCH_MNT}/test_$n $TIME $update_time; then
> -			fail=1
> -		fi
> +		run_test_individual ${SCRATCH_MNT}/test_$n $TIME $update_time
>  		((n++))
>  	done
> -
> -	return $fail
>  }
>  
>  _scratch_mkfs &>> $seqres.full 2>&1 || _fail "mkfs failed"
> @@ -108,8 +96,7 @@ declare -a TIMESTAMPS=(
>  	$((tsmax+1))
>  )
>  
> -_scratch_mount
> -result=$?
> +_scratch_mount || _fail "scratch mount failed"
>  
>  status=0
>  
> @@ -119,9 +106,7 @@ echo "In memory timestamps update test start" >> $seqres.full
>  # update time on the file
>  update_time=1
>  
> -if ! run_test $update_time; then
> -	status=1
> -fi
> +run_test $update_time
>  
>  echo "In memory timestamps update complete" >> $seqres.full
>  
> @@ -140,13 +125,9 @@ update_time=0
>  echo "On disk timestamps update test start" >> $seqres.full
>  
>  # Re-run test
> -if ! run_test $update_time; then
> -	status=1
> -fi
> +run_test $update_time
>  
>  echo "On disk timestamps update test complete" >> $seqres.full
>  
> -echo "inode timestamp tests completed status $status"
> -
> -# success, all done
> -exit $status
> +echo Silence is golden
> +exit
> diff --git a/tests/generic/402.out b/tests/generic/402.out
> index 4500e6c7..28e1501c 100644
> --- a/tests/generic/402.out
> +++ b/tests/generic/402.out
> @@ -1,2 +1,2 @@
>  QA output created by 402
> -inode timestamp tests completed status 0
> +Silence is golden
> -- 
> 2.17.1
> 

      reply	other threads:[~2019-10-24 16:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 22:04 [PATCH] generic/402: update test script style Deepa Dinamani
2019-10-24 16:01 ` Eryu Guan [this message]

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=20191024160141.GF2543@desktop \
    --to=guaneryu@gmail.com \
    --cc=arnd@arndb.de \
    --cc=deepa.kernel@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=y2038@lists.linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.