From: Markus Armbruster <armbru@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
QEMU <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Date: Fri, 31 Aug 2018 16:35:16 +0200 [thread overview]
Message-ID: <87va7qli3f.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <5b4cef8c-084c-5a2b-1fb6-210388054d38@redhat.com> (Thomas Huth's message of "Fri, 31 Aug 2018 15:40:54 +0200")
Thomas Huth <thuth@redhat.com> writes:
> On 2018-08-31 15:24, Marc-André Lureau wrote:
>> Hi
>> On Fri, Aug 31, 2018 at 3:18 PM Thomas Huth <thuth@redhat.com> wrote:
>>>
>>> On 2018-08-31 14:04, Markus Armbruster wrote:
>>>> Thomas Huth <thuth@redhat.com> writes:
>>>>
>>>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>>>
>>>>> test_qom_set_without_value() is about a bug in infrastructure used by
>>>>> the QMP core, fixed in commit c489780203. We covered the bug in
>>>>> infrastructure unit tests (commit bce3035a44). I wrote that test
>>>>> earlier, to cover QMP level as well, the test could go into qmp-test.
>>>>>
>>>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>>> ---
>>>>> tests/qmp-test.c | 14 ++++++++++++++
>>>>> 1 file changed, 14 insertions(+)
>>>>>
>>>>> diff --git a/tests/qmp-test.c b/tests/qmp-test.c
>>>>> index b347228..2b923f0 100644
>>>>> --- a/tests/qmp-test.c
>>>>> +++ b/tests/qmp-test.c
>>>>> @@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)
>>>>> qtest_quit(qs);
>>>>> }
>>>>>
>>>>> +static void test_qom_set_without_value(void)
>>>>> +{
>>>>> + QTestState *qts;
>>>>> + QDict *resp;
>>>>> +
>>>>> + qts = qtest_init(common_args);
>>>>> + resp = qtest_qmp(qts, "{'execute': 'qom-set', 'arguments':"
>>>>> + " { 'path': '/machine', 'property': 'rtc-time' } }");
>>>>> + g_assert_nonnull(resp);
>>>>> + qmp_assert_error_class(resp, "GenericError");
>>>>> + qtest_quit(qts);
>>>>> +}
>>>>> +
>>>>> int main(int argc, char *argv[])
>>>>> {
>>>>> g_test_init(&argc, &argv, NULL);
>>>>> @@ -328,6 +341,7 @@ int main(int argc, char *argv[])
>>>>> qtest_add_func("qmp/protocol", test_qmp_protocol);
>>>>> qtest_add_func("qmp/oob", test_qmp_oob);
>>>>> qtest_add_func("qmp/preconfig", test_qmp_preconfig);
>>>>> + qtest_add_func("qmp/qom-set-without-value", test_qom_set_without_value);
>>>>>
>>>>> return g_test_run();
>>>>> }
>>>>
>>>> I'm afraid you missed my objection to naming:
>>>> Message-ID: <8736uvujxx.fsf@dusky.pond.sub.org>
>>>> https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.html
>>>
>>> Sorry about that, I was not on CC: for that series. I used the patches
>>> from v5 where Marc-André put me on CC:.
>>>
>>>> If you could work that into PULL v2, I'd be obliged. If not, I'll have
>>>> to address it in a follow-up patch.
>>>
>>> IMHO the naming is not that bad ... OTOH, I think Peter might already be
>>> away? ... so we've got plenty of time to sort this out anyway.
>>> Marc-André, could you send a new version of the patch?
>>
>> Tbh, I don't care so much about the naming of the test, but (for once)
>> I respectfully don't think Markus suggestion is better.
>>
>> The function checks "qom-set" without 'value' argument:
>> "qom-set-without-value", no brainer..
Nope, that's not what it tests. It tests the visitor, the marshalling
code generator, and the QMP core handle a certain kind of invalid
arguments correctly. It does not test qom-set. I explained all that
already.
>> Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
I can accept "missing-any" or "missing-any-arg". I object to any name
involving qom-set, because the test is not about qom-set at all.
If it was, then putting it in qmp-test.c would be wrong.
> Ok, then let's keep it this way. As I said, IMHO the current naming is
> not really bad, and I also don't have any suggestions for a perfect name
> right now.
We don't need a perfect name. We need one that's not actively
misleading.
next prev parent reply other threads:[~2018-08-31 14:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 8:38 [Qemu-devel] [PULL 0/9] Removal of deprecated options and improvements for qtests Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 1/9] Remove the deprecated -balloon option Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 2/9] Remove the deprecated -nodefconfig option Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 3/9] Remove the deprecated options -startdate, -localtime and -rtc-td-hack Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 4/9] net: Remove the deprecated -tftp, -bootp, -redir and -smb options Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 5/9] tests/libqos: Utilize newer glib spawn check Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 6/9] tests: add qmp_assert_error_class() Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 7/9] tests: add qmp/object-add-without-props test Thomas Huth
2018-08-31 8:38 ` [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test Thomas Huth
2018-08-31 12:04 ` Markus Armbruster
2018-08-31 13:18 ` Thomas Huth
2018-08-31 13:24 ` Marc-André Lureau
2018-08-31 13:40 ` Thomas Huth
2018-08-31 14:35 ` Markus Armbruster [this message]
2018-09-03 4:45 ` Thomas Huth
2018-10-09 16:41 ` Markus Armbruster
2018-10-29 6:49 ` Marc-André Lureau
2018-10-29 8:38 ` Markus Armbruster
2018-08-31 8:38 ` [Qemu-devel] [PULL 9/9] tests: add a qmp success-response test Thomas Huth
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=87va7qli3f.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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.