[igt-dev] [PATCH] igt_chameleon: Assert if there are no connected ports

Petri Latvala petri.latvala at intel.com
Thu Dec 1 14:38:57 UTC 2022


On Wed, Nov 30, 2022 at 12:42:17PM -0500, Mark Yacoub wrote:
> [Why]
> The tests are meant to run on devices that have a chameleon connected.
> If autodiscovery finds no port, it means something is off and the DUT is
> not behaving well.
> 
> [How]
> Add an assert if no port is mapped.
> 
> Signed-off-by: Mark Yacoub <markyacoub at chromium.org>
> ---
>  lib/igt_chamelium.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
> index 79920de1..4e7a7a8f 100644
> --- a/lib/igt_chamelium.c
> +++ b/lib/igt_chamelium.c
> @@ -2749,6 +2749,10 @@ unplug_port:
>  	igt_debug("Auto-discovery took %fms and found %i connector(s)\n",
>  		  (float)elapsed_ns / (1000 * 1000), chamelium->port_count);
>  
> +	igt_assert_f(
> +		is_any_port_mapped,
> +		"No port is mapped. We don't expect to have no connected connectors.\n");
> +

If this situation (chamelium is configured but is not suitable for
testing) ever happens, in my opinion an igt_abort would be more
appropriate. Similar to the case where chamelium is configured but
cannot be reached. What do you think?


-- 
Petri Latvala


More information about the igt-dev mailing list