From patchwork Mon Jun 19 13:44:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Semwal X-Patchwork-Id: 105833 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp861629obh; Mon, 19 Jun 2017 06:44:40 -0700 (PDT) X-Received: by 10.99.95.70 with SMTP id t67mr3755662pgb.104.1497879880517; Mon, 19 Jun 2017 06:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497879880; cv=none; d=google.com; s=arc-20160816; b=aSF8hyiMF1nnkLJK4S+UJyB/Z1pSFM96SSkfAzVVpuf9Empe7rYyTdnHZ3d9NBkUYC pbU8E5je3df+s+idXH8fVT8hFxrcfU5ievPqHLD1Jo/MqOnYK1C/JbQoDIf8i04ZrKq8 9SPGyjsnwWGO9WYqmS0uqswDznwxRDHjV4t7wi+t0uA3OJz8A7GbYLeGeCoZDgYFACiS AAX8kf7scGyNye7eIvIzNcOs9k3ZvsJSTBb1VJPAGveS6U0w+Eg28fUYRMk3AYBVcQGq CGK45UJcdbi936MbixMsBicHherYO1FomL+cRekanI5m5t1Mx6iO7+eBOVW3P/HG/0eB 2/pQ== 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=tH1hdY0mRODk7/7lLJlbweb6uFWBmlPkfSDBri9LkT8=; b=p1yAdgX6Zg59qLWos4Aru63KVp2kIzFLRAkCIredYOQddC/0j4Mo54NIgB+pSdTjCB neDET9pX1aKX8J9oU16tQVaRbg85Ahxs+NmTS4VqPGp7S6QLMNpXlUWGqSveZMHdyNk7 jYLR5sGO6gxFmMfggv2J2/vapiIYIeZQWvnNZzzWB/A6MjNfbVz1bGULpmtWSfqOYA2C sGbXFRqiFrUXmSu2Or+oqveluBQtoXXzoTyDWk9+YmeWVJcAKxwd+tQkXm+zaZIIDOaZ BK0M1BlvkTQpRuaqRJxisOgz+ACnAASeGzKeDx6fRIIs0iHEcMNofTDJ0NHWD71B014s 0HdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=UJQ8FbAB; 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 h32si9590665pld.620.2017.06.19.06.44.40; Mon, 19 Jun 2017 06:44:40 -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=UJQ8FbAB; 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 S1750907AbdFSNo2 (ORCPT + 25 others); Mon, 19 Jun 2017 09:44:28 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:33074 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbdFSNo0 (ORCPT ); Mon, 19 Jun 2017 09:44:26 -0400 Received: by mail-pg0-f54.google.com with SMTP id f185so48320090pgc.0 for ; Mon, 19 Jun 2017 06:44:26 -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=tH1hdY0mRODk7/7lLJlbweb6uFWBmlPkfSDBri9LkT8=; b=UJQ8FbABY7rv1vhGUxXKtLy++lbpT+WG2DSAi7DRwQOPTfCqFBqX/csBc1BDLSZF+a aK3WMIbXt6rjfo9il3pEP8nd7GpQQpSZMdRFNGgu1OqRsT7j1nQeygDMgHYaJpgmNpt3 0A0DgKYAPX0LHl/XhGWzUdDgqvvzLVeBcnGes= 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=tH1hdY0mRODk7/7lLJlbweb6uFWBmlPkfSDBri9LkT8=; b=b76afJO6Tu/YbKwDrcI4VVH5X1vW3UeN8kVhF9HQb5P99/4zjek1h+GVbNBd+JwVwZ vTCEIpNuyLNZ+YcZ4MTSqTPL42cKO69umXMM10IVTLC5bVNoSQKetyQpoxND8SRswQTy nvv6jYBgrOVJ8Fn0JeWcSkx/GY+qT0dXEtxz9IjnHXfJPJLd2b9hp/8tYMCTSOByNGG1 jitJRPXhN/c8nQFEdhMI9SyetWR79idwTDl4i6+23n26xoUNh8hwOvjwGarIfdO8Quqv bS0RLe9Dkbf9z4SPSKlZNZVO7r06Ov6Njhdm2/oiKea8ANc1F55Y8B60MHP5bvtyaAAi /LWw== X-Gm-Message-State: AKS2vOwJnRjzNag7wsZIglzw34RghR+pb9vb8HPhTQ9ppj909KJo4tyc UMKUp7SSWNxGE8HX X-Received: by 10.98.217.27 with SMTP id s27mr25086483pfg.228.1497879865812; Mon, 19 Jun 2017 06:44:25 -0700 (PDT) Received: from localhost.localdomain ([106.51.225.38]) by smtp.gmail.com with ESMTPSA id s29sm15048428pfi.17.2017.06.19.06.44.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jun 2017 06:44:24 -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 v2 1/2] selftests: lib: Skip tests on missing test modules Date: Mon, 19 Jun 2017 19:14:11 +0530 Message-Id: <1497879851-11057-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. Add the skip portion on missing the respective test_XXX module. Error out with the same error code as prime_numbers.sh. v2: Per Shuah's review, search for the module rather than do modprobe. Signed-off-by: Sumit Semwal --- tools/testing/selftests/lib/bitmap.sh | 6 ++++++ tools/testing/selftests/lib/printf.sh | 6 ++++++ 2 files changed, 12 insertions(+) -- 2.7.4 diff --git a/tools/testing/selftests/lib/bitmap.sh b/tools/testing/selftests/lib/bitmap.sh index 2da187b6ddad..b893046d511f 100755 --- a/tools/testing/selftests/lib/bitmap.sh +++ b/tools/testing/selftests/lib/bitmap.sh @@ -1,6 +1,12 @@ #!/bin/sh # Runs bitmap infrastructure tests using test_bitmap kernel module +if ! find /lib/modules/$(uname -r) -type f -name test_bitmap.ko | grep -q .; +then + echo "bitmap: test_bitmap.ko not found [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..804b7e75acc0 100755 --- a/tools/testing/selftests/lib/printf.sh +++ b/tools/testing/selftests/lib/printf.sh @@ -1,6 +1,12 @@ #!/bin/sh # Runs printf infrastructure using test_printf kernel module +if ! find /lib/modules/$(uname -r) -type f -name test_printf.ko | grep -q .; +then + echo "printf: test_printf.ko not found [SKIP]" + exit 77 +fi + if /sbin/modprobe -q test_printf; then /sbin/modprobe -q -r test_printf echo "printf: ok"