diff mbox

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

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

Commit Message

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

The progress stats have more precision and show the length of
test duration.  This however breaks the testing on armhf because
of different floating point % progress values and also the longer
test runs on armhf.  To accommodate these differences, I've added
a couple of sed filters to normalise the % progress and test
duration output so that this test will work on all architectures.

Tested on armhf and amd64.

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

Comments

Keng-Yu Lin June 12, 2014, 2:59 a.m. UTC | #1
On Wed, Jun 11, 2014 at 6:54 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The progress stats have more precision and show the length of
> test duration.  This however breaks the testing on armhf because
> of different floating point % progress values and also the longer
> test runs on armhf.  To accommodate these differences, I've added
> a couple of sed filters to normalise the % progress and test
> duration output so that this test will work on all architectures.
>
> Tested on armhf and amd64.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fwts-test/arg-show-progress-dialog-0001/test-0001.sh | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
> index b6e1809..609aa8a 100755
> --- a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
> +++ b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
> @@ -3,9 +3,21 @@
>  TEST="Test --show-progress-dialog option"
>  NAME=test-0001.sh
>  TMPLOG=$TMP/progress.log.$$
> +TMPLOG_ORIG=$TMP/progress-0001.log.$$
>
> -$FWTS -w 80 --show-progress-dialog -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 --show-progress-dialog -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
> --
> 2.0.0
>

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu June 12, 2014, 6:45 a.m. UTC | #2
On 06/11/2014 06:54 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The progress stats have more precision and show the length of
> test duration.  This however breaks the testing on armhf because
> of different floating point % progress values and also the longer
> test runs on armhf.  To accommodate these differences, I've added
> a couple of sed filters to normalise the % progress and test
> duration output so that this test will work on all architectures.
>
> Tested on armhf and amd64.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   fwts-test/arg-show-progress-dialog-0001/test-0001.sh | 18 +++++++++++++++---
>   1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
> index b6e1809..609aa8a 100755
> --- a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
> +++ b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
> @@ -3,9 +3,21 @@
>   TEST="Test --show-progress-dialog option"
>   NAME=test-0001.sh
>   TMPLOG=$TMP/progress.log.$$
> +TMPLOG_ORIG=$TMP/progress-0001.log.$$
>
> -$FWTS -w 80 --show-progress-dialog -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 --show-progress-dialog -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>
Keng-Yu Lin June 13, 2014, 3:56 a.m. UTC | #3
On Thu, Jun 12, 2014 at 2:45 PM, IvanHu <ivan.hu@canonical.com> wrote:
> On 06/11/2014 06:54 PM, Colin King wrote:
>>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The progress stats have more precision and show the length of
>> test duration.  This however breaks the testing on armhf because
>> of different floating point % progress values and also the longer
>> test runs on armhf.  To accommodate these differences, I've added
>> a couple of sed filters to normalise the % progress and test
>> duration output so that this test will work on all architectures.
>>
>> Tested on armhf and amd64.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   fwts-test/arg-show-progress-dialog-0001/test-0001.sh | 18
>> +++++++++++++++---
>>   1 file changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
>> b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
>> index b6e1809..609aa8a 100755
>> --- a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
>> +++ b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
>> @@ -3,9 +3,21 @@
>>   TEST="Test --show-progress-dialog option"
>>   NAME=test-0001.sh
>>   TMPLOG=$TMP/progress.log.$$
>> +TMPLOG_ORIG=$TMP/progress-0001.log.$$
>>
>> -$FWTS -w 80 --show-progress-dialog -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 --show-progress-dialog -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>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff mbox

Patch

diff --git a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
index b6e1809..609aa8a 100755
--- a/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
+++ b/fwts-test/arg-show-progress-dialog-0001/test-0001.sh
@@ -3,9 +3,21 @@ 
 TEST="Test --show-progress-dialog option"
 NAME=test-0001.sh
 TMPLOG=$TMP/progress.log.$$
+TMPLOG_ORIG=$TMP/progress-0001.log.$$
 
-$FWTS -w 80 --show-progress-dialog -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 --show-progress-dialog -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