diff mbox series

[RFC,PATH,i-g-t,12/15] tests/core_hotunplug: Fail subtests on device close errors

Message ID 20200720121908.28124-13-janusz.krzysztofik@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series tests/core_hotunplug: Fixes and enhancements | expand

Commit Message

Janusz Krzysztofik July 20, 2020, 12:19 p.m. UTC
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.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 tests/core_hotunplug.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 082bcc306..ec2d891e6 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 */
@@ -248,7 +248,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)
@@ -265,7 +265,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 */