From patchwork Fri Nov 15 16:50:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 843509 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp946724wrc; Fri, 15 Nov 2024 08:52:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVkV3cGw1+5n1HvQBiF/pJCqhSCfj+AuHtMf2wCG9yT+Zh4rfXoE98Qs41m2+5V5rShiYizZw==@linaro.org X-Google-Smtp-Source: AGHT+IFudeD5JkvZjfqHYLBoQ0bxJUYvDpxIIpa+IEY4WBR68czwGXKCyy9547ehYvkENFbJiPJH X-Received: by 2002:a0c:f40a:0:b0:6cc:a17:ba65 with SMTP id 6a1803df08f44-6d3fb8a2e4fmr39692846d6.39.1731689521561; Fri, 15 Nov 2024 08:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731689521; cv=none; d=google.com; s=arc-20240605; b=aEK9k0c0eDx+I8nw/g1tC2KYgkLH2x6hdqM4WETG04JO5unCO7tfCYi9pFXcE7C3pE SyldAn5KZtOhwby82SqFZih+v6NNxN/kPeaMvg4+avsg9nPTkV1IMor5nyfSW0Fghjbm 5Nhg8NxW2Hpy7dseZddh2JuZ2Hvk8pmuBrVieYL/CefxOVO3uuQ4A++YbwEU+5kZTxor hSPrB+/FYc3pjvUuB4ppJRMzzyUzOtuoobGFGSzh8g1ME4/uk0oTjhoV3cLSXZF9E/o5 CrWo69ng/xN9vmUteFGLSzfC5e4U6gAR/NKbZscgUcYEfApZt0j2Fl03ktyAjQlcLtX/ 6vMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SGdMDfkgBn2W0Y27sTh83LY39xw1q9oPSugpDU4vMas=; fh=L+F+imk7SNxd+VJgpUcpWeNwCxrzN2ZHmlwvyOYjkVU=; b=C9o9UKssLhHWHexNDrnfyo/Vjo/0cduIZhOUZskvd9VCQqKryTNpLej8kUr/hRkZ/p PrQpH8S1UnoQnrZvNO09zwmakSn12yj5F+rcFGmwS8vz+Ce8RkJvbAME3CZD3ugfQYYu uhCcK/31QxRKsCOY3L+bEmY7D4d2B9Yt6BhgwC//TB9rEQREZQs6jXseaSdKJE6DgvU5 JnlBP00K/Tfi6d+DVzhu3LzfMVfa4BjOi9bRHWGUSD83n5CKgGkja/LTR6fLLJxfkMyW 6IcsC/XCKzTQAB9ezMjiMbfSK7VL7Ycp/wkk1ndJxqWaXJyM5zRwMLxk5ieqbN2dd0Mo etsg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cIGSaNnA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d3ee8b79d2si43614646d6.223.2024.11.15.08.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 08:52:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cIGSaNnA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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) 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-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) 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) 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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" -static void system_reset(QTestState *qtest) -{ - QDict *resp; - - resp = 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, const 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); } 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) static void device_del(QTestState *qts, bool and_reset) { - QDict *response; - qtest_qmp_device_del_send(qts, "dev0"); if (and_reset) { - response = qtest_qmp(qts, "{'execute': 'system_reset' }"); - g_assert(response); - g_assert(qdict_haskey(response, "return")); - qobject_unref(response); + qtest_system_reset_nowait(qts); } qtest_qmp_eventwait(qts, "DEVICE_DELETED");