[i-g-t] tests/tools_test: check if l3_parity is supported
diff mbox

Message ID 20170905115205.26405-1-abdiel.janulgue@linux.intel.com
State New
Headers show

Commit Message

Abdiel Janulgue Sept. 5, 2017, 11:52 a.m. UTC
This is a wrapper for tools/intel_l3_parity which fails if l3_parity
is not supported in the kernel. Check support before executing test.

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101650
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
---
 tests/tools_test.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Petri Latvala Sept. 5, 2017, 12:05 p.m. UTC | #1
On Tue, Sep 05, 2017 at 02:52:05PM +0300, Abdiel Janulgue wrote:
> This is a wrapper for tools/intel_l3_parity which fails if l3_parity
> is not supported in the kernel. Check support before executing test.
> 
> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101650
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> ---
>  tests/tools_test.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/tools_test.c b/tests/tools_test.c
> index ccd165d..22e9397 100644
> --- a/tests/tools_test.c
> +++ b/tests/tools_test.c
> @@ -85,6 +85,10 @@ igt_main
>  
>  	igt_subtest("sysfs_l3_parity") {
>  		int exec_return;
> +		/* Check if we support l3_parity in the first place */
> +		igt_skip_on_f(igt_system_quiet("../tools/intel_l3_parity") !=
> +			      IGT_EXIT_SUCCESS,
> +			      "intel_l3_parity not supported\n");


That's not how the tool works. If you give it no parameters, it will
call abort() on all platforms because it wants an action on the
command line.

Skipping should only be done if the tool exits with 77 when given
correct parameters.


--
Petri Latvala

Patch
diff mbox

diff --git a/tests/tools_test.c b/tests/tools_test.c
index ccd165d..22e9397 100644
--- a/tests/tools_test.c
+++ b/tests/tools_test.c
@@ -85,6 +85,10 @@  igt_main
 
 	igt_subtest("sysfs_l3_parity") {
 		int exec_return;
+		/* Check if we support l3_parity in the first place */
+		igt_skip_on_f(igt_system_quiet("../tools/intel_l3_parity") !=
+			      IGT_EXIT_SUCCESS,
+			      "intel_l3_parity not supported\n");
 
 		igt_system_cmd(exec_return,
 			       "../tools/intel_l3_parity -r 0 -b 0 "