From nobody Tue Feb 10 13:18:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1666953715; cv=none; d=zohomail.com; s=zohoarc; b=hiip1GUvCt4mVV4xnf0DTCEK0G+r1RJZl0ISOCiSjC43RCGTKZ4elP7gWq8Jh70/zHo3vU8dGzEBkNpXmjbyoPAqU+T0MX6PLH6a+q6UNgkQLeEqO+dtFBaXckiBKAwzV5Qu7x0lcsLAOSg3n7K7EXpMk+Nmxpz9kiP+PCpWlvo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666953715; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ifcleT7pBfKzPGQ0kfkVrXFW2VaaxuRXmqqwY5FzkBw=; b=Y/dmQ1xvYaxw4f27Qd7PTfqVt+a0ppOKubcVQ1T7vxP5GeOr1a2xPjgrFLnoH81eyjsV9vbpNtGP5QzN4cXP1SFg3PJfj/s7upnVd+arEcT47tajI9Vi97ymDZ9G+wbS+4oV6RUkdjq1oZtmvU9U6g6IXi6JtlkEFrBM67Hrpro= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666953715309578.3201133062648; Fri, 28 Oct 2022 03:41:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooMm4-0002Jb-CY; Fri, 28 Oct 2022 06:39:40 -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 1ooMlq-0002DG-Dh for qemu-devel@nongnu.org; Fri, 28 Oct 2022 06:39:26 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooMlo-00021e-MK for qemu-devel@nongnu.org; Fri, 28 Oct 2022 06:39:26 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 705F11F38D; Fri, 28 Oct 2022 10:39:23 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0BC9C13A6E; Fri, 28 Oct 2022 10:39:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wFo/AFuxW2PVPwAAMHmgww (envelope-from ); Fri, 28 Oct 2022 10:39:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666953563; 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=ifcleT7pBfKzPGQ0kfkVrXFW2VaaxuRXmqqwY5FzkBw=; b=jeqKnnp6o7Q4C5THJsAZqVB4Vmfsx7MpGuvPof/AsFf+WBTfQva+oINiwXpPP5XMJaWQSk ZpTyvlr74OxD46e2Zpt/5m0Jv9PSyUHmOBT0NWI2OkYBRMc619qYM+5Liow8kgpgEALmwr 0Js2VvXNs+vPSweqvygO+2zJDJmkBrE= From: Nikolay Borisov To: dgilbert@redhat.com, berrange@redhat.com Cc: qemu-devel@nongnu.org, jfehlig@suse.com, Claudio.Fontana@suse.com, dfaggioli@suse.com, Nikolay Borisov Subject: [PATCH v3 14/14] tests/qtest: migration-test: Add tests for file-based migration Date: Fri, 28 Oct 2022 13:39:14 +0300 Message-Id: <20221028103914.908728-15-nborisov@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028103914.908728-1-nborisov@suse.com> References: <20221028103914.908728-1-nborisov@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.220.29; envelope-from=nborisov@suse.com; helo=smtp-out2.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1666953716348100001 Content-Type: text/plain; charset="utf-8" Add basic tests for file-based migration as well as for the 'fixed-ram' feature. Signed-off-by: Nikolay Borisov --- tests/qtest/migration-test.c | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index ef4427ff4d41..de877473f193 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -748,6 +748,7 @@ static void test_migrate_end(QTestState *from, QTestSta= te *to, bool test_dest) cleanup("migsocket"); cleanup("src_serial"); cleanup("dest_serial"); + cleanup("migfile"); } =20 #ifdef CONFIG_GNUTLS @@ -1359,6 +1360,14 @@ static void test_precopy_common(MigrateCommon *args) * hanging forever if migration didn't converge */ wait_for_migration_complete(from); =20 + /* + * For file based migration the target must begin its migration af= ter + * the source has finished + */ + if (strstr(args->connect_uri, "file:")) { + migrate_incoming_qmp(to, args->connect_uri, "{}"); + } + if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); } @@ -1514,6 +1523,39 @@ static void test_precopy_unix_xbzrle(void) test_precopy_common(&args); } =20 +static void test_precopy_unix_file(void) +{ + g_autofree char *uri =3D g_strdup_printf("file:%s/migfile", tmpfs); + MigrateCommon args =3D { + .connect_uri =3D uri, + .listen_uri =3D "defer", + }; + + test_precopy_common(&args); +} + +static void * +test_migrate_fixed_ram_start(QTestState *from, + QTestState *to) +{ + migrate_set_capability(from, "fixed-ram", true); + migrate_set_capability(to, "fixed-ram", true); + + return NULL; +} + +static void test_precopy_unix_fixed_ram(void) +{ + g_autofree char *uri =3D g_strdup_printf("file:%s/migfile", tmpfs); + MigrateCommon args =3D { + .connect_uri =3D uri, + .listen_uri =3D "defer", + .start_hook =3D test_migrate_fixed_ram_start, + }; + + test_precopy_common(&args); +} + static void test_precopy_tcp_plain(void) { MigrateCommon args =3D { @@ -2506,6 +2548,10 @@ int main(int argc, char **argv) test_precopy_unix_tls_psk); #endif =20 + qtest_add_func("/migration/precopy/unix/file", test_precopy_unix_file); + qtest_add_func("/migration/precopy/unix/fixed-ram", + test_precopy_unix_fixed_ram); + if (has_uffd) { /* * NOTE: psk test is enough for postcopy, as other types of TLS --=20 2.34.1