summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>2020-07-15 15:08:46 +0200
committerJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>2020-09-14 20:48:27 +0200
commitc3c31f74f02fefd7ac4a43b4985c44963b6f2426 (patch)
tree85e14433a4ab3c778dc4f489349bb858951c321e
parentaf87eec65742652a38feea8c69f000d6e3be41d8 (diff)
tests/core_hotunplug: Process return values of sysfs operations
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 <janusz.krzysztofik@linux.intel.com> Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
-rw-r--r--tests/core_hotunplug.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 6112704f..d5b8c5ed 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -127,7 +127,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();
}
@@ -138,7 +140,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();
}
@@ -156,7 +160,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);
@@ -170,7 +175,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();
}