diff mbox series

[i-g-t,v4,10/20] tests/core_hotunplug: Skip selectively on sysfs close errors

Message ID 20200821153807.18613-11-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. 21, 2020, 3:37 p.m. UTC
Since we no longer open a device DRM sysfs node, only a PCI one, driver
unbind operations are no longer affected by missed or unsuccessful
sysfs file close attempts.  Skip only affected subtests if that
happens.

v2: Rebase only.
v3: Refresh.

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

Patch

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 849a774ff..602a91cf8 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -109,7 +109,6 @@  static void prepare(struct hotunplug *priv)
 	igt_assert_fd(priv->fd.sysfs_bus);
 
 	priv->fd.sysfs_dev = close_sysfs(priv->fd.sysfs_dev);
-	igt_assert_eq(priv->fd.sysfs_dev, -1);
 }
 
 /* Unbind the driver from the device */
@@ -139,6 +138,8 @@  static void driver_bind(struct hotunplug *priv)
 /* Remove (virtually unplug) the device from its bus */
 static void device_unplug(struct hotunplug *priv, const char *prefix)
 {
+	igt_require(priv->fd.sysfs_dev == -1);
+
 	priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
 				    O_DIRECTORY);
 	igt_assert_fd(priv->fd.sysfs_dev);
@@ -194,7 +195,6 @@  static void post_healthcheck(struct hotunplug *priv)
 	igt_abort_on_f(priv->failure, "%s\n", priv->failure);
 
 	igt_require(priv->fd.drm == -1);
-	igt_require(priv->fd.sysfs_dev == -1);
 }
 
 static void set_filter_from_device(int fd)