From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Bin Meng <bmeng.cn@gmail.com>,
u-boot@lists.denx.de
Subject: Re: [PATCH v2 4/4] test: unit test for smbios command
Date: Thu, 18 Jan 2024 14:35:42 +0200 [thread overview]
Message-ID: <ZakbHqumybx-cVrq@hera> (raw)
In-Reply-To: <d58a1c24-9af3-4a49-b4bd-afafc0c684f2@canonical.com>
On Thu, Jan 18, 2024 at 01:33:15PM +0100, Heinrich Schuchardt wrote:
> On 1/18/24 12:51, Ilias Apalodimas wrote:
> > Hi Heinrich,
> >
> > On Wed, 17 Jan 2024 at 17:34, Heinrich Schuchardt
> > <heinrich.schuchardt@canonical.com> wrote:
> > >
> > > Provide a unit test for the smbios command.
> > >
> > > Provide different test functions for QEMU, sandbox, and other systems.
> > >
> > > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> > > ---
> > > v2:
> > > for generic boards we only can assume that a type 127 table exists
> > > email address updated
> > > ---
> > > test/py/tests/test_smbios.py | 41 ++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 41 insertions(+)
> > > create mode 100644 test/py/tests/test_smbios.py
> > >
> > > diff --git a/test/py/tests/test_smbios.py b/test/py/tests/test_smbios.py
> > > new file mode 100644
> > > index 00000000000..82b0b689830
> > > --- /dev/null
> > > +++ b/test/py/tests/test_smbios.py
> > > @@ -0,0 +1,41 @@
> > > +# SPDX-License-Identifier: GPL-2.0-or-later
> > > +
> > > +"""Test smbios command"""
> > > +
> > > +import pytest
> > > +
> > > +@pytest.mark.buildconfigspec('cmd_smbios')
> > > +@pytest.mark.notbuildconfigspec('qfw_smbios')
> > > +@pytest.mark.notbuildconfigspec('sandbox')
> > > +def test_cmd_smbios(u_boot_console):
> > > + """Run the smbios command"""
> > > + output = u_boot_console.run_command('smbios')
> > > + assert 'DMI type 127,' in output
> > > +
> > > +@pytest.mark.buildconfigspec('cmd_smbios')
> > > +@pytest.mark.buildconfigspec('qfw_smbios')
> > > +@pytest.mark.notbuildconfigspec('sandbox')
> > > +# TODO:
> > > +# QEMU v8.2.0 lacks SMBIOS support for RISC-V
> > > +# Once support is available in our Docker image we can remove the constraint.
> > > +@pytest.mark.notbuildconfigspec('riscv')
> > > +def test_cmd_smbios_qemu(u_boot_console):
> > > + """Run the smbios command on QEMU"""
> > > + output = u_boot_console.run_command('smbios')
> > > + assert 'DMI type 1,' in output
> > > + assert 'Manufacturer: QEMU' in output
> > > + assert 'DMI type 127,' in output
> >
> > Is there an easy way to run this test with and without the SMBIOS
> > tables provided by QEMU? We could test the u-boot generated ones that
> > way
>
> We already test the sandbox without QFW. I would not want to duplicated QEMU
> defconfigs.
>
Ah fair enough, I can add the generic tests in that one
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Best regards
>
> Heinrich
>
> >
> > Thanks
> > /Ilias
> > > +
> > > +@pytest.mark.buildconfigspec('cmd_smbios')
> > > +@pytest.mark.buildconfigspec('sandbox')
> > > +def test_cmd_smbios_sandbox(u_boot_console):
> > > + """Run the smbios command on the sandbox"""
> > > + output = u_boot_console.run_command('smbios')
> > > + assert 'DMI type 0,' in output
> > > + assert 'String 1: U-Boot' in output
> > > + assert 'DMI type 1,' in output
> > > + assert 'Manufacturer: sandbox' in output
> > > + assert 'DMI type 2,' in output
> > > + assert 'DMI type 3,' in output
> > > + assert 'DMI type 4,' in output
> > > + assert 'DMI type 127,' in output
> > > --
> > > 2.43.0
> > >
>
next prev parent reply other threads:[~2024-01-18 12:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 15:33 [PATCH v2 1/4] smbios: type2: contained object handles Heinrich Schuchardt
2024-01-17 15:33 ` [PATCH v2 2/4] cmd: provide command to display SMBIOS information Heinrich Schuchardt
2024-01-18 12:39 ` Ilias Apalodimas
2024-01-18 12:54 ` Heinrich Schuchardt
2024-01-18 12:58 ` Ilias Apalodimas
2024-01-24 21:16 ` Tom Rini
2024-01-24 23:24 ` Heinrich Schuchardt
2024-01-25 0:17 ` Tom Rini
2024-01-25 10:45 ` Peter Robinson
2024-01-17 15:33 ` [PATCH v2 3/4] doc: man-page for smbios command Heinrich Schuchardt
2024-01-17 15:33 ` [PATCH v2 4/4] test: unit test " Heinrich Schuchardt
2024-01-18 11:51 ` Ilias Apalodimas
2024-01-18 12:33 ` Heinrich Schuchardt
2024-01-18 12:35 ` Ilias Apalodimas [this message]
2024-01-17 16:10 ` [PATCH v2 0/4] cmd: provide command to display SMBIOS information Heinrich Schuchardt
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=ZakbHqumybx-cVrq@hera \
--to=ilias.apalodimas@linaro.org \
--cc=bmeng.cn@gmail.com \
--cc=heinrich.schuchardt@canonical.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