[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6d98d850-4a6a-195e-ecd7-794678f94b31@kernel.org>
Date: Wed, 2 Aug 2017 17:57:52 -0600
From: Shuah Khan <shuah@...nel.org>
To: "Luis R. Rodriguez" <mcgrof@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Kees Cook <keescook@...omium.org>,
Jessica Yu <jeyu@...hat.com>,
Rusty Russell <rusty@...tcorp.com.au>,
Michal Marek <mmarek@...e.com>, Petr Mladek <pmladek@...e.com>,
Miroslav Benes <mbenes@...e.cz>,
Josh Poimboeuf <jpoimboe@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Colin Ian King <colin.king@...onical.com>,
dcb314@...mail.com, linux-kselftest@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH 1/5] test_kmod: make selftest executable
Hi Luis,
On 08/02/2017 04:55 PM, Luis R. Rodriguez wrote:
> On Wed, Aug 2, 2017 at 3:43 PM, Andrew Morton <akpm@...ux-foundation.org> wrote:
>> On Wed, 2 Aug 2017 14:14:46 -0700 "Luis R. Rodriguez" <mcgrof@...nel.org> wrote:
>>
>>> We had just forgotten to do this.
Could you please include the real reason you need this change.
My guess is, you are seeing this failure.
make -C kmod/ run_tests
make: Entering directory '/lkml/linux_4.13/tools/testing/selftests/kmod'
/bin/sh: 1: ./kmod.sh: Permission denied
selftests: kmod.sh [FAIL]
>>>
>>> Fixes: 39258f448d71 ("kmod: add test driver to stress test the module loader")
>>> Signed-off-by: Luis R. Rodriguez <mcgrof@...nel.org>
>>> ---
>>> tools/testing/selftests/kmod/kmod.sh | 0
>>> 1 file changed, 0 insertions(+), 0 deletions(-)
>>> mode change 100644 => 100755 tools/testing/selftests/kmod/kmod.sh
>>>
>>> diff --git a/tools/testing/selftests/kmod/kmod.sh b/tools/testing/selftests/kmod/kmod.sh
>>> old mode 100644
>>> new mode 100755
>>
>> This is pretty fragile - I'm not sure that patch/diff are capable of
>> communicating a bare chmod. If someone does a "patch -p1 < patch-4.14"
>> or whatever, this change is likely to get lost.
>
> True if using regular diff, if using git, it will catch it though.
>
>> It's more robust to not care about the x bit at all. Something like
>> this?
>>
>> --- a/tools/testing/selftests/lib.mk~a
>> +++ a/tools/testing/selftests/lib.mk
>> @@ -14,7 +14,7 @@ all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_
>> 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 -;\
>> + cd `dirname $$TEST`; (/bin/sh ./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\
>> done;
>> endef
>>
>>
>> (probably incomplete, should presumably use $SHELL or something)
>
> Probably a good idea indeed, Shuah ?
I think this is a good idea. At the moment any script without +x fails.
It would be good change to make in the generic layer.
>
> Although I'll note I also do like to run selftest scripts on my own
> too, so the chmod is still desirable.
You will have to run it under bash kmod/kmod.sh - It can be painful.
This is one of the reasons a lot of the scripts are executable.
I am curious how you didn't catch this before.
I can take this one. Please fix the change log though. That will
explain why this change is made.
thanks,
-- Shuah
Powered by blists - more mailing lists