[ptest-runner,2/4] utils.c: Fix exit status of a child
Submitted by Aníbal Limón on March 23, 2021, 2:10 a.m.
|
Patch ID: 179394
Details
Commit Message
old mode 100644
new mode 100755
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exit 10
@@ -234,7 +234,7 @@ END_TEST
static void
search_for_fail(const int rp, FILE *fp_stdout)
{
- const char *fail_str = "ERROR: Exit status is";
+ const char *fail_str = "ERROR: Exit status is 10";
char line_buf[PRINT_PTEST_BUF_SIZE];
int found_fail = 0;
char *line = NULL;
@@ -352,6 +352,9 @@ wait_child(pid_t pid, int timeout, int *fds, FILE **fps, int *timeouted)
clock_gettime(clock, &sentinel);
}
+
+ if (WIFEXITED(status))
+ status = WEXITSTATUS(status);
}
fflush(fps[0]);
Modify testcase to validate the actual exit status. [YOCTO #14217] Signed-off-by: Aníbal Limón <anibal.limon@linaro.org> --- tests/data/fail/ptest/run-ptest | 3 +++ tests/utils.c | 2 +- utils.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 tests/data/fail/ptest/run-ptest