From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751763AbdFPF3h (ORCPT ); Fri, 16 Jun 2017 01:29:37 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:34193 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750921AbdFPF3g (ORCPT ); Fri, 16 Jun 2017 01:29:36 -0400 From: Sumit Semwal To: shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: keescook@chromium.org, decot@googlers.com, linux-kernel@vger.kernel.org, Sumit Semwal Subject: [PATCH] selftests: lib: Skip tests on missing test modules Date: Fri, 16 Jun 2017 10:59:25 +0530 Message-Id: <1497590965-12310-1-git-send-email-sumit.semwal@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 + 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 + if /sbin/modprobe -q test_printf; then /sbin/modprobe -q -r test_printf echo "printf: ok" -- 2.7.4