From patchwork Thu Aug 20 14:52:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11726403 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 BB6DB739 for ; Thu, 20 Aug 2020 14:53:15 +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 A458D2075E for ; Thu, 20 Aug 2020 14:53:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A458D2075E 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 396CD6E953; Thu, 20 Aug 2020 14:53:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 24BC76E944; Thu, 20 Aug 2020 14:53:12 +0000 (UTC) IronPort-SDR: cIphLg+s463SZnK7rdVX4eT+Ym+dZ7YnEAO2nHWkrZ+7BKtcytco/deDTvmAhEIR9B3vLrW1Vl ifAh0Mv8gDlQ== X-IronPort-AV: E=McAfee;i="6000,8403,9718"; a="240136255" X-IronPort-AV: E=Sophos;i="5.76,333,1592895600"; d="scan'208";a="240136255" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2020 07:53:11 -0700 IronPort-SDR: GLwMoLhm8NQ/l6P9HQ5u/HA2mw7ksomdvyf8ERgjbCmLKIFHVuW09sCAI5Ltm3ke4C7M3nHGz9 OmkMn4/1Blbw== X-IronPort-AV: E=Sophos;i="5.76,333,1592895600"; d="scan'208";a="472679759" Received: from jkrzyszt-desk.igk.intel.com ([172.22.244.18]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2020 07:53:09 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Date: Thu, 20 Aug 2020 16:52:08 +0200 Message-Id: <20200820145215.13238-13-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200820145215.13238-1-janusz.krzysztofik@linux.intel.com> References: <20200820145215.13238-1-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v3 12/19] 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: =?utf-8?q?Micha=C5=82_Winiarski?= , intel-gfx@lists.freedesktop.org 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 just emitting warnings. v3: Refresh. Signed-off-by: Janusz Krzysztofik Reviewed-by: MichaƂ Winiarski --- tests/core_hotunplug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c index 145593683..e048f3a15 100644 --- a/tests/core_hotunplug.c +++ b/tests/core_hotunplug.c @@ -153,6 +153,7 @@ static void device_unplug(struct hotunplug *priv, const char *prefix) igt_reset_timeout(); priv->fd.sysfs_dev = close_sysfs(priv->fd.sysfs_dev); + igt_assert_eq(priv->fd.sysfs_dev, -1); } /* Re-discover the device by rescanning its bus */ @@ -270,6 +271,7 @@ static void hotunbind_lateclose(struct hotunplug *priv) igt_debug("late closing the unbound device instance\n"); priv->fd.drm = close_device(priv->fd.drm); + igt_assert_eq(priv->fd.drm, -1); } static void hotunplug_lateclose(struct hotunplug *priv) @@ -282,6 +284,7 @@ static void hotunplug_lateclose(struct hotunplug *priv) igt_debug("late closing the removed device instance\n"); priv->fd.drm = close_device(priv->fd.drm); + igt_assert_eq(priv->fd.drm, -1); } /* Main */