Hi!
> Currently, additional test for acct is done in cleanup.
> This was not originally intended because TCONF case will also invoke cleanup
> function to finish and it will finally goes to TBROK, not TCONF.
> This patch removes the additional acct execution in cleanup.
> 
> Signed-off-by: Honggyu Kim <[email protected]>
> ---
>  testcases/kernel/syscalls/acct/acct01.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/acct/acct01.c 
> b/testcases/kernel/syscalls/acct/acct01.c
> index 0fe973b..53376ae 100644
> --- a/testcases/kernel/syscalls/acct/acct01.c
> +++ b/testcases/kernel/syscalls/acct/acct01.c
> @@ -165,8 +165,5 @@ static void cleanup(void)
>  {
>       TEST_CLEANUP;
>  
> -     if (acct(NULL) == -1)
> -             tst_resm(TBROK | TERRNO, "acct(NULL) failed");
> -
>       tst_rmdir();
>  }

This does not seem to be right. The acct(NULL) should turn off the
process accounting so this is not a test for acct() but rather an
attempt to restore the system to the previous state.

So the correct solution would be to call acct(NULL) first in the setup
and if that failed with ENOSYS, exit the test with TCONF without calling
the cleanup (if we do this check before the tst_tmpdir() we don't have
to do any cleanup). Then we can also remove all checks for ENOSYS from
the rest of the code.

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to