[PATCH 5/6] arm_ffa: introduce armffa command Sandbox test

abdellatif.elkhlifi at arm.com abdellatif.elkhlifi at arm.com
Tue Mar 29 17:16:58 CEST 2022


From: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>

Add Sandbox test for the armffa command

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
Cc: Tom Rini <trini at konsulko.com>
---
 MAINTAINERS       |  2 ++
 test/cmd/Makefile |  1 +
 test/cmd/armffa.c | 33 +++++++++++++++++++++++++++++++++
 test/cmd/armffa.h | 13 +++++++++++++
 4 files changed, 49 insertions(+)
 create mode 100644 test/cmd/armffa.c
 create mode 100644 test/cmd/armffa.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 52274b2fac..9828095837 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -242,6 +242,8 @@ F:	include/arm_ffa_helper.h
 F:	include/sandbox_arm_ffa.h
 F:	include/sandbox_arm_ffa_helper.h
 F:	lib/arm-ffa/
+F:	test/cmd/armffa.c
+F:	test/cmd/armffa.h
 F:	test/dm/ffa.c
 F:	test/dm/ffa.h
 
diff --git a/test/cmd/Makefile b/test/cmd/Makefile
index a59adb1e6d..d9dc0809d6 100644
--- a/test/cmd/Makefile
+++ b/test/cmd/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_CMD_MEM_SEARCH) += mem_search.o
 obj-$(CONFIG_CMD_PINMUX) += pinmux.o
 obj-$(CONFIG_CMD_PWM) += pwm.o
 obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
+obj-$(CONFIG_SANDBOX_FFA) += armffa.o
diff --git a/test/cmd/armffa.c b/test/cmd/armffa.c
new file mode 100644
index 0000000000..d35032047b
--- /dev/null
+++ b/test/cmd/armffa.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Test for armffa command
+ *
+ * (C) Copyright 2022 ARM Limited
+ * Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
+ */
+
+#include "armffa.h"
+#include <arm_ffa_helper.h>
+#include <dm.h>
+#include <dm/test.h>
+#include <test/test.h>
+#include <test/ut.h>
+
+/* Basic test of 'armffa' command */
+static int dm_test_armffa_cmd(struct unit_test_state *uts)
+{
+	ut_assertok(ffa_helper_init_device());
+
+	/* armffa getpart <UUID> */
+	ut_assertok(run_command("armffa getpart " SE_PROXY_PARTITION_UUID, 0));
+
+	/* armffa ping <ID> */
+	ut_assertok(run_command("armffa ping " SE_PROXY_PARTITION_ID, 0));
+
+	/* armffa devlist */
+	ut_assertok(run_command("armffa devlist", 0));
+
+	return CMD_RET_SUCCESS;
+}
+
+DM_TEST(dm_test_armffa_cmd, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC);
diff --git a/test/cmd/armffa.h b/test/cmd/armffa.h
new file mode 100644
index 0000000000..630dc75e25
--- /dev/null
+++ b/test/cmd/armffa.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2022 ARM Limited
+ * Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
+ */
+
+#ifndef __TEST_CMD_FFA_H
+#define __TEST_CMD_FFA_H
+
+#define SE_PROXY_PARTITION_ID "0x1245"
+#define SE_PROXY_PARTITION_UUID "33d532ed-e699-0942-c09c-a798d9cd722d"
+
+#endif /*__TEST_CMD_FFA_H */
-- 
2.17.1



More information about the U-Boot mailing list