Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1332471imm; Thu, 23 Aug 2018 00:59:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY6ccnv/dlJ13yy1kTNT3xgBuKaF4L4KSO8wkoI7oNKDK2qB6IvLCOCsZvaw2XHADPmF5U6 X-Received: by 2002:a17:902:b08d:: with SMTP id p13-v6mr4755342plr.321.1535011142976; Thu, 23 Aug 2018 00:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011142; cv=none; d=google.com; s=arc-20160816; b=PwCLu+hzf7CJ7QCs4d8LWVLRWSk6d0++uUEs3YZtKpHoFZ+NEQcDpC1/hd3InALVT9 7gpHsg+//1EMeflT9YneKv7+bHY5VNrUV+Hl9cJegHTwgbq3OagDjMrEPdDlU1GbpCvF lxqqIWK0tK/e7yvQfbFS8S+ZOraA7EflNpFJEXGEN6YxIG5LWfsYIt3ENnkQgoIqFIrn sJky20C2vZzUkyVUvD1RLAzYbiMdMHtK7jgzvFNBvb2EquJF4xwwbJzOUHSVaGb0Aal9 QT/9cGvCyV/uZY7anxVUFElxu2Sj/CxHJWIgHzWtEW/JezaJD3QqKqJA0/5CmH3qG05V c2VA== 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=1nx6K2bt6QujF/xYhFwZ8RZj9linxiU8mgYeBKuhyoM=; b=kaQLBboAVj5Z1X8sXeSgxL0nWbvcl6TPOuLAwU0tA1rZH5Yb2w+uAkbQnvJ59eNK/4 G21Z65CODEXgzIPbxpNfiR01Qcvm54Fz+GwONPemo+nUg4M0S9RYRDfR45reVC0+JaOv vGGius/RUgctWEA7QO8zeqQBvHHLq9aLflcNmaYlYY7TXxD8TKoOMLll6bOxx1f4ch8J aZyUqYtFB1IwxWcdeutrNQG+ICUCtZ55HDvC/H7xir6GoBH+cXbqZQhguEUpiyuPMab1 jwxA2J3BwWWlFqhbb5qljztmqmgZsepiQePvdtoedsnF2nGRpS1G2gZGxL0kTLGEtpBq EqFg== 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 u15-v6si4276629pfa.28.2018.08.23.00.58.47; Thu, 23 Aug 2018 00:59:02 -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 S1727428AbeHWLZt (ORCPT + 99 others); Thu, 23 Aug 2018 07:25:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41582 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbeHWLZs (ORCPT ); Thu, 23 Aug 2018 07:25:48 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 175059D2; Thu, 23 Aug 2018 07:57:25 +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 06/79] selftests: zram: return Kselftest Skip code for skipped tests Date: Thu, 23 Aug 2018 09:52:42 +0200 Message-Id: <20180823074919.055086424@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 685814466bf8398192cf855415a0bb2cefc1930e ] When zram 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. 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/zram/zram.sh | 5 ++++- tools/testing/selftests/zram/zram_lib.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/zram/zram.sh +++ b/tools/testing/selftests/zram/zram.sh @@ -1,6 +1,9 @@ #!/bin/bash TCID="zram.sh" +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + . ./zram_lib.sh run_zram () { @@ -23,5 +26,5 @@ elif [ -b /dev/zram0 ]; then else echo "$TCID : No zram.ko module or /dev/zram0 device file not found" echo "$TCID : CONFIG_ZRAM is not set" - exit 1 + exit $ksft_skip fi --- a/tools/testing/selftests/zram/zram_lib.sh +++ b/tools/testing/selftests/zram/zram_lib.sh @@ -18,6 +18,9 @@ MODULE=0 dev_makeswap=-1 dev_mounted=-1 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + trap INT check_prereqs() @@ -27,7 +30,7 @@ check_prereqs() if [ $uid -ne 0 ]; then echo $msg must be run as root >&2 - exit 0 + exit $ksft_skip fi }