Received: by 10.192.165.148 with SMTP id m20csp681474imm; Fri, 4 May 2018 18:15:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpMJvouo4AB/6y1y1KHTajXLXjkxxLWjxzEUd/Vvg3WluGt4bMAqDt6rXUJmheCDdRoLqwD X-Received: by 10.98.57.156 with SMTP id u28mr28899016pfj.95.1525482934822; Fri, 04 May 2018 18:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525482934; cv=none; d=google.com; s=arc-20160816; b=0VNSbZ94r0rDGwdpyw2hDUsanUnKWBADDXOcCm++ME0bv7u9zmZHeSS7xwcLahLvGf ZDs+paizUJobXGNcGs6yen3a3ULeFD/ddB991fwtDShH3CRNezR9/0NWCiNNKJu2NBZx MDGEojqtB9ejrbM1iZRGtMPzLZM6ltDdHNikY79wQUg/15kqtNbeqH+56riRLdv12TyQ gQad4/4gxVtM1BHqMIu1l4VxX71TN7UrzAA0qzXE+cw+3vbNwFg9B05UPQdJZhK3Df1l z9mxKRkbGCQnbzyPU1YfP4dmOj16VrLQ9iLnxhauPuB74wR3D4/RvRS4GwA92fKPrZ1J 4s5w== 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=unryU1uoUmNSCjzP8LXZ9ExQcvrtxknUogh9PT9d1vk=; b=SMWL07vXRy3V8HgXqQKRlyJXlJ+LpG3Sm9ME/ZqMVi/q8+2WFZxYKdK7wy1oUgeUPr Bik60p7erU48ED5AufpWupxfqwiwTZIWTe0H2kL5fXzzcQtnaCgXHQBsa8W9hLytFpbe Kb3x16fvQuQwpdaVF01/4ogUpBQaXvbWeQkEPr564q43R2ahyHnC/HoEyNfasaR+mTfd yQJaP3OerymPTw4d0PO5+GHEbOYyvAbTWrtddJ+eJOw8vgUeYYGT0ohxp5CWgzUIWkF2 0T3qawTdMojs+rVnRzSMmeZnvT6qxbqaBHZgIcET0i1GUYogv8Ny1xlF5nQZwySNiO8j kpFA== 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 q9-v6si13496081pgp.226.2018.05.04.18.15.20; Fri, 04 May 2018 18:15:34 -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 S1752023AbeEEBOw (ORCPT + 99 others); Fri, 4 May 2018 21:14:52 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50407 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeEEBOv (ORCPT ); Fri, 4 May 2018 21:14:51 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 7B83021235; Sat, 5 May 2018 01:14:50 +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 n_36aFyyIaLh; Sat, 5 May 2018 01:14:50 +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 98F1321020; Sat, 5 May 2018 01:14:41 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org, gregkh@linuxfoundation.org, christian.brauner@ubuntu.com, ebiederm@xmission.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/24] selftests: filesystems: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:11 -0600 Message-Id: <20180505011328.32078-7-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 devpts_pts 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. In another case, it returns pass for a skipped test reporting a false postive. 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 test is skipped. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/filesystems/devpts_pts.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/filesystems/devpts_pts.c b/tools/testing/selftests/filesystems/devpts_pts.c index b9055e974289..0f2d9f427944 100644 --- a/tools/testing/selftests/filesystems/devpts_pts.c +++ b/tools/testing/selftests/filesystems/devpts_pts.c @@ -11,6 +11,7 @@ #include #include #include +#include "../kselftest.h" static bool terminal_dup2(int duplicate, int original) { @@ -125,10 +126,12 @@ static int do_tiocgptpeer(char *ptmx, char *expected_procfd_contents) if (errno == EINVAL) { fprintf(stderr, "TIOCGPTPEER is not supported. " "Skipping test.\n"); - fret = EXIT_SUCCESS; + fret = KSFT_SKIP; + } else { + fprintf(stderr, + "Failed to perform TIOCGPTPEER ioctl\n"); + fret = EXIT_FAILURE; } - - fprintf(stderr, "Failed to perform TIOCGPTPEER ioctl\n"); goto do_cleanup; } @@ -281,7 +284,7 @@ int main(int argc, char *argv[]) if (!isatty(STDIN_FILENO)) { fprintf(stderr, "Standard input file desciptor is not attached " "to a terminal. Skipping test\n"); - exit(EXIT_FAILURE); + exit(KSFT_SKIP); } ret = unshare(CLONE_NEWNS); -- 2.14.1