public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <shuah@kernel.org>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: linux-kselftest@vger.kernel.org, akpm@linux-foundation.org,
	keescook@chromium.org, pmladek@suse.com,
	dan.carpenter@oracle.com, colin.king@canonical.com,
	dcb314@hotmail.com, linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	Shuah Khan <shuah@kernel.org>,
	shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH v2] selftests: warn if failure is due to lack of executable bit
Date: Wed, 9 Aug 2017 14:47:23 -0600	[thread overview]
Message-ID: <1bf53e2c-e899-2da9-aad7-7b803e22a4fa@kernel.org> (raw)
In-Reply-To: <20170808175028.GP27873@wotan.suse.de>

On 08/08/2017 11:50 AM, Luis R. Rodriguez wrote:
> On Thu, Aug 03, 2017 at 01:24:36PM -0700, Luis R. Rodriguez wrote:
>> Executing selftests is fragile as if someone forgot to set a secript
>> as executable the test will fail, and you won't know for sure if the
>> failure was caused by the lack of proper permissions or something else.
>>
>> Setting scripts as executable is required, this also enable folks to
>> execute selftests as independent units.
>>
>> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
>> ---
>>  tools/testing/selftests/lib.mk | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
>> index 959273c3a52e..e71f8e4633b1 100644
>> --- a/tools/testing/selftests/lib.mk
>> +++ b/tools/testing/selftests/lib.mk
>> @@ -14,7 +14,12 @@ all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
>>  define RUN_TESTS
>>  	@for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \
>>  		BASENAME_TEST=`basename $$TEST`;	\
>> -		cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests:  $$BASENAME_TEST [FAIL]"; cd -;\
>> +		if [ ! -x $$BASENAME_TEST ]; then	\
>> +			echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\
>> +			echo "selftests: $$BASENAME_TEST [FAIL]"; \
>> +		else					\
>> +			cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests:  $$BASENAME_TEST [FAIL]"; cd -;\
>> +		fi;					\
>>  	done;
>>  endef
>>  
> 
> *poke*
> 
>   Luis
> 
> 

Applied to linux-kselftest next for 4.14-rc1.

thanks,
-- Shuah

      reply	other threads:[~2017-08-09 20:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 20:24 [PATCH v2] selftests: warn if failure is due to lack of executable bit Luis R. Rodriguez
2017-08-08 17:50 ` Luis R. Rodriguez
2017-08-09 20:47   ` Shuah Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bf53e2c-e899-2da9-aad7-7b803e22a4fa@kernel.org \
    --to=shuah@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dcb314@hotmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=pmladek@suse.com \
    --cc=shuahkh@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox