From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754160AbdFWQLx (ORCPT ); Fri, 23 Jun 2017 12:11:53 -0400 Received: from resqmta-po-07v.sys.comcast.net ([96.114.154.166]:59852 "EHLO resqmta-po-07v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753611AbdFWQLv (ORCPT ); Fri, 23 Jun 2017 12:11:51 -0400 Reply-To: shuah@kernel.org Subject: Re: [PATCH v3] selftests: lib: Skip tests on missing test modules To: Sumit Semwal , linux-kselftest@vger.kernel.org Cc: keescook@chromium.org, decot@googlers.com, linux-kernel@vger.kernel.org, Shuah Khan References: <1497934098-15995-1-git-send-email-sumit.semwal@linaro.org> From: Shuah Khan Message-ID: Date: Fri, 23 Jun 2017 10:11:48 -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: <1497934098-15995-1-git-send-email-sumit.semwal@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfPoHiCQ4aHjDpjgFMf7vUGLYW+jayK7oihINX3TK+cARukKgBGDCTOSEdI6ALtgcEbjIb3u0VeNfqRCX8wruDzeKvUCwAuEpXBiVasQ2bL7bUUE2i1dq 4H10XtilgtL2LoonOIG6b1IYQ24ZoklE5Fo5LlbYA1alojYKIJiuQMAXcErh69yqlKxVomvs4J4cHPWnIXMo1jEQgU/RtTQNHNZqcmf5QUqpDjbrmIWpKzTy G08Fv7iuUx+PxYwBS5zGZpb6DcQg17Dnzfa/bXoUa6VltzyvbJN5NxFwOL8SG5WGbBFHxY4egEKhl9ooE2rjZIxjqNPVTJWSCGjHvMtuCpZkAclqklG5n9F5 QHXUavYF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sumit, On 06/19/2017 10:48 PM, Sumit Semwal wrote: > With older kernels, printf.sh and bitmap.sh fail because they can't find > the respective test modules they are looking for. > > Use modprobe dry run to check for missing test_XXX module. Error out with > the same error code as prime_numbers.sh. > --------------------------------------------------------------------------- > v3: As pointed out by Kees, modules can be in-built too, so use 'modprobe > -q -n' to check presence of the module, instead of 'find ..'. > v2: Per Shuah's review, search for the module rather than do modprobe. --------------------------------------------------------------------------- Please note that the patch version details don't belong in the commit log. I edited it before applying to linux-kselftest next. Please make sure to add such information in the right place in future patches. > > Signed-off-by: Sumit Semwal Applied to linux-ksefltest next for 4.13-rc1 thanks, -- Shuah > --- > tools/testing/selftests/lib/bitmap.sh | 4 ++++ > tools/testing/selftests/lib/printf.sh | 4 ++++ > 2 files changed, 8 insertions(+) > > diff --git a/tools/testing/selftests/lib/bitmap.sh b/tools/testing/selftests/lib/bitmap.sh > index 2da187b6ddad..b073c22a3435 100755 > --- a/tools/testing/selftests/lib/bitmap.sh > +++ b/tools/testing/selftests/lib/bitmap.sh > @@ -1,5 +1,9 @@ > #!/bin/sh > # Runs bitmap infrastructure tests using test_bitmap kernel module > +if ! /sbin/modprobe -q -n test_bitmap; then > + echo "bitmap: [SKIP]" > + exit 77 > +fi > > if /sbin/modprobe -q test_bitmap; then > /sbin/modprobe -q -r test_bitmap > diff --git a/tools/testing/selftests/lib/printf.sh b/tools/testing/selftests/lib/printf.sh > index 4fdc70fe6980..cbf3b124bd94 100755 > --- a/tools/testing/selftests/lib/printf.sh > +++ b/tools/testing/selftests/lib/printf.sh > @@ -1,5 +1,9 @@ > #!/bin/sh > # Runs printf infrastructure using test_printf kernel module > +if ! /sbin/modprobe -q -n test_printf; then > + echo "printf: [SKIP]" > + exit 77 > +fi > > if /sbin/modprobe -q test_printf; then > /sbin/modprobe -q -r test_printf >