From nobody Sat Nov 23 20:45:09 2024 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1731689521; cv=none; d=zohomail.com; s=zohoarc; b=W3uj9POyycd5lLgyRkA4MqwysUP6ewHXYIrr7zgrVWQ84KTduedlHc6UTKlysqTLvzbh0eJLBNcWXKXLGwzK8Q+WEdMkXDkJVmQ0TLs2dfvU7WKKreyJwAoXbdwGTsTBqWy/KagnWotI2525GeK93Sj48ZeYMvkVqVBxPI1UxxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731689521; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SGdMDfkgBn2W0Y27sTh83LY39xw1q9oPSugpDU4vMas=; b=fqJjQKZ/HJd59wzqXoITdQWn+crH8K0RD2tmC5Vk2TT6lJg5vib4FhnsNhhcuyF7fxBx8EBhLzh6Oj+utU6wpsuD4Vk2XueN/xCROfGshaLJyjMrUpgjtYUVBq5cGYq6PNe2lbP1u6LI5LXMN1h0NtPkbOKYGvABpg1SHgHB6R8= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1731689521885983.736607314064; Fri, 15 Nov 2024 08:52:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBzX1-0007wE-J0; Fri, 15 Nov 2024 11:50:51 -0500 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 1tBzWy-0007vE-UU for qemu-devel@nongnu.org; Fri, 15 Nov 2024 11:50:48 -0500 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBzWx-0003ar-3f for qemu-devel@nongnu.org; Fri, 15 Nov 2024 11:50:48 -0500 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-539f76a6f0dso960430e87.1 for ; Fri, 15 Nov 2024 08:50:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432dac0aef0sm60386405e9.28.2024.11.15.08.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 08:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731689445; x=1732294245; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SGdMDfkgBn2W0Y27sTh83LY39xw1q9oPSugpDU4vMas=; b=cIGSaNnA4Huh60ctPtljhxPSGqS06KOwkijwEJea1Ez435RYEMrnuQ10NNc7eEHgI0 JDQniir8MtVhV/cm821vEG1784eAB6IjsgfjAviy6OGfU5/M7EYK+YbtlzaV/YDA/IWe 4ll6cJgKGLKk3K8R9NqgKdvyV5Npe7BoJC1ttr+9OjrsKcSmvUYnOYTlGeMqPnuqnKFD HBuyNW3T0Cim+sJbfIEQ7aAiakHqCdTP6OwrIcMMEb+Z2dJ0qGKx4X9wVCbPabSM2lW5 nTARnVqKRquIirYDo+JVHFTR+lazCihG+5L1V522h7MEt5rZTUzjBcAqikBB8yjb3EGN f5Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731689445; x=1732294245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SGdMDfkgBn2W0Y27sTh83LY39xw1q9oPSugpDU4vMas=; b=Gv/uxaJQFfm1eHJ6K/+90YqBPmGVpfJDjEQzaiflGAH8AFqUbeZrHPI3R7cypL5Tex Mh7K/z3EecUNdh0GwpUuNU8mp6dIxl05hzzd5FCKlHXODC0TxCYFVlENyPSwT9L4XyDG 7VQ5L29h4E781SRp0RUL+xb5osucCCVxRp83pv7VX55wbtBDSprbUJzqXxAVzZelCw8A LjVewJkPkAnENAHWzQzPatcjFaDEsaIOpxs3MUZVJL/3KH6NawXk+L04SNocxDVpzEyc D6NJizYTCpwkN3uKxpIBNY5ZtKGgkpmPH9YT8qIFFmKGujJ9234IAIy/9lUSXU6MiPmC GhDQ== X-Gm-Message-State: AOJu0Yz/mER4hIOJ5+XXUWTj69Nwe3siGBAZ09XYVxs3MgJyxJQ8qRBQ j4yxKTqm097Rrpj72etEE3ZoeekVz+91HnnfKZ2P2TSAWBbUG1jAw9z75wnPLn8rXbTmMjm3/mI 2 X-Google-Smtp-Source: AGHT+IE5ME5xQRxlsulJq1uJy3/7WMYG7vxzmcEfHxDuQbHr78euWlsste4OI4UhVVhGLQvQuk/HYA== X-Received: by 2002:a2e:a586:0:b0:2fb:593c:2bf2 with SMTP id 38308e7fff4ca-2ff6064e0d9mr19254301fa.3.1731689445369; Fri, 15 Nov 2024 08:50:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Roque Arcudia Hernandez Subject: [PATCH 3/3] tests/qtest: Use qtest_system_reset_nowait() where appropriate Date: Fri, 15 Nov 2024 16:50:41 +0000 Message-Id: <20241115165041.1148095-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241115165041.1148095-1-peter.maydell@linaro.org> References: <20241115165041.1148095-1-peter.maydell@linaro.org> 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=2a00:1450:4864:20::12a; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1731689523782116600 Content-Type: text/plain; charset="utf-8" In the device and drive plug/unplug tests we want to trigger a system reset and then see if we get the appropriate DEVICE_DELETED event. Use qtest_system_reset_nowait() here. Signed-off-by: Peter Maydell Reviewed-by: Fabiano Rosas --- tests/qtest/device-plug-test.c | 11 +---------- tests/qtest/drive_del-test.c | 7 +------ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index c6f33153eb4..127a7f9efea 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -15,15 +15,6 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" =20 -static void system_reset(QTestState *qtest) -{ - QDict *resp; - - resp =3D qtest_qmp(qtest, "{'execute': 'system_reset'}"); - g_assert(qdict_haskey(resp, "return")); - qobject_unref(resp); -} - static void wait_device_deleted_event(QTestState *qtest, const char *id) { QDict *resp, *data; @@ -58,7 +49,7 @@ static void process_device_remove(QTestState *qtest, cons= t char *id) * handled, removing the device. */ qtest_qmp_device_del_send(qtest, id); - system_reset(qtest); + qtest_system_reset_nowait(qtest); wait_device_deleted_event(qtest, id); } =20 diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 7b67a4bbee4..99f6fc2de1b 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -154,15 +154,10 @@ static void device_add(QTestState *qts) =20 static void device_del(QTestState *qts, bool and_reset) { - QDict *response; - qtest_qmp_device_del_send(qts, "dev0"); =20 if (and_reset) { - response =3D qtest_qmp(qts, "{'execute': 'system_reset' }"); - g_assert(response); - g_assert(qdict_haskey(response, "return")); - qobject_unref(response); + qtest_system_reset_nowait(qts); } =20 qtest_qmp_eventwait(qts, "DEVICE_DELETED"); --=20 2.34.1