From patchwork Fri Aug 7 09:19:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11705283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B4FB1392 for ; Fri, 7 Aug 2020 09:22:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 65D332177B for ; Fri, 7 Aug 2020 09:22:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65D332177B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 806586E9A0; Fri, 7 Aug 2020 09:22:05 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71B2C6E9A0; Fri, 7 Aug 2020 09:22:03 +0000 (UTC) IronPort-SDR: nGM5EgguUjLyKBa10x6mNqJZwa37bkZ4DpULginHVqakiCT7Jq0m8bt/EHboMMKGjhbahVdEz/ SBZLR+MNqrzg== X-IronPort-AV: E=McAfee;i="6000,8403,9705"; a="171106931" X-IronPort-AV: E=Sophos;i="5.75,445,1589266800"; d="scan'208";a="171106931" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2020 02:22:03 -0700 IronPort-SDR: T9C992AVEukgJJe1rnsSDonUxz67XWSUBtvsljj5Z9DA2IexBFn9rUXCfuA3nwj0DUq5WMs7TQ tYpagpI7k8eQ== X-IronPort-AV: E=Sophos;i="5.75,445,1589266800"; d="scan'208";a="333492156" Received: from jkrzyszt-desk.igk.intel.com ([172.22.244.18]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2020 02:22:01 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Date: Fri, 7 Aug 2020 11:19:58 +0200 Message-Id: <20200807092002.32350-13-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200807092002.32350-1-janusz.krzysztofik@linux.intel.com> References: <20200807092002.32350-1-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v2 12/16] tests/core_hotunplug: Fail subtests on device close errors X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, =?utf-8?q?Micha=C5=82_Winiarski?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Since health checks are now run from follow-up fixture sections, it is safe to fail subtests without the need to abort the test execution. Do that on device close errors instead of emitting warnings. v2: Rebase on current upstream master. Signed-off-by: Janusz Krzysztofik Reviewed-by: MichaƂ Winiarski --- tests/core_hotunplug.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c index 313c44784..a4902eba2 100644 --- a/tests/core_hotunplug.c +++ b/tests/core_hotunplug.c @@ -126,8 +126,8 @@ static void device_unplug(struct hotunplug *priv, const char *prefix) igt_reset_timeout(); priv->fd.sysfs_dev = local_close(priv->fd.sysfs_dev); - igt_warn_on_f(priv->fd.sysfs_dev != -1, - "Device sysfs node close failed\n"); + igt_assert_f(priv->fd.sysfs_dev == -1, + "Device sysfs node close failed\n"); } /* Re-discover the device by rescanning its bus */ @@ -249,7 +249,7 @@ static void hotunbind_lateclose(struct hotunplug *priv) igt_debug("late closing the unbound device instance\n"); priv->fd.drm = local_close(priv->fd.drm); - igt_warn_on_f(priv->fd.drm != -1, "Device close failed\n"); + igt_assert_f(priv->fd.drm == -1, "Device close failed\n"); } static void hotunplug_lateclose(struct hotunplug *priv) @@ -266,7 +266,7 @@ static void hotunplug_lateclose(struct hotunplug *priv) igt_debug("late closing the removed device instance\n"); priv->fd.drm = local_close(priv->fd.drm); - igt_warn_on_f(priv->fd.drm != -1, "Device close failed\n"); + igt_assert_f(priv->fd.drm == -1, "Device close failed\n"); } /* Main */