Received: by 10.192.165.148 with SMTP id m20csp683256imm; Fri, 4 May 2018 18:18:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqHuxLAD+xmQSBQD/XSFjH8NnrxTrICpySP0O/XBI532PWtYFPFxw62N7WZsE0Niv9nSypC X-Received: by 2002:a17:902:680c:: with SMTP id h12-v6mr30420164plk.113.1525483117671; Fri, 04 May 2018 18:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525483117; cv=none; d=google.com; s=arc-20160816; b=GXnLizgCNHfaapfiCncPGfCAJEnKN5gbRE9MYdR05mkP3AzK/yRgO+ZXXb9+6svmso JmLwx0OvFCz60ZF6qjvn1HiGwrFuOWtUFwPRdAbt92PynJjBHfA6Ok308zYcjtTLw89t LjQ9H1YK5wm2bWhjwBI0svhiv91IBQbbVRoJoQtBeMTltQhLRctuhzCR1TRaXfQpqETf svKwJAIYSZeEidenHVektn0IJk45/ZUZ+hh4N9TlFW4su7adCxcwHsPR/HRx6wpkjtj5 ycwXWn25/S6SvSCziJq0Uo4cGkY+bvve8cdRnhYGHZH+mXxGBV3Vi/X/zfZdUNPPZ9zA vntQ== 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=jIj0KAWIQac+v7Sp45+B8E7ftJ6Op/XDakMPMqL+17s=; b=p6lychr3vxphtbTZH+o22G/ewKX9DWHScjFI9UqXScdY6TtygTPZI4UfVtX9G0rCWX AbGyAA6+aYFbkcILvMkLkwOgoMAOiJdmWd44O5UvoJIuHk4WofO5DHWLKWjlctjrN7XU 6Y77tzdk5aEiRMBfHjMKeI8gdzWwbWX/v5h5MfLyoyBmbxGmsm+5rnHA7hD107qY7HEo qrRf+kZiMRCijZTuE/OnEVML+3UStqHCo6Rb3pkXOT2jF2yRIF89WaC3hBeKDsaDU5Vk PoVp9x7JFvyCuKkQRdyqQnbjLgXjcxm7y9LbsnNR/1KOg5qqzI8F56YxLIm/fMlDdq6q SVsQ== 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 z18-v6si13911714pgc.99.2018.05.04.18.18.23; Fri, 04 May 2018 18:18:37 -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 S1752258AbeEEBRj (ORCPT + 99 others); Fri, 4 May 2018 21:17:39 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50620 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbeEEBRh (ORCPT ); Fri, 4 May 2018 21:17:37 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 94F5E21075; Sat, 5 May 2018 01:17:36 +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 s7nxtyU1YArc; Sat, 5 May 2018 01:17:36 +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 A2DE220E18; Sat, 5 May 2018 01:17:23 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org, mathieu.desnoyers@efficios.com, gregkh@linuxfoundation.org, paul.elder@pitt.edu, alice.ferrazzi@gmail.com, tglx@linutronix.de, mingo@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/24] selftests: membarrier: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:24 -0600 Message-Id: <20180505011328.32078-20-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 membarrier 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. Change it to use ksft_exit_skip() when the test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/membarrier/membarrier_test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/membarrier/membarrier_test.c b/tools/testing/selftests/membarrier/membarrier_test.c index 22bffd55a523..6793f8ecc8e7 100644 --- a/tools/testing/selftests/membarrier/membarrier_test.c +++ b/tools/testing/selftests/membarrier/membarrier_test.c @@ -293,10 +293,9 @@ static int test_membarrier_query(void) } ksft_exit_fail_msg("sys_membarrier() failed\n"); } - if (!(ret & MEMBARRIER_CMD_GLOBAL)) { - ksft_test_result_fail("sys_membarrier() CMD_GLOBAL query failed\n"); - ksft_exit_fail_msg("sys_membarrier is not supported.\n"); - } + if (!(ret & MEMBARRIER_CMD_GLOBAL)) + ksft_exit_skip( + "sys_membarrier unsupported: CMD_GLOBAL not found.\n"); ksft_test_result_pass("sys_membarrier available\n"); return 0; -- 2.14.1