From patchwork Fri Aug 28 07:59:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 11742325 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 DF60D1751 for ; Fri, 28 Aug 2020 08:00:29 +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 C672620C56 for ; Fri, 28 Aug 2020 08:00:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C672620C56 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 83C446EB9F; Fri, 28 Aug 2020 08:00:27 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id B5C996EB84; Fri, 28 Aug 2020 08:00:25 +0000 (UTC) IronPort-SDR: acG4gpipCMVPZidp8oNzXO+zH4G/gBnFyPYVXWtXIDUUVjDw6albI5a+Llc08j/NdF3BHwyj59 VspTQgS4fktA== X-IronPort-AV: E=McAfee;i="6000,8403,9726"; a="144375150" X-IronPort-AV: E=Sophos;i="5.76,363,1592895600"; d="scan'208";a="144375150" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2020 01:00:24 -0700 IronPort-SDR: XsiJOhogS0grrULDCmnc9GC0iscovln1/5Yl4u8Zo4Z60vtUq51GqvTTGlYPBq4w4A92DESMgb OqbxPhrADcvA== X-IronPort-AV: E=Sophos;i="5.76,363,1592895600"; d="scan'208";a="444756016" Received: from jkrzyszt-desk.igk.intel.com ([172.22.244.18]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2020 01:00:14 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Date: Fri, 28 Aug 2020 09:59:20 +0200 Message-Id: <20200828075927.17061-15-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200828075927.17061-1-janusz.krzysztofik@linux.intel.com> References: <20200828075927.17061-1-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v5 14/21] tests/core_hotunplug: Process return values of sysfs operations 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" Return values of driver bind/unbind / device remove/recover sysfs operations are now ignored. Assert their correctness. v2: Add trailing newlines missing from igt_assert messages. Signed-off-by: Janusz Krzysztofik Reviewed-by: MichaƂ Winiarski --- tests/core_hotunplug.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c index 1fdbd9b4c..bbc9d30b5 100644 --- a/tests/core_hotunplug.c +++ b/tests/core_hotunplug.c @@ -123,7 +123,9 @@ static void driver_unbind(struct hotunplug *priv, const char *prefix, priv->failure = "Driver unbind failure!"; igt_set_timeout(timeout, "Driver unbind timeout!"); - igt_sysfs_set(priv->fd.sysfs_drv, "unbind", priv->dev_bus_addr); + igt_assert_f(igt_sysfs_set(priv->fd.sysfs_drv, "unbind", + priv->dev_bus_addr), + "Driver unbind failure!\n"); igt_reset_timeout(); } @@ -134,7 +136,9 @@ static void driver_bind(struct hotunplug *priv, int timeout) priv->failure = "Driver re-bind failure!"; igt_set_timeout(timeout, "Driver re-bind timeout!"); - igt_sysfs_set(priv->fd.sysfs_drv, "bind", priv->dev_bus_addr); + igt_assert_f(igt_sysfs_set(priv->fd.sysfs_drv, "bind", + priv->dev_bus_addr), + "Driver re-bind failure\n!"); igt_reset_timeout(); } @@ -152,7 +156,8 @@ static void device_unplug(struct hotunplug *priv, const char *prefix, priv->failure = "Device unplug failure!"; igt_set_timeout(timeout, "Device unplug timeout!"); - igt_sysfs_set(priv->fd.sysfs_dev, "remove", "1"); + igt_assert_f(igt_sysfs_set(priv->fd.sysfs_dev, "remove", "1"), + "Device unplug failure\n!"); igt_reset_timeout(); priv->fd.sysfs_dev = close_sysfs(priv->fd.sysfs_dev); @@ -166,7 +171,8 @@ static void bus_rescan(struct hotunplug *priv, int timeout) priv->failure = "Bus rescan failure!"; igt_set_timeout(timeout, "Bus rescan timeout!"); - igt_sysfs_set(priv->fd.sysfs_bus, "../rescan", "1"); + igt_assert_f(igt_sysfs_set(priv->fd.sysfs_bus, "../rescan", "1"), + "Bus rescan failure!\n"); igt_reset_timeout(); }