[PATCH i-g-t v3 20/20] tests/core_hotunplug: Skip selectively on sysfs close errors
Janusz Krzysztofik
janusz.krzysztofik at linux.intel.com
Wed Aug 19 12:08:33 UTC 2020
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: Rebase only.
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski at intel.com>
---
tests/core_hotunplug.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 50ff6e725..126a80ef5 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -120,7 +120,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 */
@@ -161,6 +160,9 @@ static void driver_bind(struct hotunplug *priv, int timeout)
static void device_unplug(struct hotunplug *priv, const char *prefix,
int timeout)
{
+ igt_require_f(priv->fd.sysfs_dev == -1,
+ "Device sysfs node not closed properly\n");
+
priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
O_DIRECTORY);
igt_assert_fd(priv->fd.sysfs_dev);
@@ -322,7 +324,6 @@ static void post_healthcheck(struct hotunplug *priv)
cleanup(priv);
igt_require(priv->fd.drm == -1);
- igt_require(priv->fd.sysfs_dev == -1);
}
static void set_filter_from_device(int fd)
--
2.21.1
More information about the Intel-gfx-trybot
mailing list