From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752031AbdHBX6W (ORCPT ); Wed, 2 Aug 2017 19:58:22 -0400 Received: from resqmta-po-01v.sys.comcast.net ([96.114.154.160]:38318 "EHLO resqmta-po-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbdHBX6U (ORCPT ); Wed, 2 Aug 2017 19:58:20 -0400 Reply-To: shuah@kernel.org Subject: Re: [PATCH 1/5] test_kmod: make selftest executable To: "Luis R. Rodriguez" , Andrew Morton Cc: Dmitry Torokhov , Kees Cook , Jessica Yu , Rusty Russell , Michal Marek , Petr Mladek , Miroslav Benes , Josh Poimboeuf , "Eric W. Biederman" , Dan Carpenter , Colin Ian King , dcb314@hotmail.com, linux-kselftest@vger.kernel.org, "linux-kernel@vger.kernel.org" , Shuah Khan References: <20170802211450.27928-1-mcgrof@kernel.org> <20170802211450.27928-2-mcgrof@kernel.org> <20170802154349.a4221b87ebb083a83353c270@linux-foundation.org> From: Shuah Khan Message-ID: <6d98d850-4a6a-195e-ecd7-794678f94b31@kernel.org> Date: Wed, 2 Aug 2017 17:57:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfCwPEDckXN/4bFMBo31zlxiCRCbAmGrrha+csSJWZLK3Dh0nRCKgtEBdvL3ozojKVQQ1hv+s5UAHA3Uo6dvgmwvsGAsvA0+IWbyvbfP4r1J54sLxT8Gu SJFo8h2ccCdB+M5jooFVPJyJhooE3yfsJjo0IqaDwBVCA7/j7Hallu92n5SR9Hfu2gpQOPRJy3JicrmAmqVZFqKp+Aoz751JQPyEl1cRqBdFgt+YukL5ug5m c5agKJpn5I77r5Gak4rqhbTAfK2qs83NgfbtuCY1/c0IQvEF7U+zxxGxbB2esrPUfJ2ADt4Z7HrwrOwsy5jIFfO7j530vR0QY+brpUI1ebaenTZqWUnkVveu z0zYvQDqh8tBovYLcgHYJqlQgbi2geD97vlbK+KoRK+vqAfGc1gAMWZGs1XzsbZDeNC9LF3DFprcqhZrsE4TkIrHlrrA3omCaYrhO2uam8nai7q9p08cD85Z o91u6k+wZtGqGpe1NLxnn8ENwtZxwhv2L93dXobtYLXE0q2gExNCtebG1mOaVJCBzneHK+lTgCC2dVDpiSRvJ1wEWbZLisAGnXXqwYAzJ2iIXdhmsL8qsSXI rI6SFY8Cwr1eJb7lxIAGhlUPuL1s3Vxb4Gg5NHezy2sbyRCmYsgSxstdwkEWGb2FIOcCx/w1r4ttMQd7rhlNYEcV2wcKHIzpy5p+lWoFzyODOg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Luis, On 08/02/2017 04:55 PM, Luis R. Rodriguez wrote: > On Wed, Aug 2, 2017 at 3:43 PM, Andrew Morton wrote: >> On Wed, 2 Aug 2017 14:14:46 -0700 "Luis R. Rodriguez" 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 >>> --- >>> 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