public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
	etienne.carriere@st.com, michal.simek@amd.com,
	u-boot@lists.denx.de,
	Etienne Carriere <etienne.carriere@foss.st.com>
Subject: Re: [PATCH 5/5] test: dm: add scmi command test
Date: Tue, 14 Nov 2023 10:41:20 +0900	[thread overview]
Message-ID: <ZVLQQHRPUFTCQZln@octopus> (raw)
In-Reply-To: <CAPnjgZ1kt2swHPTEPmA8YQvW3oNniw8M_VrDh5d9JC8949yjjA@mail.gmail.com>

On Mon, Nov 13, 2023 at 11:01:17AM -0700, Simon Glass wrote:
> Hi,
> 
> On Sun, 12 Nov 2023 at 18:46, AKASHI Takahiro
> <takahiro.akashi@linaro.org> wrote:
> >
> > Hi Tom,
> >
> > On Fri, Nov 10, 2023 at 01:21:37PM -0500, Tom Rini wrote:
> > > On Wed, Oct 25, 2023 at 02:14:27PM +0900, AKASHI Takahiro wrote:
> > >
> > > > In this test, "scmi" command is tested against different sub-commands.
> > > > Please note that scmi command is for debug purpose and is not intended
> > > > in production system.
> > > >
> > > > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > > Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
> > >
> > > The test part of this still fails:
> > > https://source.denx.de/u-boot/u-boot/-/jobs/732077
> > >
> > > I don't know why more output wasn't captured, when I run it locally
> > > instead I get:
> > > ========================================== FAILURES ===========================================
> > > _______________________________ test_ut[ut_dm_dm_test_scmi_cmd] _______________________________
> > > test/py/u_boot_spawn.py:195: in expect
> > >     c = os.read(self.fd, 1024).decode(errors='replace')
> > > E   OSError: [Errno 5] Input/output error
> > >
> > > During handling of the above exception, another exception occurred:
> > > test/py/tests/test_ut.py:502: in test_ut
> > >     output = u_boot_console.run_command('ut ' + ut_subtest)
> > > test/py/u_boot_console_base.py:266: in run_command
> > >     m = self.p.expect([self.prompt_compiled] + self.bad_patterns)
> > > test/py/u_boot_spawn.py:204: in expect
> > >     raise ValueError('U-Boot exited with %s' % info)
> > > E   ValueError: U-Boot exited with signal 11 (SIGSEGV)
> >
> >
> > The command uses global variables which hold pointers to 'struct udevice'
> > which are to be shared between the main and the sub-commands.
> > Since pytest framework executes ut tests twice, once with a (normal?) device
> > tree and once with a flat tree,  udevices will be *voided* between
> > two executions.
> 
> Are you able to put the var in the uclass-priv data instead? The state
> should be cleared before running each DM test.

Well, I don't think we need such a trick.
As you can see, we may simply fetch/find necessary udevices
every time the command is called.
It is enough given that the command is mainly for debug purpose.

-Takahiro Akashi


> Regards,
> Simon
> 
> 
> >
> > I will fix it in v2.
> >
> > Thanks,
> > -Takahiro Akashi
> >
> >
> > > ------------------------------------ Captured stdout call -------------------------------------
> > > => ut dm dm_test_scmi_cmd
> > > Test: dm_test_scmi_cmd: scmi.c
> > > SCMI device: scmi
> > >   protocol version: 0x20000
> > >   # of agents: 2
> > >       0: platform
> > >     > 1: OSPM
> > >   # of protocols: 4
> > >       Power domain management
> > >       Clock management
> > >       Reset domain management
> > >       Voltage domain management
> > >   vendor: U-Boot
> > >   sub vendor: Sandbox
> > >   impl version: 0x1
> > > Denying access to device:0 failed (-13)
> > > Denying access to protocol:0x14 on device:0 failed (-13)
> > > Reset failed (-13)
> > > Test: dm_test_scmi_cmd: scmi.c (flat tree)
> > > SCMI device: Q
> > > =================================== short test summary info ===================================
> > > FAILED test/py/tests/test_ut.py::test_ut[ut_dm_dm_test_scmi_cmd] - ValueError: U-Boot exited...
> > >
> > > --
> > > Tom
> >
> >

  reply	other threads:[~2023-11-14  1:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25  5:14 [PATCH 0/5] cmd: add scmi command AKASHI Takahiro
2023-10-25  5:14 ` [PATCH 1/5] test: dm: skip scmi tests against disabled protocols AKASHI Takahiro
2023-10-25  5:14 ` [PATCH 2/5] firmware: scmi: support protocols on sandbox only if enabled AKASHI Takahiro
2023-10-25  5:14 ` [PATCH 3/5] cmd: add scmi command for SCMI firmware AKASHI Takahiro
2023-10-25  7:29   ` Michal Simek
2023-10-25  9:07     ` AKASHI Takahiro
2023-10-25  5:14 ` [PATCH 4/5] doc: cmd: add documentation for scmi AKASHI Takahiro
2023-10-25  5:14 ` [PATCH 5/5] test: dm: add scmi command test AKASHI Takahiro
2023-11-10 18:21   ` Tom Rini
2023-11-13  1:46     ` AKASHI Takahiro
2023-11-13 18:01       ` Simon Glass
2023-11-14  1:41         ` AKASHI Takahiro [this message]
2023-11-14 23:29           ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZVLQQHRPUFTCQZln@octopus \
    --to=takahiro.akashi@linaro.org \
    --cc=etienne.carriere@foss.st.com \
    --cc=etienne.carriere@st.com \
    --cc=michal.simek@amd.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox