Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1426185imm; Thu, 23 Aug 2018 02:59:24 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwLM9v0ovffKb0wwcRIb8g4ApUgMOVySSU9M8bqbbHdTpGknk+4DKo3q9X8Zgi8Sf95Artf X-Received: by 2002:a63:6f09:: with SMTP id k9-v6mr19159660pgc.360.1535018364419; Thu, 23 Aug 2018 02:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535018364; cv=none; d=google.com; s=arc-20160816; b=JhW7pgJAi9kRwRUao9CfqvDiRWRisqjwqpz2CGuvonj2rUiWdsJDSMavgfUzOaW3Ug qHoCkwaUFIQvibAeZKHxQiiL2rlhuk6O9GY8DGO06qQS1tg40ssRSjqCKnxlh0ah0ffO EmTUiPW2f6mJHQYYMXLBhnQl/GTZj7D+oWdj1nKsPLYmtXRsya2Br82nhKDsX3+cM5ev +7b87XWa+MvR36EGNvHu/KovUvvzzLdpf50nzYJhwv4NLLaS6BDtyGrRCpRMdOepefwD 8DiKDBrEJ5XkUkJzksca2gBhfKlar4uC9lEFZbCjY+7VSIREsDDG6zAneGE4gmBZvRT2 Wl9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3MRUpGSOjnj4BqFgV904d//CEQ/3Ml6ve1K+3ztiInI=; b=rroaApGdGYbj4YbCXsppUxPOpY5tMsV5yvw+zPtVF//8iFK3htHKcZDvIFO17DzsBP XmAUG8EPhLCu7Bn6XJ7pAIb5mI+lgYU3gLuJERwZynzRf7Ngax4jgWX2jMdOaP2EA5cy lFr3gYcvNGjNxRkTxCF5MGiIhqhoULfpbqR5LMjpRWBikHT4NCqaVYNJa2uaYbPrVIHE liNslLf9lXiXwwBLTEi2NKTAoRkt6TqckF4OKr/zgCp88tIXlyk+U3ucbgOE173qeYxh /s0DNfwugIZxr23YKb2fQPvNVpuuNNgEXmBfXMj5SYheGkgRma4RP+D2vJkTBDxE5QTz Z4wA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2-v6si3255285pgk.452.2018.08.23.02.59.07; Thu, 23 Aug 2018 02:59:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbeHWLZp (ORCPT + 99 others); Thu, 23 Aug 2018 07:25:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41574 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbeHWLZp (ORCPT ); Thu, 23 Aug 2018 07:25:45 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D4F489D2; Thu, 23 Aug 2018 07:57:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Shuah Khan (Samsung OSG)" , Sasha Levin Subject: [PATCH 4.4 05/79] selftests: user: return Kselftest Skip code for skipped tests Date: Thu, 23 Aug 2018 09:52:41 +0200 Message-Id: <20180823074918.986921820@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823074918.641878835@linuxfoundation.org> References: <20180823074918.641878835@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Shuah Khan (Samsung OSG)" [ Upstream commit d7d5311d4aa9611fe1a5a851e6f75733237a668a ] When user 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. Add an explicit check for module presence and return skip code if module isn't present. 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) Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/user/test_user_copy.sh | 7 +++++++ 1 file changed, 7 insertions(+) --- a/tools/testing/selftests/user/test_user_copy.sh +++ b/tools/testing/selftests/user/test_user_copy.sh @@ -1,6 +1,13 @@ #!/bin/sh # Runs copy_to/from_user infrastructure using test_user_copy kernel module +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + +if ! /sbin/modprobe -q -n test_user_copy; then + echo "user: module test_user_copy is not found [SKIP]" + exit $ksft_skip +fi if /sbin/modprobe -q test_user_copy; then /sbin/modprobe -q -r test_user_copy echo "user_copy: ok"