All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "wangyanan (Y)" <wangyanan55@huawei.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org
Cc: Andrew Jones <drjones@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH v4 2/2] tests/unit: Add an unit test for smp parsing
Date: Wed, 10 Nov 2021 09:10:01 +0100	[thread overview]
Message-ID: <2eac9bd1-099c-bc0c-e5e3-6a04eaa91ddf@redhat.com> (raw)
In-Reply-To: <0d991e20-05d7-a182-5270-81c1892656b4@huawei.com>

On 09/11/2021 13.18, wangyanan (Y) wrote:
> Hi,
> 
> On 2021/11/9 17:36, Philippe Mathieu-Daudé wrote:
>> Hi,
>>
>> On 10/28/21 17:09, Philippe Mathieu-Daudé wrote:
>>> From: Yanan Wang <wangyanan55@huawei.com>
>>>
>>> Now that we have a generic parser smp_parse(), let's add an unit
>>> test for the code. All possible valid/invalid SMP configurations
>>> that the user can specify are covered.
>>>
>>> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
>>> Reviewed-by: Andrew Jones <drjones@redhat.com>
>>> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> Message-Id: <20211026034659.22040-3-wangyanan55@huawei.com>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>>   tests/unit/test-smp-parse.c | 594 ++++++++++++++++++++++++++++++++++++
>>>   MAINTAINERS                 |   1 +
>>>   tests/unit/meson.build      |   1 +
>>>   3 files changed, 596 insertions(+)
>>>   create mode 100644 tests/unit/test-smp-parse.c
>> Could you have a look at this test failure please?
>> https://cirrus-ci.com/task/5823855357853696
>>
>> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
>> G_TEST_SRCDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/tests/unit 
>>
>> G_TEST_BUILDDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/build/tests/unit 
>>
>> tests/unit/test-smp-parse.exe --tap -k
>> Test smp_parse failed!
>> Input configuration: (SMPConfiguration) {
>>      .has_cpus    =  true, cpus    = 1,
>>      .has_sockets = false, sockets = 0,
>>      .has_dies    = false, dies    = 0,
>>      .has_cores   = false, cores   = 0,
>>      .has_threads = false, threads = 0,
>>      .has_maxcpus = false, maxcpus = 0,
>> }
>> Should be valid: no
>> Expected error report: Invalid SMP CPUs 1. The min CPUs supported by
>> machine '(null)' is 2
>> Result is valid: no
>> Output error report: Invalid SMP CPUs 1. The min CPUs supported by
>> machine '(NULL)' is 2
>> ERROR test-smp-parse - too few tests run (expected 2, got 0)
>> make: *** [Makefile.mtest:576: run-test-70] Error 1
>>
>>
>> .
> Obviously, the name string for the tested machine type in cirrus-ci is "NULL",
> while the expected name string is "null". It was also "null" when running on
> my Arm64 platform locally.
> 
> Anyway, I shouldn't have hardcoded this expected error message. I can
> send a fix patch to make it more flexible then more stable. :)

Yes, please do so. The "(null)"/"(NULL)" obviously depends on the libc that 
is used, so we should not rely on the correct spelling of the string in the 
tests here.

  Thomas




  reply	other threads:[~2021-11-10  8:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 15:09 [PATCH v4 0/2] hw/core/machine: Add an unit test for smp_parse Philippe Mathieu-Daudé
2021-10-28 15:09 ` [PATCH v4 1/2] hw/core/machine: Split out the smp parsing code Philippe Mathieu-Daudé
2021-10-28 15:09 ` [PATCH v4 2/2] tests/unit: Add an unit test for smp parsing Philippe Mathieu-Daudé
2021-10-31 12:02   ` wangyanan (Y)
2021-11-01 10:43     ` Philippe Mathieu-Daudé
2021-11-09  9:36   ` Philippe Mathieu-Daudé
2021-11-09 12:10     ` wangyanan (Y)
2021-11-09 12:18     ` wangyanan (Y)
2021-11-10  8:10       ` Thomas Huth [this message]
2021-11-11  9:14   ` Philippe Mathieu-Daudé
2021-11-11  9:31     ` wangyanan (Y)
2021-11-11  9:37       ` Philippe Mathieu-Daudé
2021-11-11 13:00         ` wangyanan (Y)
2021-10-29 17:10 ` [PATCH v4 0/2] hw/core/machine: Add an unit test for smp_parse Eduardo Habkost
2021-11-01 18:28 ` Philippe Mathieu-Daudé

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=2eac9bd1-099c-bc0c-e5e3-6a04eaa91ddf@redhat.com \
    --to=thuth@redhat.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wangyanan55@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.