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

Mark Yacoub markyacoub at chromium.org
Wed Nov 30 17:42:17 UTC 2022


[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");
+
 	return is_any_port_mapped;
 }
 
-- 
2.38.1.584.g0f3c55d4c2-goog



More information about the igt-dev mailing list