diff mbox

fwts-test: arg-show-progress-dialog-0001: fix armhf failures, for test-0002

Message ID 1402567913-10008-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King June 12, 2014, 10:11 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

test-0002.sh unfortunately labelled itself as test-0001 which
confused matters when it failed in the same was as test-0001 on
slower arm builders. We also need the sed filters to normalise
the % progress and test duration output so that this test will
work on all architectures.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fwts-test/arg-show-progress-dialog-0001/test-0002.sh | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Comments

Ivan Hu June 12, 2014, 3:13 p.m. UTC | #1
On 06/12/2014 06:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> test-0002.sh unfortunately labelled itself as test-0001 which
> confused matters when it failed in the same was as test-0001 on
> slower arm builders. We also need the sed filters to normalise
> the % progress and test duration output so that this test will
> work on all architectures.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   fwts-test/arg-show-progress-dialog-0001/test-0002.sh | 20 ++++++++++++++++----
>   1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/fwts-test/arg-show-progress-dialog-0001/test-0002.sh b/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
> index 2a918d9..37fbad7 100755
> --- a/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
> +++ b/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
> @@ -1,11 +1,23 @@
>   #!/bin/bash
>   #
>   TEST="Test -D option"
> -NAME=test-0001.sh
> +NAME=test-0002.sh
>   TMPLOG=$TMP/progress.log.$$
> +TMPLOG_ORIG=$TMP/progress-0001.log.$$
>
> -$FWTS -w 80 -D -j $FWTSTESTDIR/../data --klog=$FWTSTESTDIR/arg-show-progress-dialog-0001/klog.txt oops klog > $TMPLOG
> -diff $TMPLOG $FWTSTESTDIR/arg-show-progress-dialog-0001/progress-0001.log >> $FAILURE_LOG
> +#
> +#  Normalise % progress and seconds to run so it works OK
> +#  with different progress roundings and test durations on
> +#  different architectures.
> +#
> +fixup()
> +{
> +	sed s'X[0-9]*\.[0-9]*%X00.00%X' | sed s'X[0-9]* secondsX0 secondsX'
> +}
> +
> +$FWTS -w 80 -D -j $FWTSTESTDIR/../data --klog=$FWTSTESTDIR/arg-show-progress-dialog-0001/klog.txt oops klog | fixup > $TMPLOG
> +fixup < $FWTSTESTDIR/arg-show-progress-dialog-0001/progress-0001.log > $TMPLOG_ORIG
> +diff $TMPLOG $TMPLOG_ORIG >> $FAILURE_LOG
>   ret=$?
>   if [ $ret -eq 0 ]; then
>   	echo PASSED: $TEST, $NAME
> @@ -13,5 +25,5 @@ else
>   	echo FAILED: $TEST, $NAME
>   fi
>
> -rm $TMPLOG
> +rm $TMPLOG $TMPLOG_ORIG
>   exit $ret
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Alex Hung June 12, 2014, 3:39 p.m. UTC | #2
On 06/12/2014 03:11 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> test-0002.sh unfortunately labelled itself as test-0001 which
> confused matters when it failed in the same was as test-0001 on
> slower arm builders. We also need the sed filters to normalise
> the % progress and test duration output so that this test will
> work on all architectures.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fwts-test/arg-show-progress-dialog-0001/test-0002.sh | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/fwts-test/arg-show-progress-dialog-0001/test-0002.sh b/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
> index 2a918d9..37fbad7 100755
> --- a/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
> +++ b/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
> @@ -1,11 +1,23 @@
>  #!/bin/bash
>  #
>  TEST="Test -D option"
> -NAME=test-0001.sh
> +NAME=test-0002.sh
>  TMPLOG=$TMP/progress.log.$$
> +TMPLOG_ORIG=$TMP/progress-0001.log.$$
>  
> -$FWTS -w 80 -D -j $FWTSTESTDIR/../data --klog=$FWTSTESTDIR/arg-show-progress-dialog-0001/klog.txt oops klog > $TMPLOG
> -diff $TMPLOG $FWTSTESTDIR/arg-show-progress-dialog-0001/progress-0001.log >> $FAILURE_LOG
> +#
> +#  Normalise % progress and seconds to run so it works OK
> +#  with different progress roundings and test durations on
> +#  different architectures.
> +#
> +fixup()
> +{
> +	sed s'X[0-9]*\.[0-9]*%X00.00%X' | sed s'X[0-9]* secondsX0 secondsX'
> +}
> +
> +$FWTS -w 80 -D -j $FWTSTESTDIR/../data --klog=$FWTSTESTDIR/arg-show-progress-dialog-0001/klog.txt oops klog | fixup > $TMPLOG
> +fixup < $FWTSTESTDIR/arg-show-progress-dialog-0001/progress-0001.log > $TMPLOG_ORIG
> +diff $TMPLOG $TMPLOG_ORIG >> $FAILURE_LOG
>  ret=$?
>  if [ $ret -eq 0 ]; then 
>  	echo PASSED: $TEST, $NAME
> @@ -13,5 +25,5 @@ else
>  	echo FAILED: $TEST, $NAME
>  fi
>  
> -rm $TMPLOG
> +rm $TMPLOG $TMPLOG_ORIG
>  exit $ret
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox

Patch

diff --git a/fwts-test/arg-show-progress-dialog-0001/test-0002.sh b/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
index 2a918d9..37fbad7 100755
--- a/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
+++ b/fwts-test/arg-show-progress-dialog-0001/test-0002.sh
@@ -1,11 +1,23 @@ 
 #!/bin/bash
 #
 TEST="Test -D option"
-NAME=test-0001.sh
+NAME=test-0002.sh
 TMPLOG=$TMP/progress.log.$$
+TMPLOG_ORIG=$TMP/progress-0001.log.$$
 
-$FWTS -w 80 -D -j $FWTSTESTDIR/../data --klog=$FWTSTESTDIR/arg-show-progress-dialog-0001/klog.txt oops klog > $TMPLOG
-diff $TMPLOG $FWTSTESTDIR/arg-show-progress-dialog-0001/progress-0001.log >> $FAILURE_LOG
+#
+#  Normalise % progress and seconds to run so it works OK
+#  with different progress roundings and test durations on
+#  different architectures.
+#
+fixup()
+{
+	sed s'X[0-9]*\.[0-9]*%X00.00%X' | sed s'X[0-9]* secondsX0 secondsX'
+}
+
+$FWTS -w 80 -D -j $FWTSTESTDIR/../data --klog=$FWTSTESTDIR/arg-show-progress-dialog-0001/klog.txt oops klog | fixup > $TMPLOG
+fixup < $FWTSTESTDIR/arg-show-progress-dialog-0001/progress-0001.log > $TMPLOG_ORIG
+diff $TMPLOG $TMPLOG_ORIG >> $FAILURE_LOG
 ret=$?
 if [ $ret -eq 0 ]; then 
 	echo PASSED: $TEST, $NAME
@@ -13,5 +25,5 @@  else
 	echo FAILED: $TEST, $NAME
 fi
 
-rm $TMPLOG
+rm $TMPLOG $TMPLOG_ORIG
 exit $ret