From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17346C77B75 for ; Wed, 19 Apr 2023 01:55:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 97D088622A; Wed, 19 Apr 2023 03:50:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="f7luU0WW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 77D90861C1; Wed, 19 Apr 2023 03:50:40 +0200 (CEST) Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EB27C86222 for ; Wed, 19 Apr 2023 03:50:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-yb1-xb34.google.com with SMTP id t16so17884727ybi.13 for ; Tue, 18 Apr 2023 18:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681869035; x=1684461035; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=j5/SddEA5YvF1GrfkNeHt7r1nv/ax44+dcWJ8bRd22o=; b=f7luU0WWAruWnf/iYYhTTrTvFVyxXeU5+M6eZxXpnsb69xNsxWzACn/T2YPmP0I8r0 FaxQf5kRztm936bgimSVw+sIx+P/KMhXhrapimyFQ7RVnkmazALSPj78l/ieq5feD8NU iBRkXkIM8XV/aDGoxZyOVFxE6ZTUWAtX4gCr8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681869035; x=1684461035; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j5/SddEA5YvF1GrfkNeHt7r1nv/ax44+dcWJ8bRd22o=; b=Kqnh3skGsxyE1hFzobaRhJrVT7O5Fsgwy39IHkBdiOOjFbrXyXRdPbOl2lxuI1ark3 c0TaqulFhI9hsS1ANsWp+TikkS6oE4FdHh5i3SV1f0xmQFxQU+CslBDMLeoQK7TS0Fct 0ktJNH9J42asYHkg7i85HalirU+OQ94BTdqI20JAgyfLMM98/NCRaTwiinw+jbi+0yYG nORQ7brQ77+EaIHtPBbhCbbNxuHjhjYs9CejBhuA/ehImjCiFbaBqKvrLiIFM9goVyyW KWKVceBI8nGWhkAhX+IYlJOOSNuK7MH7NMdyCdEi9C2oYsCiDGK6IkSEknEFEb6ZGtTK wO9A== X-Gm-Message-State: AAQBX9ftyfmeL+7rPV3SvcefOqjxznd1IrveOolGsqam6JMBA7CAJd9i ihdeuKOXRzi/kDEwGCwvdACmYlY8OZIW/XNzVMQvFw== X-Google-Smtp-Source: AKy350asE9YCLKFFjCNeSSucTEi9IpITBTiCz441n47UWd6i8n3u47UbLBB/W59eDLKaAjDS4oKrelyThThXKsl/sH4= X-Received: by 2002:a25:4504:0:b0:b95:3877:2161 with SMTP id s4-20020a254504000000b00b9538772161mr5016769yba.31.1681869035431; Tue, 18 Apr 2023 18:50:35 -0700 (PDT) MIME-Version: 1.0 References: <20230328161157.219375-1-abdellatif.elkhlifi@arm.com> <20230412094245.44674-1-abdellatif.elkhlifi@arm.com> <20230412094245.44674-9-abdellatif.elkhlifi@arm.com> In-Reply-To: <20230412094245.44674-9-abdellatif.elkhlifi@arm.com> From: Simon Glass Date: Tue, 18 Apr 2023 19:50:04 -0600 Message-ID: Subject: Re: [PATCH v11 08/10] arm_ffa: introduce armffa command Sandbox test To: Abdellatif El Khlifi Cc: Drew.Reed@arm.com, achin.gupta@arm.com, ilias.apalodimas@linaro.org, jens.wiklander@linaro.org, nd@arm.com, robh@kernel.org, trini@konsulko.com, u-boot@lists.denx.de, xueliang.zhong@arm.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi Abdellatif, On Wed, 12 Apr 2023 at 03:43, Abdellatif El Khlifi wrote: > > Add Sandbox test for the armffa command > > Signed-off-by: Abdellatif El Khlifi > Reviewed-by: Simon Glass > Cc: Tom Rini > Cc: Simon Glass > Cc: Ilias Apalodimas > Cc: Jens Wiklander > > --- > Changelog: > =============== > > v10: > > * replace CMD_RET_SUCCESS with 0 > * replace CONFIG_SANDBOX_FFA with CONFIG_ARM_FFA_TRANSPORT > > v9: align the test with FF-A discovery through DM > > v4: drop use of helper APIs > > v1: introduce armffa command sandbox test > > MAINTAINERS | 1 + > test/cmd/Makefile | 2 ++ > test/cmd/armffa.c | 39 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 42 insertions(+) > create mode 100644 test/cmd/armffa.c Reviewed-by: Simon Glass > > diff --git a/MAINTAINERS b/MAINTAINERS > index cd99e655db..67eed92a9b 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -276,6 +276,7 @@ F: doc/arch/arm64.ffa.rst > F: doc/usage/cmd/armffa.rst > F: drivers/firmware/arm-ffa/ > F: include/arm_ffa.h > +F: test/cmd/armffa.c > F: test/dm/ffa.c > > ARM FREESCALE IMX > diff --git a/test/cmd/Makefile b/test/cmd/Makefile > index 055adc65a2..1d1dbb4fbc 100644 > --- a/test/cmd/Makefile > +++ b/test/cmd/Makefile > @@ -1,6 +1,7 @@ > # SPDX-License-Identifier: GPL-2.0+ > # > # Copyright (c) 2013 Google, Inc > +# Copyright 2022-2023 Arm Limited and/or its affiliates > > ifdef CONFIG_HUSH_PARSER > obj-$(CONFIG_CONSOLE_RECORD) += test_echo.o > @@ -23,6 +24,7 @@ obj-$(CONFIG_CMD_SEAMA) += seama.o > ifdef CONFIG_SANDBOX > obj-$(CONFIG_CMD_READ) += rw.o > obj-$(CONFIG_CMD_SETEXPR) += setexpr.o > +obj-$(CONFIG_ARM_FFA_TRANSPORT) += armffa.o > endif > obj-$(CONFIG_CMD_TEMPERATURE) += temperature.o > obj-$(CONFIG_CMD_WGET) += wget.o > diff --git a/test/cmd/armffa.c b/test/cmd/armffa.c > new file mode 100644 > index 0000000000..a9768dbd2c > --- /dev/null > +++ b/test/cmd/armffa.c > @@ -0,0 +1,39 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Test for armffa command > + * > + * Copyright 2022-2023 Arm Limited and/or its affiliates > + * > + * Authors: > + * Abdellatif El Khlifi > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define PING_CMD_SIZE 19 > + > +/* Basic test of 'armffa' command */ > +static int dm_test_armffa_cmd(struct unit_test_state *uts) > +{ > + char ping_cmd[PING_CMD_SIZE] = {0}; No need to assign a value for something that gets written in the function. > + > + /* armffa getpart */ > + ut_assertok(run_command("armffa getpart " SANDBOX_SERVICE1_UUID, 0)); > + > + snprintf(ping_cmd, PING_CMD_SIZE, "armffa ping 0x%x", SANDBOX_SP1_ID); > + > + /* armffa ping */ > + ut_assertok(run_command(ping_cmd, 0)); See run_commandf() so you can =avoid the sprintf() > + > + /* armffa devlist */ > + ut_assertok(run_command("armffa devlist", 0)); > + > + return 0; > +} > + > +DM_TEST(dm_test_armffa_cmd, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); > -- > 2.25.1 > Regards, Simon