[LTP] [PATCH v3 0/2] mount03: Convert to new API

Petr Vorel pvorel@suse.cz
Tue Aug 16 11:06:49 CEST 2022


> 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"). 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