[LTP] [PATCH v2 2/2] syscalls/faccessat202: Add new testcase

Cyril Hrubis chrubis@suse.cz
Wed Aug 23 08:51:38 CEST 2023


Hi!
> 
> Thank you for your suggestion, but i think " SAFE_SETEUID(ltpuser->pw_uid)"
> 
> should be changed to "SAFE_SETEUID(0)" to change EUID back.

Right, that was copy&paste typo.

> >> +			TST_EXP_FAIL(faccessat2(*tc->fd, *tc->filename,
> >> +				     tc->mode, tc->flags), tc->exp_errno);
> >> +		}
> >> +
> >> +		tst_reap_children();
> >> +	} else {
> >> +		TST_EXP_FAIL(faccessat2(*tc->fd, *tc->filename,
> >> +			     tc->mode, tc->flags), tc->exp_errno);
> > Can we get a better message here? As it is it prints
> > "faccessat2(*tc->fd, *tc->filename, tc->mode, tc->flags) ..."
> >
> > Which is a bit ugly.
> 
> Because i used tst_get_bad_addr to test a bad pathname point ,
> 
> so if i output relevant information, the test will be killed by SIGSEGV.
> 
> In the v3 version, I will change it to this:
> 
> "TST_EXP_FAIL(faccessat2(*tc->fd, *tc->filename, tc->mode, tc->flags),
> 
>                          tc->exp_errno, "faccessat2()")"
> 
> How about this?

Either that or we can add short description to the test structure and
pass TST_EXP_FAIL(..., "faccessat2() %s", tc->desc)

At least some cases would be better with description, for instance for
the euid test the description should be something as
"with AT_EACCESS and unpriviledged EUID"

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list