From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbdHHJuJ convert rfc822-to-8bit (ORCPT ); Tue, 8 Aug 2017 05:50:09 -0400 Received: from ozlabs.org ([103.22.144.67]:40827 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbdHHJuG (ORCPT ); Tue, 8 Aug 2017 05:50:06 -0400 From: Michael Ellerman To: Andrew Morton , "Luis R. Rodriguez" Cc: dmitry.torokhov@gmail.com, keescook@chromium.org, jeyu@redhat.com, rusty@rustcorp.com.au, mmarek@suse.com, pmladek@suse.com, mbenes@suse.cz, jpoimboe@redhat.com, ebiederm@xmission.com, shuah@kernel.org, dan.carpenter@oracle.com, colin.king@canonical.com, dcb314@hotmail.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] test_kmod: make selftest executable In-Reply-To: <20170802154349.a4221b87ebb083a83353c270@linux-foundation.org> References: <20170802211450.27928-1-mcgrof@kernel.org> <20170802211450.27928-2-mcgrof@kernel.org> <20170802154349.a4221b87ebb083a83353c270@linux-foundation.org> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Tue, 08 Aug 2017 19:50:04 +1000 Message-ID: <87efsmo0c3.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew Morton writes: > On Wed, 2 Aug 2017 14:14:46 -0700 "Luis R. Rodriguez" wrote: > >> We had just forgotten to do this. >> >> 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. > > 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 Most (many?) of the tests aren't shell scripts, so that doesn't work, eg: $ make -C tools/testing/selftests/ TARGETS=kcmp run_tests ... make[1]: Entering directory '/home/michael/linus/tools/testing/selftests/kcmp' ./kcmp_test: 1: ./kcmp_test: ELF...0.@�.@@..@@.@.�.�..........����.��.�.�...�.�..�.�.�.....DD.Q�td.R�td.����.��../lib64/ld64.so.2..GNU...GNUC{: not found ./kcmp_test: 13: ./kcmp_test: Syntax error: Unterminated quoted string selftests: kcmp_test [FAIL] Also some of the ones which are shell scripts require bash, and /bin/sh may not be bash, eg: $ make -C tools/testing/selftests/ TARGETS=cpu-hotplug run_tests ... make[1]: Entering directory '/home/michael/linus/tools/testing/selftests/cpu-hotplug' ./cpu-on-off-test.sh: 9: [: !=: unexpected operator cheers