[igt-dev] [PATCH] igt_chameleon: Assert if there are no connected ports
Mark Yacoub
markyacoub at google.com
Thu Dec 1 16:37:19 UTC 2022
On Thu, Dec 1, 2022 at 9:38 AM Petri Latvala <petri.latvala at intel.com> wrote:
>
> 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?
>
So the case I saw is volteer failing to connect any of its ports
because of some bug it has that if it doesn't disconnect cleanly it
stops working without extra steps. I thought when we catch this, this
might be a good candidate for a real bug to file so it's a legit DUT
failure, hence the assert, rather than abort because test conditions
weren't met.
They're both good to me, so whatever you think is best.
>
> --
> Petri Latvala
More information about the igt-dev
mailing list