From patchwork Fri Nov 15 16:50:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 843507 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp946516wrc; Fri, 15 Nov 2024 08:51:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVO+tP9Efc5kBx1coQMkPADjE09XLOA0sAdcZiuMtjMSFpvPkZCYvV2f+sahpvURWK0VvMIdA==@linaro.org X-Google-Smtp-Source: AGHT+IGuWWliY+2UrzZhWv53/RoTYABS9z5j/R7WTq33zhB2v0RN6PrCyy1kfS4d8L+qAKiMaC3c X-Received: by 2002:a05:620a:44d1:b0:7b1:1cf6:cfd0 with SMTP id af79cd13be357-7b3622db90fmr473702985a.33.1731689493441; Fri, 15 Nov 2024 08:51:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731689493; cv=none; d=google.com; s=arc-20240605; b=aimabX3BM/el5/YfOsGDw+GuQkXOOieN1jnzxwluo4yI31onrwknSLyKtraPLbHF+/ sHMfFrtIb763wDw7FsGyivqspFAGE77lQGxwp1joPDMDgSI6feCtGqnpBuWL9SeLOvw/ mjkMqoWRsoeNx64xMYx5A4QQoodnisZ/WZkfjSTJyupKSYAeCApi/OXeKMkfSTT7FA1F l5czq9mx8a0Tucwbdy7nB59MA0J/wmNUNYhxNRBE8iC4lo6p5e/j5QH75XqqVqok+C2w dM6kb4sO3SVvfszkTGoC7RxGZdVSt1+muypfpZU7Q5muQW9lWgw5Ymya7t6iv13GmqKZ 6NPQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=4o50frKdRk5B+qe4iFKjaoYsk7e3gHs+0Y11JdkCyVE=; fh=L+F+imk7SNxd+VJgpUcpWeNwCxrzN2ZHmlwvyOYjkVU=; b=XFSlpWwkDdNgPVhqOoosVZaaSC96bLo0lOarimK4fynJUzmIJu7VI3x9J4xi6oFyTD C6jbfPowqTzbZ7wvyrdGu0fp7w0ixevERL6l4N0q2xhWhBCKbirVI7MhWPQtHHATH0uQ dRmpfNG5qnIxRKfgrSIvfwbCYYLNYFigIYXUFAvRg8A1hOttKD5C+c0UF/Qer4aU/Tgt pamHWnTzxU51TA3ehiz6dzi2oQWpJbFtJxPpttc/FrqNuhODlJhTJTrnjBDPf1VOKWW8 869xxzbS7yJOjgnYT9FJu/py41WMXWPCbztOj0sUb0BlOMvfjxdG9e7aqbO51qNRefY7 Vm7w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GPhKBvfy; 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 af79cd13be357-7b35ca28855si414123385a.243.2024.11.15.08.51.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 08:51:33 -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=GPhKBvfy; 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 1tBzX0-0007w7-Pl; Fri, 15 Nov 2024 11:50:50 -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-0007uz-6b for qemu-devel@nongnu.org; Fri, 15 Nov 2024 11:50:48 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBzWw-0003ah-43 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 11:50:47 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43159c9f617so15983695e9.2 for ; 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=1731689443; x=1732294243; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4o50frKdRk5B+qe4iFKjaoYsk7e3gHs+0Y11JdkCyVE=; b=GPhKBvfyXeTw+9glO3VSJbXCSxcruAUWqHAor3qnskbyvUdZY5dTnCWcYXvzzixaNn SL04xLf5fUW0jj7Yu40JqVBptWwB+f3m0IGynGPurB2nwYe2XE7PfTdMb1J+VdlqrQaX JvcU4LzSHjt0wBevZyyXOpRQtR55dfblfFDMy9voxp7F2pKCiJe+4GKZ1TS/VP2SiDVn dY0JUwAWU1vEuMqZuiGqC+sSO9Q0zfg8AhHkfDGfPjsic3evxubAhkWu08QMbEGacXmD wGmaLGKb2t8sBrhyIL/e0PNdL9xShO/UwAtCPI5XZ25T+7aPaWW0cwfjMBphFO+gN02H cirA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731689443; x=1732294243; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4o50frKdRk5B+qe4iFKjaoYsk7e3gHs+0Y11JdkCyVE=; b=Cw9DKtvVX/DnPLx72SIpau7Ud3gMAzEeWXnb0qXTZ28Qpeb45D58hPepu5Y2us0ANf R7LzH2ydvs89+TvQI63XzrA9cFJBFC4+7XUhCuDmrXe4FBykHsnfivbLSjgJ+L/ZK2YK X36w5sk+wwoMD2eWhpJ4ncXHPxtuIw19VyovlBDxC/5bXD8MtYVLgj3HU7JYNMlCA2Az 2F8oLrNdDyPFy8B14WIagCzNV+e3mpfUNUMObLn2GNW8VaCV9vwdXz5/dXudBBU04I83 1RHo6o9lEbYhdxumNMBcmH5M2n9mN+hodRZCqfPeCOU3Vjt8swmpBV7F9WLm9VJV+2ip wEkQ== X-Gm-Message-State: AOJu0YzCYgBmGf0MuXXu71335nrgErEojHBQMcfTI0DbzNpbxKSNpTct Pc2zWPNMRyV3Sj0BZx64OqH9c3COB0LRMSSXUqaRmAjy4qkAsn+2lty0liMSlpJVyJYUlwrqGNq a X-Received: by 2002:a05:600c:3b99:b0:431:6052:48c3 with SMTP id 5b1f17b1804b1-432df74cbffmr32808765e9.16.1731689443342; Fri, 15 Nov 2024 08:50:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 08:50:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Roque Arcudia Hernandez Subject: [PATCH 0/3] qtest: Provide and use function for doing system reset Date: Fri, 15 Nov 2024 16:50:38 +0000 Message-Id: <20241115165041.1148095-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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 I noticed while reviewing Roque's patchset that adds tests for the CMSDK watchdog device that we are gradually accumulating tests in tests/qtest which open-code "now reset the QEMU system". Moreover, several of those tests get it wrong, by failing to wait for the QMP RESET event that signals that the reset has completed. This series adds new functions qtest_system_reset() and qtest_system_reset_nowait(), which send the QMP system_reset command and then either do or do not wait for the RESET event. It uses them to replace all the places in the test suite that currently hand-craft sending a system_reset command. The tests that previously forgot to wait for RESET and now do so are bios-tables-test, q35-test, stm32l4x5_gpio-test, and stm32l4x5_syscfg-test. thanks -- PMM Peter Maydell (3): tests/qtest: Add qtest_system_reset() utility function tests/qtest: Use qtest_system_reset() instead of open-coded versions tests/qtest: Use qtest_system_reset_nowait() where appropriate tests/qtest/libqtest.h | 25 +++++++++++++++++++++++++ tests/qtest/bios-tables-test.c | 4 ++-- tests/qtest/boot-order-test.c | 7 +------ tests/qtest/device-plug-test.c | 11 +---------- tests/qtest/drive_del-test.c | 7 +------ tests/qtest/hd-geo-test.c | 9 +-------- tests/qtest/libqtest.c | 16 ++++++++++++++++ tests/qtest/q35-test.c | 12 ++---------- tests/qtest/qos-test.c | 3 +-- tests/qtest/stm32l4x5_gpio-test.c | 10 +--------- tests/qtest/stm32l4x5_syscfg-test.c | 12 ++---------- 11 files changed, 53 insertions(+), 63 deletions(-)