diff mbox series

[i-g-t,v5,12/21] tests/core_hotunplug: Fail subtests on device close errors

Message ID 20200828075927.17061-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 Aug. 28, 2020, 7:59 a.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 just emitting warnings.

v2: Rebase only.
v3: Refresh.
v4: Refresh.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
---
 tests/core_hotunplug.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index b72361900..dd1dc1fe0 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -154,6 +154,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 */
@@ -276,6 +277,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);
 
 	healthcheck(priv);
 }
@@ -291,6 +293,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);
 
 	healthcheck(priv);
 }