From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23B64C2D0FC for ; Wed, 13 May 2020 13:18:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC23C2063B for ; Wed, 13 May 2020 13:18:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="o7LZddYK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC23C2063B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7467B900130; Wed, 13 May 2020 09:18:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F7FD9000F3; Wed, 13 May 2020 09:18:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E5A6900130; Wed, 13 May 2020 09:18:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id 441439000F3 for ; Wed, 13 May 2020 09:18:12 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 01228181AEF1D for ; Wed, 13 May 2020 13:18:11 +0000 (UTC) X-FDA: 76811749224.30.birth47_81b95b2ea632e X-HE-Tag: birth47_81b95b2ea632e X-Filterd-Recvd-Size: 4988 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 May 2020 13:18:11 +0000 (UTC) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47FE52063B for ; Wed, 13 May 2020 13:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589375890; bh=eFMjZY/v2Asht7I/UpE2htqibqHIccOjg5FwflDPi/I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=o7LZddYK2z9I/7JCKaE67GyFQtLMmnaHdG9dov4EPopF7tYlY27GcP042SKLLw/A/ Zm9L+FAllu3DLg+ele733AkiVKYLF1BxhTGnr+G7jcvO2VTiPs9ys1LxFhkEo5DoHK nFrdgmx9OHOSu3ZE7jlgf9m+LqRtWaLKl5xt4JcQ= Received: by mail-vs1-f48.google.com with SMTP id 62so312835vsi.2 for ; Wed, 13 May 2020 06:18:10 -0700 (PDT) X-Gm-Message-State: AGi0PubqQZ9zfYZC6cbNfMwEjAV+pI9KvWfUcz5EBF52EqGRGYcP0uTp ZZV5JsuiOpfUvkyA07pPgSbBIY6kO+W+LY0DL0s= X-Google-Smtp-Source: APiQypKNqBjYJVuB9t2wrPEHjHlrIEdxGdAfeXJ7D823LnhI8WRMmuVeTONcMe3Uk+FV8NdJcvc8W9bFF/8L520ToDc= X-Received: by 2002:a05:6102:4d:: with SMTP id k13mr19498367vsp.198.1589375889355; Wed, 13 May 2020 06:18:09 -0700 (PDT) MIME-Version: 1.0 References: <20200427180433.7029-1-vbabka@suse.cz> <20200427180433.7029-6-vbabka@suse.cz> <20200427183913.GH11244@42.do-not-panic.com> <028d1996-9f4c-20c6-fb2a-706baa919dde@suse.cz> <20200511183155.GT11244@42.do-not-panic.com> <20200513131532.GO11244@42.do-not-panic.com> In-Reply-To: <20200513131532.GO11244@42.do-not-panic.com> From: Luis Chamberlain Date: Wed, 13 May 2020 07:17:57 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 5/5] lib/test_sysctl: support testing of sysctl. boot parameter To: Vlastimil Babka Cc: Andrew Morton , Kees Cook , Iurii Zaikin , "linux-kernel@vger.kernel.org" , Linux API , linux-mm , Ivan Teterevkov , Michal Hocko , David Rientjes , Matthew Wilcox , "Eric W . Biederman" , "Guilherme G . Piccoli" , Alexey Dobriyan , Thomas Gleixner , Greg Kroah-Hartman , Christian Brauner , Masami Hiramatsu Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 13, 2020 at 7:15 AM Luis Chamberlain wrote: > > On Wed, May 13, 2020 at 10:58:16AM +0200, Vlastimil Babka wrote: > > On 5/11/20 8:31 PM, Luis Chamberlain wrote: > > > On Mon, May 11, 2020 at 01:05:22PM +0200, Vlastimil Babka wrote: > > >> ----8<---- > > >> From a999e993a89e521b152bbd4b1466f69e62879c30 Mon Sep 17 00:00:00 2001 > > >> From: Vlastimil Babka > > >> Date: Mon, 11 May 2020 12:59:49 +0200 > > >> Subject: [PATCH] lib/test_sysctl: support testing of sysctl. boot parameter - > > >> fix > > >> > > >> Skip the new test if boot_int sysctl is not present, otherwise, per Luis, > > >> "This would fail if someone uses this script to test an older kernel, and > > >> the scripts in selftests are supposed to work with older kernels." > > >> > > >> Suggested-by: Luis Chamberlain > > >> Signed-off-by: Vlastimil Babka > > >> --- > > >> tools/testing/selftests/sysctl/sysctl.sh | 5 +++++ > > >> 1 file changed, 5 insertions(+) > > >> > > >> diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh > > >> index ef6417b8067b..148704f465b5 100755 > > >> --- a/tools/testing/selftests/sysctl/sysctl.sh > > >> +++ b/tools/testing/selftests/sysctl/sysctl.sh > > >> @@ -756,6 +756,11 @@ sysctl_test_0006() > > > > > > You want to: > > > > > > > > > # Kselftest framework requirement - SKIP code is 4. > > > ksft_skip=4 > > > > > >> sysctl_test_0007() > > >> { > > >> TARGET="${SYSCTL}/boot_int" > > >> + if [ ! -f $TARGET ]; then > > >> + echo "Skipping test for $TARGET as it is not present ..." > > >> + return 0 > > >> + fi > > > > > > And return 4 instead. > > > > If I return it from the function, nobody will care, AFAICS. If I 'exit > > $ksft_skip', is that correct if it's just a single test out of 7? > > yes please do that. Ah but once we add test_0008() it may be supported.. so I think return would be OK