From nobody Mon May 6 11:56:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569244660; cv=none; d=zoho.com; s=zohoarc; b=X3x4LS/S1knE0P9nSL4QkKMnm5340egO6Puop1gu0vEd8RW5QCnrtVIJMiTgxt3hjL8KiADkG4sHcZabUiIfaDAo166asMOQPVE/qR1BGfc3246UwTicDKh207n+oBiefAAXOX/9z/DZo7vZPxeuhVq8H8Mp8wD1TU2TYjM8LWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569244660; 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:ARC-Authentication-Results; bh=PWcPDHxb6q7wk4nEm+k/M0t65D7nMeeJcOmYydqC6Es=; b=eHYzJVo5U/MHwJ0lNvjEmr7DlmmN3DplMDS/gLYKADKYceN+cJiGmn48p5WVL9/Rfqq24oK1xuyaNoHPNyNzASeqTyAel4GVpzV4K8SHwKzlRBHtF7KeWm05bSBytZ9LHOElw4YrxlS6cKZqKSlrmEzh0646TiGE3agRMGdBJms= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569244660744681.8737734628997; Mon, 23 Sep 2019 06:17:40 -0700 (PDT) Received: from localhost ([::1]:56424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCODh-0006dJ-C3 for importer@patchew.org; Mon, 23 Sep 2019 09:17:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54920) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCO6q-0001O4-5o for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:10:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCO6p-0006I0-16 for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:10:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41910) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCO6o-0006HU-PI for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:10:30 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DD4130917AA; Mon, 23 Sep 2019 13:10:30 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-213.ams2.redhat.com [10.36.117.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA2BF601A2; Mon, 23 Sep 2019 13:10:28 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com Subject: [PATCH 1/2] tests/migration: Fail on unexpected migration states Date: Mon, 23 Sep 2019 14:10:21 +0100 Message-Id: <20190923131022.15498-2-dgilbert@redhat.com> In-Reply-To: <20190923131022.15498-1-dgilbert@redhat.com> References: <20190923131022.15498-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 23 Sep 2019 13:10:30 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 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: thuth@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" We've got various places where we wait for a migration to enter a given state; but if we enter an unexpected state we tend to fail in odd ways; add a mechanism for explicitly testing for any state which we shouldn't be in. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Cleber Rosa Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Tested-by: Cleber Rosa --- tests/migration-test.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 258aa064d4..9c62ee5331 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -255,15 +255,19 @@ static void read_blocktime(QTestState *who) } =20 static void wait_for_migration_status(QTestState *who, - const char *goal) + const char *goal, + const char **ungoals) { while (true) { bool completed; char *status; + const char **ungoal; =20 status =3D migrate_query_status(who); completed =3D strcmp(status, goal) =3D=3D 0; - g_assert_cmpstr(status, !=3D, "failed"); + for (ungoal =3D ungoals; *ungoal; ungoal++) { + g_assert_cmpstr(status, !=3D, *ungoal); + } g_free(status); if (completed) { return; @@ -274,7 +278,8 @@ static void wait_for_migration_status(QTestState *who, =20 static void wait_for_migration_complete(QTestState *who) { - wait_for_migration_status(who, "completed"); + wait_for_migration_status(who, "completed", + (const char * []) { "failed", NULL }); } =20 static void wait_for_migration_pass(QTestState *who) @@ -809,7 +814,9 @@ static void test_postcopy_recovery(void) * Wait until postcopy is really started; we can only run the * migrate-pause command during a postcopy */ - wait_for_migration_status(from, "postcopy-active"); + wait_for_migration_status(from, "postcopy-active", + (const char * []) { "failed", + "completed", NULL }); =20 /* * Manually stop the postcopy migration. This emulates a network @@ -822,7 +829,9 @@ static void test_postcopy_recovery(void) * migrate-recover command can only succeed if destination machine * is in the paused state */ - wait_for_migration_status(to, "postcopy-paused"); + wait_for_migration_status(to, "postcopy-paused", + (const char * []) { "failed", "active", + "completed", NULL }); =20 /* * Create a new socket to emulate a new channel that is different @@ -836,7 +845,9 @@ static void test_postcopy_recovery(void) * Try to rebuild the migration channel using the resume flag and * the newly created channel */ - wait_for_migration_status(from, "postcopy-paused"); + wait_for_migration_status(from, "postcopy-paused", + (const char * []) { "failed", "active", + "completed", NULL }); migrate(from, uri, "{'resume': true}"); g_free(uri); =20 --=20 2.21.0 From nobody Mon May 6 11:56:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569244687; cv=none; d=zoho.com; s=zohoarc; b=iAQ/EGsFC6f4OwWUOdm8dONLFSyBMjAb6dSNS0r+VeHuJ7Ox/xnCCklU3ZdRlK04R0PFV213m+99qd3/nuDoCaKEp5WSPULc0aWvP8BzJOJthQrBuBjpBED3gbXLgI9Ha5tk+SHNDBfECjNpT89nBJupthb0cIgZAap+UgH56Vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569244687; 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:ARC-Authentication-Results; bh=JdmkrUecJWo1NGUT8ecAQB5TsM8jWN48uAJ3mSQXwLE=; b=gc/zru/usy9zDrHcxM153XN5y887veED53T6BNTAaIEc7hNWckn/ut+Uz9kkhqv5WKkiITpc52KV9XRDMtWMqxPcV7u1XjrHfjVWp57RbfJgifxwu6eAMNWPkxmuNJu4SwwJ0HjPqLTubLISDuXOHix+44adK4r2HAUA+ckYGIs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569244687522217.4402736687116; Mon, 23 Sep 2019 06:18:07 -0700 (PDT) Received: from localhost ([::1]:56426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCOEA-0006qH-8W for importer@patchew.org; Mon, 23 Sep 2019 09:18:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54943) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCO6s-0001RL-KI for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:10:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCO6q-0006Ir-H0 for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:10:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54901) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCO6q-0006IL-9C for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:10:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F22AA26696; Mon, 23 Sep 2019 13:10:31 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-213.ams2.redhat.com [10.36.117.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 663726012D; Mon, 23 Sep 2019 13:10:30 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com Subject: [PATCH 2/2] tests/migration/postcopy: trim migration bandwidth Date: Mon, 23 Sep 2019 14:10:22 +0100 Message-Id: <20190923131022.15498-3-dgilbert@redhat.com> In-Reply-To: <20190923131022.15498-1-dgilbert@redhat.com> References: <20190923131022.15498-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Mon, 23 Sep 2019 13:10:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 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: thuth@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" On slow hosts with tcg we were sometimes finding that the migration would complete during precopy and never get into the postcopy test. Trim back the bandwidth a bit to make that much less likely. Signed-off-by: Dr. David Alan Gilbert Acked-by: Alex Benn=C3=A9e Reviewed-by: Cleber Rosa Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Tested-by: Alex Benn=C3=A9e Tested-by: Cleber Rosa --- tests/migration-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 9c62ee5331..221a33d083 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -753,7 +753,7 @@ static int migrate_postcopy_prepare(QTestState **from_p= tr, * quickly, but that it doesn't complete precopy even on a slow * machine, so also set the downtime. */ - migrate_set_parameter_int(from, "max-bandwidth", 100000000); + migrate_set_parameter_int(from, "max-bandwidth", 30000000); migrate_set_parameter_int(from, "downtime-limit", 1); =20 /* Wait for the first serial output from the source */ --=20 2.21.0