Received: by 10.192.165.148 with SMTP id m20csp682952imm; Fri, 4 May 2018 18:18:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEN5i2u/j/9geuKtuO2JwZfreup/VijB1G2WDtRJJRKgFD2uORQb6lpwJ57jPLx6JuDuaI X-Received: by 10.98.245.139 with SMTP id b11mr28971958pfm.113.1525483089623; Fri, 04 May 2018 18:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525483089; cv=none; d=google.com; s=arc-20160816; b=Tz680bKCNMa2/766U4d9FbvAPaJL/b6PWQj/LfAJ3tXgMBFUd+t6yCBP+HUI2W+wvN /jjOaQLucqGfBRw9t6At2PC8MDsTtLSZpbDzI/QQVra6129sq/AavMM8OcUX4Te3aIIl /6OibL1zk3EjcWYllUol2aYNKXgmHHZHUo8DMisJhcvB3FFGZUlrQ8LJJ494nbd+eNiP kdJcrC3WFVJb2jNVosvZjG6v5ML+vUaVlIqoBUwuC0oRVcLmZmSyAqi2nizKyMvB0ewE OofXKB4JoGYSyR/0F/dxilUbxZOKj5BGdjWOqG5J94qCGSCLDBOIwvyCg9OFrWfHL6LZ 5ejQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=hpMYMP383wZpb5uI/4duIxXSfDZELIryIwb0ZIXFm84=; b=CphzPbn0dvUjlE9gtWESkU1wOYBedvtu2/foTSMEmfEHmKoDM332UX4FKbLd3ro229 whNWIDg3puDTy2X36lG0axDv1ZfFnMFqF7xmem0rHDt1kzG2d5mMR1hCfilIwjgjpa1c 587fpm3j/etQ41/aAQGcPgRZBVHMg3MhH6rFDxJMHlyeHpunHXzL8YI65klKJSEQlAga ztF3v2Xg7RBEH8xEWXfyGvc3ntUq7LrFmR2DjZW/9naKK5bEf/mxq99vJVIgjEb/zn+A aqScSOzalmywOGhbILnAFlGnyEZHOXlbVe0VqDnaNogD2xilTOX7ggxUzKVItxCs1JWm wT1A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18si17175038pfe.299.2018.05.04.18.17.55; Fri, 04 May 2018 18:18:09 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752196AbeEEBRQ (ORCPT + 99 others); Fri, 4 May 2018 21:17:16 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50591 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751789AbeEEBRO (ORCPT ); Fri, 4 May 2018 21:17:14 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 0F0E921075; Sat, 5 May 2018 01:17:14 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L4-8nSayvHfD; Sat, 5 May 2018 01:17:14 +0000 (UTC) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id A64ED20E18; Sat, 5 May 2018 01:17:09 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/24] selftests: locking: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:22 -0600 Message-Id: <20180505011328.32078-18-shuah@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180505011328.32078-1-shuah@kernel.org> References: <20180505011328.32078-1-shuah@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When locking test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Added an explicit search for ww_mutex module and return skip code if it isn't found to differentiate between the failure to load the module condition and module not found condition. Kselftest framework SKIP code is 4 and the framework prints appropriate messages to indicate that the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/locking/ww_mutex.sh | 8 ++++++++ 1 file changed, 8 insertions(+) mode change 100644 => 100755 tools/testing/selftests/locking/ww_mutex.sh diff --git a/tools/testing/selftests/locking/ww_mutex.sh b/tools/testing/selftests/locking/ww_mutex.sh old mode 100644 new mode 100755 index 2c3d6b1878c2..91e4ac7566af --- a/tools/testing/selftests/locking/ww_mutex.sh +++ b/tools/testing/selftests/locking/ww_mutex.sh @@ -1,6 +1,14 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 + +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + # Runs API tests for struct ww_mutex (Wait/Wound mutexes) +if ! /sbin/modprobe -q -n test-ww_mutex; then + echo "ww_mutex: module test-ww_mutex is not found [SKIP]" + exit $ksft_skip +fi if /sbin/modprobe -q test-ww_mutex; then /sbin/modprobe -q -r test-ww_mutex -- 2.14.1