Tests: Fix: `wait_on_file()` returns too early
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 11 Feb 2020 02:46:34 +0000 (21:46 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 11 Feb 2020 20:12:55 +0000 (15:12 -0500)
commitf0784451e9e671a1acd6eac0dc0c750a7d83b4eb
tree6c30650a08e13b0d6744fa5390814e78f70c9971
parent65e663fa0c098f8f8ddd0f0f3d91dbd25d1daa4d
Tests: Fix: `wait_on_file()` returns too early

Issue
=====
With the current implementation, when calling the `wait_on_file()`
function with the `file_exist` parameter set to false the function will
return even if the target file exists.

In a scenario where we enter the loop and the targer file exist, the
first call to `stat()` will return 0 and will not enter any of the `if`
and break from the loop directly.

Solution
========
If the file exists, only break from the loop if it's the desired exit
condition.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Ia3e9c41a2a515815d3ff931d8f7c1c14a52b31ae
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/notification/notification.c
This page took 0.030154 seconds and 4 git commands to generate.