[PATCH i-g-t RFC 06/13] lib/chamelium: Introduce a simple chamelium v3 test

Louis Chauvet louis.chauvet at bootlin.com
Wed Jun 5 14:30:18 UTC 2024


Check if the chamelium is accessible

Signed-off-by: Louis Chauvet <louis.chauvet at bootlin.com>
---
 tests/chamelium/v3/kms_chamelium_v3_basic.c | 30 +++++++++++++++++++++++++++++
 tests/meson.build                           |  1 +
 2 files changed, 31 insertions(+)

diff --git a/tests/chamelium/v3/kms_chamelium_v3_basic.c b/tests/chamelium/v3/kms_chamelium_v3_basic.c
new file mode 100644
index 000000000000..f07106c064cb
--- /dev/null
+++ b/tests/chamelium/v3/kms_chamelium_v3_basic.c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: MIT
+
+#include <igt.h>
+#include "chamelium/v3/igt_chamelium.h"
+
+igt_main
+{
+	struct igt_chamelium_rpc *chamelium;
+
+	igt_describe("Test if the chamelium can list all the ports.");
+	igt_subtest("chamelium-list-ports") {
+		chamelium_port_id *ports;
+		int port_count;
+
+		chamelium = chamelium_rpc_init_from_config();
+
+		port_count = chamelium_get_supported_ports_rpc(chamelium, &ports);
+
+		for (int i = 0; i < port_count; i++) {
+			const char *name = chamelium_get_port_name_rpc(chamelium, ports[i]);
+
+			igt_info("Port %d: name: %s\n", ports[i], name);
+			free(name);
+		}
+
+		free(ports);
+
+		chamelium_rpc_uninit(chamelium);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index d7c20e235325..51396548eec9 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -335,6 +335,7 @@ chamelium_v2_progs = [
 ]
 
 chamelium_v3_progs = [
+	'kms_chamelium_v3_basic',
 ]
 
 test_deps = [ igt_deps ]

-- 
2.43.2



More information about the igt-dev mailing list