Re: [PATCH RESEND] t/perf: do not run tests in user's $SHELL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Altmanninger <aclopte@xxxxxxxxx> writes:

> On Mon, Dec 20, 2021 at 12:56:58PM +0100, Ævar Arnfjörð Bjarmason wrote:
>> 
>> On Mon, Dec 20 2021, René Scharfe wrote:
>> 
>> > From: Johannes Altmanninger <aclopte@xxxxxxxxx>
>> >
>> > The environment variable $SHELL is usually set to the user's
>> > interactive shell. We never use that shell for build and test scripts
>> > because it might not be a POSIX shell.
>> >
>> > Perf tests are run inside $SHELL via a wrapper defined in
>> > t/perf/perf-lib.sh. Use $TEST_SHELL_PATH like elsewhere.
>> >
>> > Signed-off-by: Johannes Altmanninger <aclopte@xxxxxxxxx>
>> > Acked-by: Jeff King <peff@xxxxxxxx>
>> > ---
>> > Original submission:
>> > https://lore.kernel.org/git/20211007184716.1187677-1-aclopte@xxxxxxxxx/
>> 
>> This LGTM & I think it could be picked up as-is.
>> 
>> Just a nit in case af a re-roll. I think it would help to summarize the
>> history a bit per
>> https://lore.kernel.org/git/YV+1%2F0b5bN3o6qRG@xxxxxxxxxxxxxxxxxxxxxxx/. I.e. something
>> like:
>>     
>>     In 342e9ef2d9e (Introduce a performance testing framework, 2012-02-17)
>>     when t/perf was introduced the TEST_SHELL_PATH was not part of
>>     GIT-BUILD-OPTIONS.
>
> (but SHELL_PATH was, which is what we should have used back then)
>
>>     That was added later in 3f824e91c84 (t/Makefile:
>>     introduce TEST_SHELL_PATH, 2017-12-08). We will always have that
>>     available in perf-lib.sh since test-lib.sh will load it before this code
>>     is executed.
>
> yes that's a good thing to point out

Care to redo the patch in a final form, then?

Thanks.

>
>> 
>> >  t/perf/perf-lib.sh | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
>> > index 780a7402d5..407252bac7 100644
>> > --- a/t/perf/perf-lib.sh
>> > +++ b/t/perf/perf-lib.sh
>> > @@ -161,7 +161,7 @@ test_run_perf_ () {
>> >  	test_cleanup=:
>> >  	test_export_="test_cleanup"
>> >  	export test_cleanup test_export_
>> > -	"$GTIME" -f "%E %U %S" -o test_time.$i "$SHELL" -c '
>> > +	"$GTIME" -f "%E %U %S" -o test_time.$i "$TEST_SHELL_PATH" -c '
>> >  . '"$TEST_DIRECTORY"/test-lib-functions.sh'
>> >  test_export () {
>> >  	test_export_="$test_export_ $*"
>> 




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux