From patchwork Thu May 23 20:19:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabiano Rosas X-Patchwork-Id: 1938575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=gdKCIXWe; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=8i32YBde; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=gdKCIXWe; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=8i32YBde; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vlfgr65ylz20dp for ; Fri, 24 May 2024 06:20:55 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAEuV-0000Vl-KC; Thu, 23 May 2024 16:19:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAEuU-0000Up-Hz for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:34 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAEuS-0002GJ-Pq for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:34 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7D4F022CA0; Thu, 23 May 2024 20:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495569; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Euse3n/rq5BL4NoMkhqVaT353odBzEaY9JhyVNmXZD8=; b=gdKCIXWer+ECPn76ALvrO24emWxJKILLt5h1dhCgnNRJlsCXSr0ba8/IkqGx3ltmgTWYH5 GuzmOPs9KwRJe6O12idsicMBiHQEqChCUsTWZkmewVsKzSjkB/4n2xx7lMOyF19Gt1lFRw vuiODt0xrR/ypJ4xtC8O3iYx38hI4F8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495569; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Euse3n/rq5BL4NoMkhqVaT353odBzEaY9JhyVNmXZD8=; b=8i32YBde+f1AFOqfo9xrQW0OXnuosksGsTLVc7TNi+Uk5jTjJIStKiwb1mgRP2UUNUkYSf 64BsiixSFuWR0eDw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=gdKCIXWe; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=8i32YBde DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495569; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Euse3n/rq5BL4NoMkhqVaT353odBzEaY9JhyVNmXZD8=; b=gdKCIXWer+ECPn76ALvrO24emWxJKILLt5h1dhCgnNRJlsCXSr0ba8/IkqGx3ltmgTWYH5 GuzmOPs9KwRJe6O12idsicMBiHQEqChCUsTWZkmewVsKzSjkB/4n2xx7lMOyF19Gt1lFRw vuiODt0xrR/ypJ4xtC8O3iYx38hI4F8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495569; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Euse3n/rq5BL4NoMkhqVaT353odBzEaY9JhyVNmXZD8=; b=8i32YBde+f1AFOqfo9xrQW0OXnuosksGsTLVc7TNi+Uk5jTjJIStKiwb1mgRP2UUNUkYSf 64BsiixSFuWR0eDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2C41C13A6C; Thu, 23 May 2024 20:19:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id aFb0OM6kT2ZqcgAAD6G6ig (envelope-from ); Thu, 23 May 2024 20:19:26 +0000 From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Thomas Huth , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Fiona Ebner , Het Gala , Laurent Vivier , Paolo Bonzini Subject: [RFC PATCH 1/4] tests/qtest/libqtest: Introduce another qtest_init version with no handshake Date: Thu, 23 May 2024 17:19:19 -0300 Message-Id: <20240523201922.28007-2-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240523201922.28007-1-farosas@suse.de> References: <20240523201922.28007-1-farosas@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCPT_COUNT_SEVEN(0.00)[8]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim, suse.de:email, imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 7D4F022CA0 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: -3.01 Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Introduce a qtest_init version that does not go through the QMP handshake, but does pass the test binary environment variables forward. This is needed so we can run a simpler instance of QEMU with -machine, but not much else. The existing qtest_init_without_qmp_handshake() is not enough because this time we want to pass along the special QTEST_QEMU_BINARY_SRC|DST environment variables. Signed-off-by: Fabiano Rosas --- tests/qtest/libqtest.c | 14 +++++++++----- tests/qtest/libqtest.h | 13 +++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index d8f80d335e..911e45e189 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -513,11 +513,6 @@ static QTestState *qtest_init_internal(const char *qemu_bin, kill(s->qemu_pid, SIGSTOP); } #endif - - /* ask endianness of the target */ - - s->big_endian = qtest_query_target_endianness(s); - return s; } @@ -526,11 +521,20 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args) return qtest_init_internal(qtest_qemu_binary(NULL), extra_args); } +QTestState *qtest_init_with_env_no_handshake(const char *var, + const char *extra_args) +{ + return qtest_init_internal(qtest_qemu_binary(var), extra_args); +} + QTestState *qtest_init_with_env(const char *var, const char *extra_args) { QTestState *s = qtest_init_internal(qtest_qemu_binary(var), extra_args); QDict *greeting; + /* ask endianness of the target */ + s->big_endian = qtest_query_target_endianness(s); + /* Read the QMP greeting and then do the handshake */ greeting = qtest_qmp_receive(s); qobject_unref(greeting); diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index 6e3d3525bf..5e5554b5ad 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -68,6 +68,19 @@ QTestState *qtest_init(const char *extra_args); */ QTestState *qtest_init_with_env(const char *var, const char *extra_args); +/** + * qtest_init_with_env_no_handshake: + * @var: Environment variable from where to take the QEMU binary + * @extra_args: Other arguments to pass to QEMU. CAUTION: these + * arguments are subject to word splitting and shell evaluation. + * + * Like qtest_init_with_env(), but skip the qmp handshake. + * + * Returns: #QTestState instance. + */ +QTestState *qtest_init_with_env_no_handshake(const char *var, + const char *extra_args); + /** * qtest_init_without_qmp_handshake: * @extra_args: other arguments to pass to QEMU. CAUTION: these From patchwork Thu May 23 20:19:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabiano Rosas X-Patchwork-Id: 1938578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TduEx3KP; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=MNxKl6mL; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TduEx3KP; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=MNxKl6mL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VlfhJ5mgtz2020 for ; Fri, 24 May 2024 06:21:20 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAEuZ-0000ZW-Ex; Thu, 23 May 2024 16:19:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAEuX-0000Xd-Rt for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:37 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAEuT-0002GW-Q0 for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:37 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 33B2722CA1; Thu, 23 May 2024 20:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495572; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kDaw37QeDsntTYEQfIgRI8i/Cldol1zqIA8YZR5ICoo=; b=TduEx3KP4n/zCrpgit8BWs/KrkDqm6XNLzCuemnVAm80x2QsDjbK6Isw1B69+inAkwgVlz A6eYr+rqGHzXQo5KVGpyz1pZkZtlGdOL0onmW3NYRZPAikb2Zo1uSb4JWSJCvRvf8s7gBR uLcCTOHe7qlKPQkY2HvJb9GZu445Fx0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495572; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kDaw37QeDsntTYEQfIgRI8i/Cldol1zqIA8YZR5ICoo=; b=MNxKl6mLsXqRlg7ZRBe2IgGV2ZRMLZV09PaaqeUitFqvHzHPc+pwg0/rsPoAVkqfHv08tC BM10YiVHt3qykoDg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=TduEx3KP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=MNxKl6mL DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495572; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kDaw37QeDsntTYEQfIgRI8i/Cldol1zqIA8YZR5ICoo=; b=TduEx3KP4n/zCrpgit8BWs/KrkDqm6XNLzCuemnVAm80x2QsDjbK6Isw1B69+inAkwgVlz A6eYr+rqGHzXQo5KVGpyz1pZkZtlGdOL0onmW3NYRZPAikb2Zo1uSb4JWSJCvRvf8s7gBR uLcCTOHe7qlKPQkY2HvJb9GZu445Fx0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495572; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kDaw37QeDsntTYEQfIgRI8i/Cldol1zqIA8YZR5ICoo=; b=MNxKl6mLsXqRlg7ZRBe2IgGV2ZRMLZV09PaaqeUitFqvHzHPc+pwg0/rsPoAVkqfHv08tC BM10YiVHt3qykoDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E3B0513A6C; Thu, 23 May 2024 20:19:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MHoSKtGkT2ZqcgAAD6G6ig (envelope-from ); Thu, 23 May 2024 20:19:29 +0000 From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Thomas Huth , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Fiona Ebner , Het Gala , Laurent Vivier , Paolo Bonzini Subject: [RFC PATCH 2/4] tests/qtest/migration: Add a test that runs vmstate-static-checker Date: Thu, 23 May 2024 17:19:20 -0300 Message-Id: <20240523201922.28007-3-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240523201922.28007-1-farosas@suse.de> References: <20240523201922.28007-1-farosas@suse.de> MIME-Version: 1.0 X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 33B2722CA1 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns, suse.de:dkim, suse.de:email] Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We have the vmstate-static-checker script that takes the output of: '$QEMU -M $machine -dump-vmstate' for two different QEMU versions and compares them to check for compatibility breakages. This is just too simple and useful for us to pass on it. Add a test that runs the script. Since this needs to use two different QEMU versions, the test is skipped if only one QEMU is provided. The infrastructure for passing more than one binary is already in place: $ PYTHON=$(which python3.11) \ QTEST_QEMU_BINARY_SRC=../build-previous/qemu-system-x86_64 \ QTEST_QEMU_BINARY=./qemu-system-x86_64 \ ./tests/qtest/migration-test -p /x86_64/migration/vmstate-checker-script Signed-off-by: Fabiano Rosas --- some code duplication for now, just so we can reason about this without too much noise --- tests/qtest/migration-test.c | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index e8d3555f56..2253e0fc5b 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -63,6 +63,7 @@ static QTestMigrationState dst_state; #define DIRTYLIMIT_TOLERANCE_RANGE 25 /* MB/s */ #define ANALYZE_SCRIPT "scripts/analyze-migration.py" +#define VMSTATE_CHECKER_SCRIPT "scripts/vmstate-static-checker.py" #define QEMU_VM_FILE_MAGIC 0x5145564d #define FILE_TEST_FILENAME "migfile" @@ -1611,6 +1612,85 @@ static void test_analyze_script(void) test_migrate_end(from, to, false); cleanup("migfile"); } + +static void test_vmstate_checker_script(void) +{ + g_autofree gchar *cmd_src = NULL; + g_autofree gchar *cmd_dst = NULL; + g_autofree gchar *vmstate_src = NULL; + g_autofree gchar *vmstate_dst = NULL; + const char *machine_alias, *machine_opts = ""; + g_autofree char *machine = NULL; + const char *arch = qtest_get_arch(); + int pid, wstatus; + const char *python = g_getenv("PYTHON"); + + if (!getenv(QEMU_ENV_SRC) && !getenv(QEMU_ENV_DST)) { + g_test_skip("Test needs two different QEMU versions"); + return; + } + + if (!python) { + g_test_skip("PYTHON variable not set"); + return; + } + + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + if (g_str_equal(arch, "i386")) { + machine_alias = "pc"; + } else { + machine_alias = "q35"; + } + } else if (g_str_equal(arch, "s390x")) { + machine_alias = "s390-ccw-virtio"; + } else if (strcmp(arch, "ppc64") == 0) { + machine_alias = "pseries"; + } else if (strcmp(arch, "aarch64") == 0) { + machine_alias = "virt"; + } else { + g_assert_not_reached(); + } + + if (!qtest_has_machine(machine_alias)) { + g_autofree char *msg = g_strdup_printf("machine %s not supported", machine_alias); + g_test_skip(msg); + return; + } + + machine = resolve_machine_version(machine_alias, QEMU_ENV_SRC, + QEMU_ENV_DST); + + vmstate_src = g_strdup_printf("%s/vmstate-src", tmpfs); + vmstate_dst = g_strdup_printf("%s/vmstate-dst", tmpfs); + + cmd_dst = g_strdup_printf("-machine %s,%s -dump-vmstate %s", + machine, machine_opts, vmstate_dst); + cmd_src = g_strdup_printf("-machine %s,%s -dump-vmstate %s", + machine, machine_opts, vmstate_src); + + qtest_init_with_env_no_handshake(QEMU_ENV_SRC, cmd_src); + qtest_init_with_env_no_handshake(QEMU_ENV_DST, cmd_dst); + + pid = fork(); + if (!pid) { + close(1); + open("/dev/null", O_WRONLY); + execl(python, python, VMSTATE_CHECKER_SCRIPT, + "-s", vmstate_src, + "-d", vmstate_dst, + NULL); + g_assert_not_reached(); + } + + g_assert(waitpid(pid, &wstatus, 0) == pid); + if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus) != 0) { + g_test_message("Failed to run vmstate-static-checker.py"); + g_test_fail(); + } + + cleanup("vmstate-src"); + cleanup("vmstate-dst"); +} #endif static void test_precopy_common(MigrateCommon *args) @@ -3495,6 +3575,8 @@ int main(int argc, char **argv) #ifndef _WIN32 if (!g_str_equal(arch, "s390x")) { migration_test_add("/migration/analyze-script", test_analyze_script); + migration_test_add("/migration/vmstate-checker-script", + test_vmstate_checker_script); } #endif migration_test_add("/migration/precopy/unix/plain", From patchwork Thu May 23 20:19:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabiano Rosas X-Patchwork-Id: 1938579 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pc+MvFLK; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=h+9n2G7c; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=M5bYby6q; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=IGesqfAT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VlfhK62Spz20PY for ; Fri, 24 May 2024 06:21:21 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAEuZ-0000ZV-BJ; Thu, 23 May 2024 16:19:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAEuX-0000Y4-Uh for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:37 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAEuW-0002Gv-77 for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:37 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E9AD422CA0; Thu, 23 May 2024 20:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495575; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TV9fz7QaqOmoOjB1sjErTUxyrFvJZEhe1nfzY/PClgo=; b=pc+MvFLKsug2ANYm5BsW/vFObOLWy6NBkjQQXtgIwt9F59TRUjPbhW1nfdPyR4omzXuYqC fxYjqU6b95qEHFpUEW2R5RSISdEgG+3sgNC0nUGIG4ka5+Y86bv9czGe9S+qJuUH8HKV4S pzEfzl5OvJ072mYQeeJyGtEKI1jq0fY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495575; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TV9fz7QaqOmoOjB1sjErTUxyrFvJZEhe1nfzY/PClgo=; b=h+9n2G7cGsmbCgOdwikFHwdhHsnwWGpRcplE4H6iad/038WZVjJrykG/2KVyJUDCDQT4Wj h/MqQujRpQDH3HCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495574; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TV9fz7QaqOmoOjB1sjErTUxyrFvJZEhe1nfzY/PClgo=; b=M5bYby6qOwQ8zBn6GlUYB9EFWz6KEeA1bO2jcKLEdspEedABTvGCBS6/KyktV/IS4vJMuq rDfKVlhkTmQlDyh9312C5lNQDGYQ5BIZ94cqbC2P8Opx381kwsZ0SAvR7h7Tx0Xui02HBx EdTXfRuK7ZS1mN2tUqSse4Z89+xczRY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495574; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TV9fz7QaqOmoOjB1sjErTUxyrFvJZEhe1nfzY/PClgo=; b=IGesqfATtTIs51OPNZOwEUZ79nJ/I+nEnf6tHvHhTxToLFHhoAsKH+JlWYDWtuG7oewiDM HvJBETGTJOxCWmDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A473A13A6C; Thu, 23 May 2024 20:19:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id QO2PGtSkT2ZqcgAAD6G6ig (envelope-from ); Thu, 23 May 2024 20:19:32 +0000 From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Thomas Huth , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Fiona Ebner , Het Gala , Laurent Vivier , Paolo Bonzini Subject: [RFC PATCH 3/4] tests/qtest/migration: Add support for simple device tests Date: Thu, 23 May 2024 17:19:21 -0300 Message-Id: <20240523201922.28007-4-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240523201922.28007-1-farosas@suse.de> References: <20240523201922.28007-1-farosas@suse.de> MIME-Version: 1.0 X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The current migration-tests are almost entirely focused on catching bugs on the migration code itself, not on the device migration infrastructure (vmstate). That means we miss catching some low hanging fruits that would show up immediately if only we had the device in question present in the VM. Add a list of devices to include by default in the migration-tests, starting with one that recently had issues, virtio-gpu. Also add an environment variable QTEST_DEVICE_OPTS to allow test users to experiment with different devices or device options. Do not run every migration test with the devices because that would increase the complexity of the command lines and, as mentioned, the migration-tests are mostly used to test the core migration code, not the device migration. Add a special value QTEST_DEVICE_OPTS=all that enables testing with devices. Notes on usage: For this new testing mode, it's not useful to run all the migration tests, a single test would probably suffice to catch any issues, so provide the -p option to migration-test and the test of your choice. Like with the cross-version compatibility tests in CI and the recently introduced vmstate-static-checker test, to be of any use, a test with devices needs to be run against a different QEMU version, like so: $ cd build $ QTEST_DEVICE_OPTS=all \ QTEST_QEMU_BINARY=./qemu-system-x86_64 \ QTEST_QEMU_BINARY_DST=../build-previous/qemu-system-x86_64 \ ./tests/qtest/migration-test -p /x86_64/migration/precopy/tcp/plain $ cd build $ QTEST_DEVICE_OPTS='-device virtio-net' \ QTEST_QEMU_BINARY=./qemu-system-x86_64 \ QTEST_QEMU_BINARY_DST=../build-previous/qemu-system-x86_64 \ ./tests/qtest/migration-test -p /x86_64/migration/precopy/tcp/plain Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu --- tests/qtest/migration-test.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 2253e0fc5b..35bb224d18 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -71,6 +71,13 @@ static QTestMigrationState dst_state; #define QEMU_ENV_SRC "QTEST_QEMU_BINARY_SRC" #define QEMU_ENV_DST "QTEST_QEMU_BINARY_DST" +/* + * The tests using DEFAULT_DEVICES need a special invocation and + * cannot be reached from make check, so don't bother with the + * --without-default-devices build. + */ +#define DEFAULT_DEVICES "-device virtio-gpu" + #if defined(__linux__) #include #include @@ -701,6 +708,7 @@ static int test_migrate_start(QTestState **from, QTestState **to, const char *memory_size; const char *machine_alias, *machine_opts = ""; g_autofree char *machine = NULL; + g_autofree gchar *device_opts = NULL; if (args->use_shmem) { if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) { @@ -793,12 +801,17 @@ static int test_migrate_start(QTestState **from, QTestState **to, g_test_message("Using machine type: %s", machine); + device_opts = g_strdup(getenv("QTEST_DEVICE_OPTS")); + if (g_str_equal(device_opts, "all")) { + device_opts = g_strdup(DEFAULT_DEVICES); + } + cmd_source = g_strdup_printf("-accel kvm%s -accel tcg " "-machine %s,%s " "-name source,debug-threads=on " "-m %s " "-serial file:%s/src_serial " - "%s %s %s %s %s", + "%s %s %s %s %s %s", kvm_opts ? kvm_opts : "", machine, machine_opts, memory_size, tmpfs, @@ -806,6 +819,7 @@ static int test_migrate_start(QTestState **from, QTestState **to, arch_source ? arch_source : "", shmem_opts ? shmem_opts : "", args->opts_source ? args->opts_source : "", + device_opts ? device_opts : "", ignore_stderr); if (!args->only_target) { *from = qtest_init_with_env(QEMU_ENV_SRC, cmd_source); @@ -820,7 +834,7 @@ static int test_migrate_start(QTestState **from, QTestState **to, "-m %s " "-serial file:%s/dest_serial " "-incoming %s " - "%s %s %s %s %s", + "%s %s %s %s %s %s", kvm_opts ? kvm_opts : "", machine, machine_opts, memory_size, tmpfs, uri, @@ -828,6 +842,7 @@ static int test_migrate_start(QTestState **from, QTestState **to, arch_target ? arch_target : "", shmem_opts ? shmem_opts : "", args->opts_target ? args->opts_target : "", + device_opts ? device_opts : "", ignore_stderr); *to = qtest_init_with_env(QEMU_ENV_DST, cmd_target); qtest_qmp_set_event_callback(*to, From patchwork Thu May 23 20:19:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabiano Rosas X-Patchwork-Id: 1938577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TdftmnAv; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=U7GTMSPg; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TdftmnAv; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=U7GTMSPg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vlfgr640Qz20PY for ; Fri, 24 May 2024 06:20:55 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAEud-0000dr-AI; Thu, 23 May 2024 16:19:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAEuc-0000dZ-I7 for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:42 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAEua-0002HL-AB for qemu-devel@nongnu.org; Thu, 23 May 2024 16:19:42 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 239D022CA1; Thu, 23 May 2024 20:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495578; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9a+i01ypPUBXQqxb3ZkvWdnNpmAXA9MsaEaz7vDZC8k=; b=TdftmnAvWA3gTBxu9JPZByiNJAVPpmSECqFwyl+/WdzQeJxppL3HxDjPZ/W8SHXiVK53xA UYG8ERBqJdg/wvKSgUXlBNI2bAWHSPdS9sxYm/tF67U/KXxbq4ELrbdYUGykx9FYTWm6Zu 2PGd5vmzULseVhrGLsNc8i4D4IbA6y0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495578; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9a+i01ypPUBXQqxb3ZkvWdnNpmAXA9MsaEaz7vDZC8k=; b=U7GTMSPgYeEcHQI2QnWXLFL3E1PsA1bkN1fE4Er8UhpVZfiw8KbamLWBir/KIcVolRz/71 MeGpm3nUHQwRdDDw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716495578; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9a+i01ypPUBXQqxb3ZkvWdnNpmAXA9MsaEaz7vDZC8k=; b=TdftmnAvWA3gTBxu9JPZByiNJAVPpmSECqFwyl+/WdzQeJxppL3HxDjPZ/W8SHXiVK53xA UYG8ERBqJdg/wvKSgUXlBNI2bAWHSPdS9sxYm/tF67U/KXxbq4ELrbdYUGykx9FYTWm6Zu 2PGd5vmzULseVhrGLsNc8i4D4IbA6y0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716495578; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9a+i01ypPUBXQqxb3ZkvWdnNpmAXA9MsaEaz7vDZC8k=; b=U7GTMSPgYeEcHQI2QnWXLFL3E1PsA1bkN1fE4Er8UhpVZfiw8KbamLWBir/KIcVolRz/71 MeGpm3nUHQwRdDDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6761A13A6C; Thu, 23 May 2024 20:19:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id uHC8C9ekT2ZqcgAAD6G6ig (envelope-from ); Thu, 23 May 2024 20:19:35 +0000 From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Thomas Huth , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Fiona Ebner , Het Gala , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH 4/4] ci: Add the new migration device tests Date: Thu, 23 May 2024 17:19:22 -0300 Message-Id: <20240523201922.28007-5-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240523201922.28007-1-farosas@suse.de> References: <20240523201922.28007-1-farosas@suse.de> MIME-Version: 1.0 X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_SEVEN(0.00)[10]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:email]; RCVD_TLS_ALL(0.00)[] Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We have two new migration tests that check cross version compatibility. One uses the vmstate-static-checker.py script to compare the vmstate structures from two different QEMU versions. The other runs a simple migration with a few devices present in the VM, to catch obvious breakages. Add both tests to the migration-compat-common job. Signed-off-by: Fabiano Rosas --- .gitlab-ci.d/buildtest.yml | 43 +++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 91c57efded..bc7ac35983 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -202,18 +202,47 @@ build-previous-qemu: needs: - job: build-previous-qemu - job: build-system-opensuse - # The old QEMU could have bugs unrelated to migration that are - # already fixed in the current development branch, so this test - # might fail. + # This test is allowed to fail because: + # + # - The old QEMU could have bugs unrelated to migration that are + # already fixed in the current development branch. + # + # - The vmstate-static-checker script trips on renames and other + # backward-compatible changes to the vmstate structs. allow_failure: true variables: IMAGE: opensuse-leap MAKE_CHECK_ARGS: check-build script: - # Use the migration-tests from the older QEMU tree. This avoids - # testing an old QEMU against new features/tests that it is not - # compatible with. - - cd build-previous + - cd build + # device state static test: Tests the vmstate structures for + # compatibility across QEMU versions. Uses the latest version of + # the tests. + # old to new + - PYTHON=pyvenv/bin/python3 + QTEST_QEMU_BINARY_SRC=../build-previous/qemu-system-${TARGET} + QTEST_QEMU_BINARY=./qemu-system-${TARGET} + ./tests/qtest/migration-test -p /${TARGET}/migration/vmstate-checker-script + # new to old skipped because vmstate version bumps are always + # backward incompatible. + + # device state runtime test: Performs a cross-version migration + # with a select list of devices (see DEFAULT_DEVICES in + # migration-test.c). Using the multifd tcp test here, but any will + # do. + # old to new + - QTEST_DEVICE_OPTS=all QTEST_QEMU_BINARY_SRC=../build-previous/qemu-system-${TARGET} + QTEST_QEMU_BINARY=./qemu-system-${TARGET} ./tests/qtest/migration-test + -p /${TARGET}/migration/multifd/tcp/channels/plain/none + # new to old + - QTEST_DEVICE_OPTS=all QTEST_QEMU_BINARY_DST=../build-previous/qemu-system-${TARGET} + QTEST_QEMU_BINARY=./qemu-system-${TARGET} ./tests/qtest/migration-test + -p /${TARGET}/migration/multifd/tcp/channels/plain/none + + # migration core tests: Use the migration-tests from the older + # QEMU tree. This avoids testing an old QEMU against new + # features/tests that it is not compatible with. + - cd ../build-previous # old to new - QTEST_QEMU_BINARY_SRC=./qemu-system-${TARGET} QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test