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

Cyril Hrubis chrubis@suse.cz
Tue Aug 16 11:00:10 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.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list