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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD92C433F5 for ; Fri, 19 Nov 2021 09:18:35 +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 66B6B61A8C for ; Fri, 19 Nov 2021 09:18:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 66B6B61A8C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:33872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo02U-0007W6-I9 for qemu-devel@archiver.kernel.org; Fri, 19 Nov 2021 04:18:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnztY-0004Vu-4X for qemu-devel@nongnu.org; Fri, 19 Nov 2021 04:09:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnztV-0003tl-WC for qemu-devel@nongnu.org; Fri, 19 Nov 2021 04:09:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637312957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EocQ4KUZF6qnZeGCQI3/6edVKmrKAfowhRq9ao3tx9g=; b=PLCsPZ8gBfAepT+WP5ueCSfjdQ9xsLZvFbfPt0Nvar+LLzkk0/t4J0oF8oFk8kgtePucxy viOTYeHBTI8QSTzoT+33n6syC8vN0qhNpfZpeV4wpycLzBct/1Zphi3Dq06yfz/VmxFirG eBn0trpnoJsow6xh2fMZKwVpOaxm9Hc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-jPq6fYT4OfG00q37YJIXWQ-1; Fri, 19 Nov 2021 04:09:14 -0500 X-MC-Unique: jPq6fYT4OfG00q37YJIXWQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 454F21023F4E; Fri, 19 Nov 2021 09:09:13 +0000 (UTC) Received: from thinkpad.redhat.com (unknown [10.39.194.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id C66E862A41; Fri, 19 Nov 2021 09:08:50 +0000 (UTC) From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH v5 4/4] tests/libqtest: update virtio-net failover test Date: Fri, 19 Nov 2021 10:07:18 +0100 Message-Id: <20211119090718.440793-5-lvivier@redhat.com> In-Reply-To: <20211119090718.440793-1-lvivier@redhat.com> References: <20211119090718.440793-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lvivier@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=170.10.133.124; envelope-from=lvivier@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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: , Cc: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Juan Quintela , Michael Roth , "Michael S. Tsirkin" , Gerd Hoffmann , Igor Mammedov , Ani Sinha , Paolo Bonzini , Jens Freimann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Update the migration test to check we correctly wait the end of the card unplug before doing the migration. Signed-off-by: Laurent Vivier --- tests/qtest/virtio-net-failover.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c index 11fa0b21f8bf..9a81133154d6 100644 --- a/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c @@ -541,6 +541,29 @@ static void test_outmigrate(gconstpointer opaque) qobject_unref(resp); + /* wait the end of the migration setup phase */ + while (true) { + const gchar *status; + + ret = migrate_status(qts); + + status = qdict_get_str(ret, "status"); + if (strcmp(status, "wait-unplug") == 0) { + break; + } + + /* The migration must not start if the card is not ejected */ + g_assert_cmpstr(status, !=, "active"); + g_assert_cmpstr(status, !=, "completed"); + g_assert_cmpstr(status, !=, "failed"); + g_assert_cmpstr(status, !=, "cancelling"); + g_assert_cmpstr(status, !=, "cancelled"); + + qobject_unref(ret); + } + qobject_unref(ret); + + /* OS unplugs the cards, QEMU can move from wait-unplug state */ qtest_outl(qts, ACPI_PCIHP_ADDR_ICH9 + PCI_EJ_BASE, 1); qtest_qmp_eventwait(qts, "STOP"); -- 2.33.1