From patchwork Tue Jun 20 04:48:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Semwal X-Patchwork-Id: 105926 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1189584qgd; Mon, 19 Jun 2017 21:48:38 -0700 (PDT) X-Received: by 10.98.108.72 with SMTP id h69mr28089979pfc.54.1497934118395; Mon, 19 Jun 2017 21:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497934118; cv=none; d=google.com; s=arc-20160816; b=dk5WAwtyKpF25CCSbzKIUEMusx66ngXsr4lsbVNCz5SUcZtA1MIJskCtBulgiEt4N0 lThe867GOKBECEp6IJjjFEy4gSnF+FAcZLSpSS7Bp7Nn/gfhyCWweRzUCyKVkOQlPwHs AzAuCpeGflaiQ/r5hIYcAVo1TeMK7g7MZwjuDWOTBeXDr8THG2Nm+tCeoVIpINo3LwxB bk4tL/sg38MbwT1X9XAjSq/fh+/2nF6OKNQObP97c6uHAIv/Se6c1S6+y8/nzQq0EiF/ CXGKnaFHkrB3PP7ml8D8gaX9waByjItV9cvZqaZWlR5LKiIS+X/CZezHv1WlxQVwSmRw b4Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=WRz5VDf3/PRVp6XRH2S0mJguN6vRDz6pAPcjn+TFFsQ=; b=bO/tqW4mIxCAi7ZzQTjGLRA5dv/S337s7sEUKP/HopvPw7tV+p+s3nOKLYlZ7S93xK S9BoGIaSTojTVLPFzsWfdUJ6bam/Up+KAOgmtkLYr37Qd+xb76ubBlkcOGcB8UvAfLpL X3eIG/djQ7Kx55z1FjtEiLZeE4oOp/MofzS9ESru19CUT5jjWNbGVo16W0We0whawz2y gqfMfia7UCCNtnLu9Pk1K0IHVguVZL9glR9mgNmczHpPEztxYSZ5l73fMgfMgkwVlrFR P9Te95r2Le0omJSAD4cKgBK4iGh/pjsQ0TkH4Rh89OUcFFICgdxqU6DIRZRCSeeNidvw x9pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=HCMTgQkW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si9978542pge.435.2017.06.19.21.48.38; Mon, 19 Jun 2017 21:48:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=HCMTgQkW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317AbdFTEsb (ORCPT + 25 others); Tue, 20 Jun 2017 00:48:31 -0400 Received: from mail-pg0-f53.google.com ([74.125.83.53]:33153 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbdFTEs3 (ORCPT ); Tue, 20 Jun 2017 00:48:29 -0400 Received: by mail-pg0-f53.google.com with SMTP id f185so57764404pgc.0 for ; Mon, 19 Jun 2017 21:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=WRz5VDf3/PRVp6XRH2S0mJguN6vRDz6pAPcjn+TFFsQ=; b=HCMTgQkWKyb3oW2b3RAXx0Bbb3858K55tb+RxJ6YHHQqqspJU7VJXilDTZe50e+ZbI DInw4UbIYmeVuaG3UamZfZuzS5mGsO+CyWi9Y/cmoWfZje46vN4ohHHNP8yUxnQyX0Sv a01P0Agg3F298nDI6i1ltqG4t1hKO72YZVvf4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WRz5VDf3/PRVp6XRH2S0mJguN6vRDz6pAPcjn+TFFsQ=; b=pj7kIF+5IGvsKxGlyBXk59HpSa7WJNav0N0TUrqOzlL93vYx+KRpViWfzb37avYMRU DOXMMklkVJW7m5gTwSNjkQlm5QOQ592Qn/Fwo+be1aM3M40bsBxguZ+nKQkyZ+xXIJRJ sXuqKEflcyrfgMkeUzt8g3KlqETTIhQduxqkXdOm0NSA4alHx3xYFtYscfiaXqIr6nvQ 31jAJ5HiIHODea9Ij3hcTzLmNzisf154Ba6wlXeYaLO3+z9DiCgsTOiFx6Oo+kowMa7T NsY07HPShPJP7meql/YZiR5EF2baJ+V2+qYZkRy/PP/EkbJJzNaqCm0vsMiGSnlRDzkm EV8A== X-Gm-Message-State: AKS2vOwHa/B056nVLjG4R1k1w2epIYk4P/xDvU1fcwYZ5QGoM4zeBHEl 7uM7qdSpn8KvuAQE X-Received: by 10.84.225.18 with SMTP id t18mr27298454plj.273.1497934108599; Mon, 19 Jun 2017 21:48:28 -0700 (PDT) Received: from localhost.localdomain ([106.51.225.38]) by smtp.gmail.com with ESMTPSA id n90sm24124453pfb.127.2017.06.19.21.48.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jun 2017 21:48:27 -0700 (PDT) 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 v3] selftests: lib: Skip tests on missing test modules Date: Tue, 20 Jun 2017 10:18:18 +0530 Message-Id: <1497934098-15995-1-git-send-email-sumit.semwal@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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. 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. Signed-off-by: Sumit Semwal --- tools/testing/selftests/lib/bitmap.sh | 4 ++++ tools/testing/selftests/lib/printf.sh | 4 ++++ 2 files changed, 8 insertions(+) -- 2.7.4 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