OSDN Git Service

tests: make filemonitor test more robust to event ordering
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 21 Aug 2019 15:14:27 +0000 (16:14 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 11 Sep 2019 09:29:27 +0000 (10:29 +0100)
commitbf9e0313c27d8e6ecd7f7de3d63e1cb25d8f6311
tree0b85369223872df173e2f3a9860e840363004db0
parent89ea03a7dc83ca36b670ba7f787802791fcb04b1
tests: make filemonitor test more robust to event ordering

The ordering of events that are emitted during the rmdir
test have changed with kernel >= 5.3. Semantically both
new & old orderings are correct, so we must be able to
cope with either.

To cope with this, when we see an unexpected event, we
push it back onto the queue and look and the subsequent
event to see if that matches instead.

Tested-by: Peter Xu <peterx@redhat.com>
Tested-by: Wei Yang <richardw.yang@linux.intel.com>
Tested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tests/test-util-filemonitor.c