ACK: [PATCH] fwts-test: arg-show-tests-0001: reset tty after forcing column width

Alex Hung alex.hung at canonical.com
Mon May 16 08:44:19 UTC 2016


On 05/16/2016 04:30 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> We should only run this test if we can reset the width to 80 colummns
> and we need to reset the tty width back at the end of the test
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   fwts-test/arg-show-tests-0001/test-0001.sh | 14 +++++++++++++-
>   fwts-test/arg-show-tests-0001/test-0002.sh | 14 +++++++++++++-
>   2 files changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/fwts-test/arg-show-tests-0001/test-0001.sh b/fwts-test/arg-show-tests-0001/test-0001.sh
> index 537af53..a62071c 100755
> --- a/fwts-test/arg-show-tests-0001/test-0001.sh
> +++ b/fwts-test/arg-show-tests-0001/test-0001.sh
> @@ -13,7 +13,16 @@ if [ $? -eq 1 ]; then
>   	exit 77
>   fi
>
> -stty cols 80
> +cols=$(stty -a | tr ';' '\n' | grep "columns" | cut -d' ' -f3) 2> /dev/null
> +#
> +#  If we can't set the tty then we can't test
> +#
> +stty cols 80 2> /dev/null
> +if [ $? -eq 1 ]; then
> +        tset 2> /dev/null
> +        echo SKIP: $TEST, $NAME
> +        exit 77
> +fi
>   $FWTS -s > $TMPLOG
>   diff $TMPLOG $FWTSTESTDIR/arg-show-tests-0001/arg-show-tests-0001.log >> $FAILURE_LOG
>   ret=$?
> @@ -23,5 +32,8 @@ else
>   	echo FAILED: $TEST, $NAME
>   fi
>
> +stty cols 80 2> /dev/null
> +tset 2> /dev/null
> +
>   rm $TMPLOG
>   exit $ret
> diff --git a/fwts-test/arg-show-tests-0001/test-0002.sh b/fwts-test/arg-show-tests-0001/test-0002.sh
> index 2382b4c..f92fd8f 100755
> --- a/fwts-test/arg-show-tests-0001/test-0002.sh
> +++ b/fwts-test/arg-show-tests-0001/test-0002.sh
> @@ -13,7 +13,16 @@ if [ $? -eq 1 ]; then
>   	exit 77
>   fi
>
> -stty cols 80
> +cols=$(stty -a | tr ';' '\n' | grep "columns" | cut -d' ' -f3) 2> /dev/null
> +#
> +#  If we can't set the tty then we can't test
> +#
> +stty cols 80 2> /dev/null
> +if [ $? -eq 1 ]; then
> +        tset 2> /dev/null
> +        echo SKIP: $TEST, $NAME
> +        exit 77
> +fi
>   $FWTS -s > $TMPLOG
>   diff $TMPLOG $FWTSTESTDIR/arg-show-tests-0001/arg-show-tests-0001.log >> $FAILURE_LOG
>   ret=$?
> @@ -23,5 +32,8 @@ else
>   	echo FAILED: $TEST, $NAME
>   fi
>
> +stty cols 80 2> /dev/null
> +tset 2> /dev/null
> +
>   rm $TMPLOG
>   exit $ret
>

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list