Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1332310imm; Thu, 23 Aug 2018 00:58:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw+DGSvhSxVAJDFMEwyuNdltWK13VPQA7RDBpIqZqTHv10lDQJdY14PmbpQNzYXSv8P5SAv X-Received: by 2002:a17:902:d881:: with SMTP id b1-v6mr28091200plz.191.1535011129727; Thu, 23 Aug 2018 00:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011129; cv=none; d=google.com; s=arc-20160816; b=VFF8LwuxbtaIGVMv3OD8MDWQJJEnydQIeT2GrKAYvHQ/KV1rLYrTdHRLycQXWtdInz t9BVl0JvFziA9S7WbhRt6w9CKc6p9J9s/xlwl3/Hxyz0sGbhYleJB33hKoVC8qUU+rac lDEZ2siiPaKunUPUbu41nHbHOaQHTIg1bcfeni9BcV/VCZeJBEf4f1z0hGt3RDWxObe3 rHXIzxwvJEiyxkfi1ViIJl8COBabQG9+hCZh0vUMMkYPLui81AgdcYYhmL6PyKr7TLFT uBCxXefAMCZe77gmWsMm+yf5o7+Bi0Pm8vZFrMxIxZHa5jW/430dpncImmF+CNCIj5dw 85fg== 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=IAINXqSjG/bDVrQFkrbGyhka2b9vokQ9BOCnyu9/Osw=; b=mfTNTkDQUFv3AHRcTAEJa1N7rt6JC2gXrxheLhlKVBBAh2vcXNOAbPHRbJNoyzTcM/ 4vPwqdUJVrGUb4axma/A4CnYnfRICw1CEs7i8VXO1PoWFRFXNr3BtWqKcPNMNbhcLGST seyacM+h5pjQ41yyehl8tMgMwaHTFdeL8p1PJySPfFQHbjucsmSd2RUFHXF9gRsjZ/40 aNVEXsCkThA0kf7UYY4m4cFy/rJD9o9s6bu/IIBro6RR+p2dUI+UOTZnGGVTXAtJCbK0 CEdpIG9n8mzlCJO2Ffa2/8qn5nPae46yWdWYAF8OH4lrKNu7+kcJCQwu+/gYH8Q5ofh9 EZ+w== 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 r22-v6si1877338pgb.509.2018.08.23.00.58.34; Thu, 23 Aug 2018 00:58:49 -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 S1727345AbeHWLZm (ORCPT + 99 others); Thu, 23 Aug 2018 07:25:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41566 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbeHWLZl (ORCPT ); Thu, 23 Aug 2018 07:25:41 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DFCC09D2; Thu, 23 Aug 2018 07:57:18 +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 04/79] selftests: static_keys: return Kselftest Skip code for skipped tests Date: Thu, 23 Aug 2018 09:52:40 +0200 Message-Id: <20180823074918.929886522@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 8781578087b8fb8829558bac96c3c24e5ba26f82 ] When static_keys 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 searches for test_static_key_base and test_static_keys modules and return skip code if they aren'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) Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/static_keys/test_static_keys.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/tools/testing/selftests/static_keys/test_static_keys.sh +++ b/tools/testing/selftests/static_keys/test_static_keys.sh @@ -1,6 +1,19 @@ #!/bin/sh # Runs static keys kernel module tests +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + +if ! /sbin/modprobe -q -n test_static_key_base; then + echo "static_key: module test_static_key_base is not found [SKIP]" + exit $ksft_skip +fi + +if ! /sbin/modprobe -q -n test_static_keys; then + echo "static_key: module test_static_keys is not found [SKIP]" + exit $ksft_skip +fi + if /sbin/modprobe -q test_static_key_base; then if /sbin/modprobe -q test_static_keys; then echo "static_key: ok"