[LTP] Test library API changes
Jan Stancek
jstancek@redhat.com
Wed Feb 10 11:42:58 CET 2016
----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 9 February, 2016 6:46:18 PM
> Subject: Re: [LTP] Test library API changes
>
> Hi!
> > And I was writing faster than thinking. We will need another one where
> > starting and reaping child is split between two functions. I will work
> > on that tomorrow.
>
> And I've split the function into two now:
>
> https://github.com/metan-ucw/ltp/blob/master/include/tst_test.h#L50
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
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.
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?
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.
Regards,
Jan
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
More information about the Ltp
mailing list