[LTP] [PATCH v3 0/2] mount03: Convert to new API
xuyang2018.jy@fujitsu.com
xuyang2018.jy@fujitsu.com
Tue Aug 16 11:57:11 CEST 2022
Hi >> Hi!
>>> So I think you should use SAFE_SETREUID(nobody_uid, nobody_uid);
>>> and then use code as below:
>
>>> if (WIFEXITED(status)) {
>>> switch (WEXITSTATUS(status)) {
>>> case EXIT_FAILURE:
>>> tst_res(TPASS, "%s passed", TESTBIN);
>>> return;
>>> case EXIT_SUCCESS:
>>> tst_res(TFAIL, "%s failed", TESTBIN);
>>> return;
>>> default:
>>> case TBROK:
>>> break;
>>> }
>>> }
>
>> Can we please stop propagating test success/failure via the exit value?
>
>> The problem have been solved years ago by the new test library, the
>> child just need to call tst_reinit() and tst_res() will work directly
>> from the child as well. See execlp01.c for example how that works.
>
> Ah, thanks! I should have read C API docs once more (it's in "1.8 Doing the test
> in the child process").
OK. It is time for me to read C api doc again.
Best Regards
Yang Xu
At this point there are so many changes => I'll post v4
> and cleanup the child as well.
>
> Kind regards,
> Petr
More information about the ltp
mailing list