Received: by 10.192.165.148 with SMTP id m20csp1870651imm; Sun, 6 May 2018 01:16:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp9yniSSmJ9KaECaGD33dSO8jdJee094aSbUJ6uAKUmNPx9iNVqmpvyvgJ6qcQJEX5uJ0bI X-Received: by 2002:a17:902:758d:: with SMTP id j13-v6mr34217137pll.188.1525594584440; Sun, 06 May 2018 01:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525594584; cv=none; d=google.com; s=arc-20160816; b=NaF5wdwB5CjjCW9sU0yg5fNBATIDapEDFU7M/HkW5xfN3GA0ks8HG5UIP8mBibGYP4 mgnQ77pp95Fobqxq3yK+w8VOC2Hs8uiygyvAJdm7bjNHnIfcHcFojIqEEVfc8tvgtQB8 dFuOJdaIi0DslXD7JuPNfzeST4yirUaNtxMGatM27M3ZL1yDdcIcGGUIrKJ/BFV+664U +uCGGnt5XGZmb1xKFhhEY5mJTYs2t0mH2iv6j1l3Jc/YY436EOskCpAK5rqCIxAuPlZg L0lRySN47yjI20y62g1APsyJL8Osq8rQ4a7EXEa1IOBlVjwVFGb06QAK91uZCKuRZ0XO NrHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:arc-authentication-results; bh=t9pCBjh+jW3NqypHOiEdUxLrceCuNJktd2irRbA1d1k=; b=Erguo6ooidiljmz+mTo6DB9RE/mIC/7BtZBvhiNDKSNHILnOlolViCdB9joPTmAB98 0QDP/AA/igLX39yK34VAPBayjvztZXb0bTccRGKlOAQp0uXj2U7l6PQYXVbKUrtEd5Eg qV7LhE7TgE+F7YadqMpXbmrWaKF7+JdddhMLHexhQzdsWog1rGAP8NH7u2FGiYJWmboO 1FHk0KK59sNO23NckTxjORhsgBzTGYUgg9dXvvOejGUlzBnmMH8i8leOEuysLmASEsdP fsdHIEXWUz9duiIpUUKhqCNLItHw7F5O0LzjVTJ0wciOygWwvoVn1nSe+j6wRScbJZ4t TvKQ== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e29-v6si14258070pga.573.2018.05.06.01.16.08; Sun, 06 May 2018 01:16: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbeEFIQB (ORCPT + 99 others); Sun, 6 May 2018 04:16:01 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55604 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeEFIP7 (ORCPT ); Sun, 6 May 2018 04:15:59 -0400 Received: from mail-wr0-f199.google.com ([209.85.128.199]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fFEpq-0002UG-AB for linux-kernel@vger.kernel.org; Sun, 06 May 2018 08:15:58 +0000 Received: by mail-wr0-f199.google.com with SMTP id w14-v6so17106389wrk.22 for ; Sun, 06 May 2018 01:15:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=t9pCBjh+jW3NqypHOiEdUxLrceCuNJktd2irRbA1d1k=; b=rQtZ4rdQKjJYt3enWwfmqUtCNc0XxLtDc74sjVF1MSMCxQbay1IzEc9Y6hQPTq1+Wg mJxW8U62itphrw7MA5jvZsYt39pHMaqZdhiTZu/wg0tlB5qsBEhefwhIVNZilI49PzY0 NR4zCSvV6V7t3UgvZJmjC+2c8Ca+0cYQOgPiasSCEOr5SToa7e0UE7hiIGRoM9HiqpYc RxE6Ph+HXV1ujemWarWvQQTh3GFG/tzBLmxw/3bt3Df/WX3Xcg746LGsaDEt4BgILh8C tR9wd8mfcAis7nblRoB0Fx8x7kFqCI9QH06wEKl/YRL7pu22nDXTinCdiZ6urRj6w8XK HLSg== X-Gm-Message-State: ALQs6tAsCDpQUfH2boE+xXJ8NZMaGb8ViWIjUXim/sDdZ3NdA3QcM0sj wgfa7SXlZmWkD1U6PsutoF76bqvp8jJ3QLLAYw4zA9S4lz3O4rx+FAQAwKOW/22JWPtVyJ8AA80 uh37Xl91VTgb7/eMS+Tsb0BVRRH91/aYgRtG18oBbbg== X-Received: by 2002:adf:e791:: with SMTP id n17-v6mr26199869wrm.225.1525594557600; Sun, 06 May 2018 01:15:57 -0700 (PDT) X-Received: by 2002:adf:e791:: with SMTP id n17-v6mr26199854wrm.225.1525594557340; Sun, 06 May 2018 01:15:57 -0700 (PDT) Received: from gmail.com ([2a02:8070:8895:9700:b0c9:237:9998:dabc]) by smtp.gmail.com with ESMTPSA id i30-v6sm40834687wra.38.2018.05.06.01.15.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 May 2018 01:15:56 -0700 (PDT) From: Christian Brauner X-Google-Original-From: Christian Brauner Date: Sun, 6 May 2018 10:15:56 +0200 To: "Shuah Khan (Samsung OSG)" Cc: gregkh@linuxfoundation.org, ebiederm@xmission.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/24] selftests: filesystems: return Kselftest Skip code for skipped tests Message-ID: <20180506081555.GA9705@gmail.com> References: <20180505011328.32078-1-shuah@kernel.org> <20180505011328.32078-7-shuah@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180505011328.32078-7-shuah@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 04, 2018 at 07:13:11PM -0600, Shuah Khan (Samsung OSG) wrote: > 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) Acked-by: Christian Brauner Thanks, Shuah! Christian > --- > 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 >