summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@linux.intel.com>2017-07-18 18:16:27 +0300
committerLyude <lyude@redhat.com>2017-07-18 16:16:12 -0400
commitfb1ddc47003ad6a683db79beeb81b6cbab1feb7c (patch)
tree76fb37b85fa9e1fcb6a9758e2510546d5bee92cc /tests
parenta9443945380f34b47433c2be1b163504018b6f3f (diff)
tests/chamelium: Catch and flush hotplug uevents after each plug
This adds calls to igt_hotplug_detected and igt_flush_hotplugs to catch and flush hotplugs from connector unplug (due to chamelium reset) and plug. These need to be intercepted so that they are not delayed and issued after resume, providing a false positive for the test result. In addition, the final hotplug uevent flush is brought closer to the suspend call, to decrease the likeliness of false positive. However, false positives still do happen, because it is not possible to make sure that the uevent caused by each connector's state change was caught instead of being delayed and issued at resume time. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/chamelium.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/chamelium.c b/tests/chamelium.c
index 8af33aaa..0528ffb3 100644
--- a/tests/chamelium.c
+++ b/tests/chamelium.c
@@ -340,12 +340,16 @@ test_suspend_resume_edid_change(data_t *data, struct chamelium_port *port,
reset_state(data, port);
+ /* Catch the event and flush all remaining ones. */
+ igt_assert(igt_hotplug_detected(mon, HOTPLUG_TIMEOUT));
+ igt_flush_hotplugs(mon);
+
/* First plug in the port */
chamelium_port_set_edid(data->chamelium, port, edid_id);
chamelium_plug(data->chamelium, port);
- wait_for_connector(data, port, DRM_MODE_CONNECTED);
+ igt_assert(igt_hotplug_detected(mon, HOTPLUG_TIMEOUT));
- igt_flush_hotplugs(mon);
+ wait_for_connector(data, port, DRM_MODE_CONNECTED);
/*
* Change the edid before we suspend. On resume, the machine should
@@ -355,6 +359,8 @@ test_suspend_resume_edid_change(data_t *data, struct chamelium_port *port,
get_connectors_link_status_failed(data, link_status_failed[0]);
+ igt_flush_hotplugs(mon);
+
igt_system_suspend_autoresume(state, test);
igt_assert(igt_hotplug_detected(mon, HOTPLUG_TIMEOUT));