[VSP-Tests,1/7] tests: add pseudo platform test
diff mbox series

Message ID 20181204155146.9726-2-kieran.bingham@ideasonboard.com
State New
Delegated to: Kieran Bingham
Headers show
Series
  • Reset controls and unloved patches
Related show

Commit Message

Kieran Bingham Dec. 4, 2018, 3:51 p.m. UTC
Provide an initial test which can run as part of the test suite.
This test will report the platform and kernel version, along with
the identified paths of required utilities.

This will aid in ensuring that required tools are available on a
running platform - and report the kernel and platform details in
any test suite output for clarification of results.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 tests/vsp-unit-test-0000.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100755 tests/vsp-unit-test-0000.sh

Comments

Laurent Pinchart Feb. 17, 2019, 2:41 a.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Tue, Dec 04, 2018 at 03:51:40PM +0000, Kieran Bingham wrote:
> Provide an initial test which can run as part of the test suite.
> This test will report the platform and kernel version, along with
> the identified paths of required utilities.
> 
> This will aid in ensuring that required tools are available on a
> running platform - and report the kernel and platform details in
> any test suite output for clarification of results.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  tests/vsp-unit-test-0000.sh | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100755 tests/vsp-unit-test-0000.sh
> 
> diff --git a/tests/vsp-unit-test-0000.sh b/tests/vsp-unit-test-0000.sh
> new file mode 100755
> index 000000000000..144cfc677b32
> --- /dev/null
> +++ b/tests/vsp-unit-test-0000.sh
> @@ -0,0 +1,20 @@
> +#!/bin/sh
> +
> +# Report testing conditions
> +
> +model=`cat /sys/firmware/devicetree/base/model`

Please use $(...) instead of `...`, it's more readable.

> +
> +echo "Test Conditions:"
> +
> +function check_all() {
> +	echo "  Platform: " "$model"
> +	echo "  Kernel release: " `uname -r`
> +	echo "  convert: " `which convert`
> +	echo "  compare: " `which compare`
> +	echo "  killall: " `which killall`
> +	echo "  raw2rgbpnm: " `which raw2rgbpnm`
> +	echo "  stress: " `which stress`
> +	echo "  yavta: " `which yavta`
> +}
> +
> +check_all | column -ts ":"

Could we remove the dependency on the column tool ? I don't have it in
my buildroot environment :-) I could of course add it, but in this case
I think it's easy enough to align the columns manually.

With these fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Kieran Bingham Feb. 17, 2019, 8:41 p.m. UTC | #2
Hi Laurent,

On 17/02/2019 02:41, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.
> 
> On Tue, Dec 04, 2018 at 03:51:40PM +0000, Kieran Bingham wrote:
>> Provide an initial test which can run as part of the test suite.
>> This test will report the platform and kernel version, along with
>> the identified paths of required utilities.
>>
>> This will aid in ensuring that required tools are available on a
>> running platform - and report the kernel and platform details in
>> any test suite output for clarification of results.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>> ---
>>  tests/vsp-unit-test-0000.sh | 20 ++++++++++++++++++++
>>  1 file changed, 20 insertions(+)
>>  create mode 100755 tests/vsp-unit-test-0000.sh
>>
>> diff --git a/tests/vsp-unit-test-0000.sh b/tests/vsp-unit-test-0000.sh
>> new file mode 100755
>> index 000000000000..144cfc677b32
>> --- /dev/null
>> +++ b/tests/vsp-unit-test-0000.sh
>> @@ -0,0 +1,20 @@
>> +#!/bin/sh
>> +
>> +# Report testing conditions
>> +
>> +model=`cat /sys/firmware/devicetree/base/model`
> 
> Please use $(...) instead of `...`, it's more readable.

Sure.

> 
>> +
>> +echo "Test Conditions:"
>> +
>> +function check_all() {
>> +	echo "  Platform: " "$model"
>> +	echo "  Kernel release: " `uname -r`
>> +	echo "  convert: " `which convert`
>> +	echo "  compare: " `which compare`
>> +	echo "  killall: " `which killall`
>> +	echo "  raw2rgbpnm: " `which raw2rgbpnm`
>> +	echo "  stress: " `which stress`
>> +	echo "  yavta: " `which yavta`
>> +}
>> +
>> +check_all | column -ts ":"
> 
> Could we remove the dependency on the column tool ? I don't have it in
> my buildroot environment :-) I could of course add it, but in this case
> I think it's easy enough to align the columns manually.

Ahh yes - good point. A few spaces aught to do it :)

and s/`.*`/$(.*)/ here too :)

> 
> With these fixed,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>

Patch
diff mbox series

diff --git a/tests/vsp-unit-test-0000.sh b/tests/vsp-unit-test-0000.sh
new file mode 100755
index 000000000000..144cfc677b32
--- /dev/null
+++ b/tests/vsp-unit-test-0000.sh
@@ -0,0 +1,20 @@ 
+#!/bin/sh
+
+# Report testing conditions
+
+model=`cat /sys/firmware/devicetree/base/model`
+
+echo "Test Conditions:"
+
+function check_all() {
+	echo "  Platform: " "$model"
+	echo "  Kernel release: " `uname -r`
+	echo "  convert: " `which convert`
+	echo "  compare: " `which compare`
+	echo "  killall: " `which killall`
+	echo "  raw2rgbpnm: " `which raw2rgbpnm`
+	echo "  stress: " `which stress`
+	echo "  yavta: " `which yavta`
+}
+
+check_all | column -ts ":"