From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752862AbdFPPKI (ORCPT ); Fri, 16 Jun 2017 11:10:08 -0400 Received: from resqmta-po-01v.sys.comcast.net ([96.114.154.160]:57966 "EHLO resqmta-po-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbdFPPKG (ORCPT ); Fri, 16 Jun 2017 11:10:06 -0400 Reply-To: shuah@kernel.org Subject: Re: [PATCH] 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: <1497590965-12310-1-git-send-email-sumit.semwal@linaro.org> From: Shuah Khan Message-ID: <8c406bd0-bba9-59ec-2240-43d849c36062@kernel.org> Date: Fri, 16 Jun 2017 09:10:04 -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: <1497590965-12310-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: MS4wfAhoyp5+gOQZizL2Ve6x6nv7iHMF+uM7WDcMHmI7X3xyziswBA/3xJ0FlBGAdePRwCze6sLKrCYE2Nx+YL6xGL8NTEwi0j6Np9P5TrHOpLKXlkHxoZX3 9HnuF5J/XS9b+oqU68lLm1WZgVmbENkTQBsl1GPaRvnsWBnyY+TftDAisg4pkwjtfSdh94q6CLKNQWMhezEbjd+cmN2waV8+ftOP4EkLqWybykVpNyD1UU2c qYgUHoXJ94JQ7SpKnEpWaS7n4z/gY7/C5l2wwWPhM3mDB2iilBdWIPjL/l6cGAj2PKOr0+nB0MYvKbU4oZMmeFuf1joWKTuVtb8sZsFyLC6pROXxTXtW0jD7 lObj/De6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sumit, On 06/15/2017 11:29 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. > > Add the skip portion on missing the respective test_XXX module. Error out > the same way as prime_numbers.sh. > > Signed-off-by: Sumit Semwal > --- > tools/testing/selftests/lib/bitmap.sh | 5 +++++ > tools/testing/selftests/lib/printf.sh | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/tools/testing/selftests/lib/bitmap.sh b/tools/testing/selftests/lib/bitmap.sh > index 2da187b6ddad..85294b4a0861 100755 > --- a/tools/testing/selftests/lib/bitmap.sh > +++ b/tools/testing/selftests/lib/bitmap.sh > @@ -1,6 +1,11 @@ > #!/bin/sh > # Runs bitmap infrastructure tests using test_bitmap kernel module > > +if ! /sbin/modprobe -q test_bitmap; then > + echo "bitmap: [SKIP]" > + exit 77 > +fi Please add this logic below in the else clause instead of adding duplicate block. I think it is would be good to differentiate when a modules isn't present vs. modprobe failed keying off of "Module test_printf not found" message. The second one can be separate patch. > + > if /sbin/modprobe -q test_bitmap; then > /sbin/modprobe -q -r test_bitmap > echo "bitmap: ok" > diff --git a/tools/testing/selftests/lib/printf.sh b/tools/testing/selftests/lib/printf.sh > index 4fdc70fe6980..024e749a83d4 100755 > --- a/tools/testing/selftests/lib/printf.sh > +++ b/tools/testing/selftests/lib/printf.sh > @@ -1,6 +1,11 @@ > #!/bin/sh > # Runs printf infrastructure using test_printf kernel module > > +if ! /sbin/modprobe -q test_printf; then > + echo "printf: [SKIP]" > + exit 77 > +fi Please add this logic below in the else clause instead of adding duplicate block. I think it is would be good to differentiate when a modules isn't present vs. modprobe failed keying off of "Module test_printf not found" message. The second one can be separate patch. > + > if /sbin/modprobe -q test_printf; then > /sbin/modprobe -q -r test_printf > echo "printf: ok" > thanks, -- Shuah