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 X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE0FEC433C1 for ; Mon, 22 Mar 2021 17:49:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CA336148E for ; Mon, 22 Mar 2021 17:49:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CA336148E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOOga-0002dX-T3 for qemu-devel@archiver.kernel.org; Mon, 22 Mar 2021 13:49:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOOfD-0001qg-BE for qemu-devel@nongnu.org; Mon, 22 Mar 2021 13:48:27 -0400 Received: from mout.web.de ([212.227.15.14]:48375) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOOfA-0007p3-Ko for qemu-devel@nongnu.org; Mon, 22 Mar 2021 13:48:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1616435297; bh=L+oN91jl5n/5DcPQxd+Sfi7ic/2riJEHPB2ZC+wLtFk=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=UQHvs7EXL2HU8T02FouQxdsJICrIP9S8tAnsBsldy8bU/GAOhjtw2oFQ4sVfGAdtS kYIDoJIl0q8Iigm2U3qE3p4tYIAscKvZUpSLx1baDg2/FNni7k8k2YCLaoYJx+LObF /wKRPTnI/WvhTvxfb+2dER0vzMZ7bRN87v/XI+UI= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from gecko.fritz.box ([94.134.180.232]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MD8Au-1lRi2v1vxM-00GXAM; Mon, 22 Mar 2021 18:48:17 +0100 Date: Mon, 22 Mar 2021 18:48:00 +0100 From: Lukas Straub To: Thomas Huth Subject: Re: [PATCH 1/5] tests: Use the normal yank code instead of stubs in relevant tests Message-ID: <20210322184800.5ead0f3c@gecko.fritz.box> In-Reply-To: <52d508d6-284c-6b36-62ed-f25081e63cfd@redhat.com> References: <950007e82e19e75831b29fac07ab990c213d2352.1616368879.git.lukasstraub2@web.de> <1fc6eff2-a8e5-4ae2-96a5-1b30325dff81@redhat.com> <20210322083545.2c36b5a0@gecko.fritz.box> <52d508d6-284c-6b36-62ed-f25081e63cfd@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/USBNde/r7DqK08rwN3gh2t6"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Provags-ID: V03:K1:rE80pF5wL6blhONr5HGpMRfYbGj3X6vYf+cKPIQd4rCVmvn2XhL zhs+F6b+MO5miBNzx1V+4Eb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0sHDv0/O+lf0b 4ptfr5JfyevRx0jJMPRQ== Received-SPF: pass client-ip=212.227.15.14; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Marc-Andre Lureau , Li Zhang , qemu-devel , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --Sig_/USBNde/r7DqK08rwN3gh2t6 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 22 Mar 2021 17:00:23 +0100 Thomas Huth wrote: > On 22/03/2021 08.35, Lukas Straub wrote: > > On Mon, 22 Mar 2021 06:20:50 +0100 > > Thomas Huth wrote: > > =20 > >> On 22/03/2021 00.31, Lukas Straub wrote: =20 > >>> Use the normal yank code instead of stubs in relevant tests to > >>> increase coverage and to ensure that registering and unregistering > >>> of yank instances and functions is done correctly. > >>> > >>> Signed-off-by: Lukas Straub > >>> --- > >>> tests/qtest/meson.build | 6 +++--- > >>> tests/unit/meson.build | 4 ++-- > >>> 2 files changed, 5 insertions(+), 5 deletions(-) > >>> > >>> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build > >>> index 66ee9fbf45..40e1f495f7 100644 > >>> --- a/tests/qtest/meson.build > >>> +++ b/tests/qtest/meson.build > >>> @@ -234,9 +234,9 @@ tpmemu_files =3D ['tpm-emu.c', 'tpm-util.c', 'tpm= -tests.c'] > >>> qtests =3D { > >>> 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-e= mu.c'], > >>> 'cdrom-test': files('boot-sector.c'), > >>> - 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1, > >>> + 'dbus-vmstate-test': ['migration-helpers.c', dbus_vmstate1, '../..= /monitor/yank.c'], > >>> 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-serve= r.c'], > >>> - 'migration-test': files('migration-helpers.c'), > >>> + 'migration-test': ['migration-helpers.c', io, '../../monitor/yank.= c'], > >>> 'pxe-test': files('boot-sector.c'), > >>> 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict:= false).sources()], > >>> 'tpm-crb-swtpm-test': [io, tpmemu_files], =20 > >> > >> Is this really necessary for the qtests? I can understand the change f= or the > >> unit tests, but the qtests are separate programs where I could not ima= gine > >> that they use the yank functions in any way? =20 > >=20 > > Yes, it is necessary. While the yank functions are not called in these = tests, > > it still checks that registering and unregistering of yank instances and > > functions is done correctly. I.e. That no yank functions are registered= before > > the instance, that the yank instance is only unregistered after all fun= ctions > > where unregistered, that the same instance is not registered twice and = that > > the yank instance actually exists before it is unregistered. =20 >=20 > Now you even confused me more. Could you elaborate a little bit? If none = of=20 > the functions are called by the test, which part of yank.c is excercised= =20 > here at all? Could you give a more detailed example? The only thing I cou= ld=20 > imagine is yank_init(), but that does not look like something we need to= =20 > check in a qtest ? Oh, sorry. I meant yank's concept of a yank function here. It works this wa= y: The different subsystems first register a yank instance. So in this case when starting migration in the test, the migration code first registers a yank instance. Then, it registers _yank functions_ with this instance, for for example to shutdown a socket. Now, (in the real-world qemu case) if qemu hangs, the user can use the 'yank' qmp command to call the _yank functions_ to recover. The test doesn't test the 'yank' qmp command, but yank_register_instance, yank_register_function (which are called by the migration code and thus also the migration test) still check if everything is done correctly. Regards, Lukas Straub > Thomas >=20 --=20 --Sig_/USBNde/r7DqK08rwN3gh2t6 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEg/qxWKDZuPtyYo+kNasLKJxdslgFAmBY2FAACgkQNasLKJxd sliFkw//VuCLGwKwx59FxYGgmECuFfogiQDOgBW6czBZBbc1bYjiMv1l75n61JS2 qCHfWL0vQfRH58SQPHI3zz0zoHVq/Sdt4EyTbEZ0TQyYhUmVkWCu0SCiNnART7WJ /Y+JMJIQzY+ZiVxcxaE7PVW8b3k4kN6Kd2zA56Nt7XPG9fYe8+cOiV0MMEby//gZ 4bHiI9lmK21iVhLli+COAm4MjhEzXpNGdcILrYdwRsRO16P4Fv4uIEzcq80sgH24 QzQzLJQF/w6RBTVpxqZunDiRXuhMw9RD5ASkAhoF8mUqNpcGCis8zZm7Z6NrHDbO XIo0PgecTCprVv6T5fdiG+HLzPOgRe9YHyAXtLQ98fvRWEWtDQsPHS/UeLOjmmEM /d+rAIVyhv3+sXJ1Ho0MfQ/HWsscb4Q2bEPJfYfkkwSA+uS1z5xSNu9lsw790JIW nuyJRoK9Iv9wqh5hFrLCRWpWypwYTpDoKOjE4ttOSvcJQLyoeu/RBZMLhsscFPmp Idnl7hamOZ6/ZA4gYJVHYEzKrGKZy0pd7npkef1YdapG6qVLjzVsYlKZttjytMMW /7Ys/pZ3W9IsLFQzTz4oF6Nsx19HKmZxWT9D6PYjPC+3eUrlvaRWivs/8Ju2n6Kd 9m/Inz7tR6w8imDxnpJSbuce6op1ZTm3EB3S+ALV5xaEWK2BHW8= =Wkd9 -----END PGP SIGNATURE----- --Sig_/USBNde/r7DqK08rwN3gh2t6--