From patchwork Thu Dec 12 15:09:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabiano Rosas X-Patchwork-Id: 849734 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp981846wry; Thu, 12 Dec 2024 07:13:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWhNgtzT/0PP/2IM86Fy9JkT+J5Fm38dOSj/QsI02/ny9C9R8Bgaci63Bp/zfA/SbNvdfhuug==@linaro.org X-Google-Smtp-Source: AGHT+IE8ORN8lL4ejpp060Eb+cReDAGNWm5NgIQR9bPIGimvDWFBzk7kZ22AEg28pwRUzLo5VNPY X-Received: by 2002:ad4:4ee4:0:b0:6d8:8a7b:66a4 with SMTP id 6a1803df08f44-6db0f73375amr9018486d6.14.1734016387778; Thu, 12 Dec 2024 07:13:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734016387; cv=none; d=google.com; s=arc-20240605; b=dc8u1tvsznk1cVGJDVlnbIKc5KFJIj1O8eaZ0PuRzU7vB5TBHKSi5Te7DFiSxm+tsN NWLGmzPLb3P5uYy6rLxgQ1F0CK5uSpmRrR2aYOXS2eBV8APavEzoBV4T27cfBvf/LOPL uYBQt229rfBKVgrFuPMkWm5L/s1IE52CavCIVMgejn6kW5K4hKPWPZpehBGvk9K8KmZA PRbciW5g79UATm4Sq4Fpu0PMPCbKx4rB1Yz/fEyxmNWQqATEIgUDO9DrASIUdbO6AXjZ BpZokpYzd1a05QfF5WaLZd8Xg/DVKnHv7lsBmxAIU+/d2PkUoTvFf308C+Dsf8T1yTW3 TfJg== 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:dkim-signature:dkim-signature:dkim-signature; bh=ZyY8AA8dfYgg8xgEH5Ccjm5JgvsAKqt9DjcNW2EPL/g=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=LCIW9pcSmW3Oe/FoQb335OwxB72jUv4UtAzAUKWjRDhB5Goql/QicQi8ZThp4Tew8l QSaZ9Y5+W0HajyVVmB3PyZ8N6SzcBLFTJ41pRTK9q2XEiWPchYOCl/oWE1H2C84HkWTd dol5iVTbF8dG8+0sBJ1/9+QnBZOv8V8o5++G232gHrkyuQc/2FOmec5GedXx3IarkFmd eWdK/bGXEe+Z6mtMJWaouseM5tNyK2+wLeNpqYkkDN3KAhPHKgP6l//4KSU+LezjUsLW 1jpeAdRdJdY5tB9fO6wJ1AbaFIZQ0uUjB4bCWZJb93ZnudhPdlSNtNtD74lQoKorcqfc Ovaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1xpeuBMS; dkim=neutral (no key) header.i=@nongnu.org header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1xpeuBMS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51896715846si1498688e0c.289.2024.12.12.07.13.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Dec 2024 07:13:07 -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=@suse.de header.s=susede2_rsa header.b=1xpeuBMS; dkim=neutral (no key) header.i=@nongnu.org header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1xpeuBMS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLkpI-0003sW-Rb; Thu, 12 Dec 2024 10:10:04 -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 1tLkpG-0003pw-HL for qemu-devel@nongnu.org; Thu, 12 Dec 2024 10:10:02 -0500 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLkpE-0002z4-Je for qemu-devel@nongnu.org; Thu, 12 Dec 2024 10:10:02 -0500 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7A87221137; Thu, 12 Dec 2024 15:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1734016199; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZyY8AA8dfYgg8xgEH5Ccjm5JgvsAKqt9DjcNW2EPL/g=; b=1xpeuBMSJLec34SUTyRKGzJkvbIS9jIpcC5UknIIrt07MzmohNnrMed5ag37FSLqQwnwd6 7IF8TTdZjOvSgLwwu7vdQsqy9ESb6ihIYj6zfV82pRjk6J2aekDZ+DYoOC2sP5VUx9bl8B 8AK+0jkYhEQMXOtfmtlCzXk53niDMvc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1734016199; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZyY8AA8dfYgg8xgEH5Ccjm5JgvsAKqt9DjcNW2EPL/g=; b=UEM8APgO/nARzWzYZfM7CwyERLdt15YGly79N5sQUzS9zwNwC48L0NYfUQXVJ7XPUKkPe6 Eanb9lPmzGqV7hBQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1734016199; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZyY8AA8dfYgg8xgEH5Ccjm5JgvsAKqt9DjcNW2EPL/g=; b=1xpeuBMSJLec34SUTyRKGzJkvbIS9jIpcC5UknIIrt07MzmohNnrMed5ag37FSLqQwnwd6 7IF8TTdZjOvSgLwwu7vdQsqy9ESb6ihIYj6zfV82pRjk6J2aekDZ+DYoOC2sP5VUx9bl8B 8AK+0jkYhEQMXOtfmtlCzXk53niDMvc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1734016199; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZyY8AA8dfYgg8xgEH5Ccjm5JgvsAKqt9DjcNW2EPL/g=; b=UEM8APgO/nARzWzYZfM7CwyERLdt15YGly79N5sQUzS9zwNwC48L0NYfUQXVJ7XPUKkPe6 Eanb9lPmzGqV7hBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8663C13508; Thu, 12 Dec 2024 15:09:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id QAcPE8b8WmcTfQAAD6G6ig (envelope-from ); Thu, 12 Dec 2024 15:09:58 +0000 From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 04/22] tests/qtest: Use qtest_system_reset_nowait() where appropriate Date: Thu, 12 Dec 2024 12:09:31 -0300 Message-Id: <20241212150949.16806-5-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241212150949.16806-1-farosas@suse.de> References: <20241212150949.16806-1-farosas@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid,imap1.dmz-prg2.suse.org:helo,linaro.org:email]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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 From: Peter Maydell 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 Signed-off-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 c6f33153eb..127a7f9efe 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 7b67a4bbee..99f6fc2de1 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");