[LTP] Test library API changes

Cyril Hrubis chrubis@suse.cz
Wed Feb 10 11:56:42 CET 2016


Hi!
> I had a look and have some comments/questions?
> 
> 1. Why is tcnt not ARRAY_SIZE(tcases)?
>    https://github.com/metan-ucw/ltp/blob/master/testcases/kernel/syscalls/creat/creat04.c#L83

My mistake. Will fix that.

> static struct tst_test test = {
> 	.tid = "creat04",
> 	.tcnt = 2,
> 
> 2. It would be nice if we could pass any parameters to child.
> Atm. child func accepts only int and only way to share something else
> appears to be passing it via global variables, which may become
> confusing for bigger tests.

I was thinking about passing a pointer just as pthread_create() does as
well. Let's go this way instead.

> 3. Sum based on tcnt still worries me because number of assertions per
> test may vary:
>    if (sum != tcnt * acnt * iterations)
> 	tst_brk(TBROK, "Number passes/fails/skipps does not match number of tests");
> 
> What if we verified instead, that after every testcase, at least one of
> pass/fail/skip increased?

That is a good idea. I will rework it this way.

> 4. suggestion: improved safeguard for cleanup
> Record pid of main process at start and call cleanup only if current
> pid is recorded pid. This doesn't make it depend on using specific
> API call to run child process.

There is another problem that has to be solved if we want to go this
way. We have to pass the results from the child to the parent and since
it's more complicated than single PASS/FAIL/SKIP/BROK now, we have to
pass it somehow. So we would have to create a communication channel
anyway. Which means either opening one by default before the test starts
or doing that in tst_fork() wrapper.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the Ltp mailing list