Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp526263imu; Thu, 22 Nov 2018 01:08:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/V4IQvzCQSfE8fJjTGf6E6pmg3FCCokOHC4rAq5wG5rstzU5th6yTqB/ous6MO+yvdCRLqI X-Received: by 2002:a63:4456:: with SMTP id t22mr9594128pgk.0.1542877720410; Thu, 22 Nov 2018 01:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542877720; cv=none; d=google.com; s=arc-20160816; b=odMs0Q2s7SAl7BkY0lWJLQeeBVFpfDx6hmLKi1XKBPmptldVP3V+DXaxFhQnEyALNM 1057HW6KR376CFhpj17f6DFXk/Jp2aJK4qerrBtI028+vFAoq+5ZrFv1XXikRoWfJQJN f84d+iBszhyr/bhPm0ofGIeBk7OBDtEOByfHnF47nIqfcRSzZjoojLZK8dDPRiEBBen+ Sisvrl3jP4heGGN0DXsQgn3LUM45bqOu2hZa4NORlK+qS5Wpz6qQvglTXHGP6O2iEBE1 rS9ITBu2VFRTFV9BQB1tFqwUW6OLpsW5M03SJ4PhHPqi/oxG9atR9WFhB1y0M1IretW1 QcFQ== 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:from:date; bh=9/mmPtPKqrsZS371CzVCZIeQCBycbWbaT7BE+fZVnK8=; b=dJSgUrwe/HtQEiavNyf1faAwzvA1+BL9pfUR5Q5TuvZpoo7CnB7t5tU/ttZC9kLonI EHUq0WpoClTSPA6c0uDnfmo2CtnV02UeLV7EQWKR2+BS0pdxsShQ2w8KDvMzo9xgCbid pofJVgIbpo40k5kk+W7mGsx1mQPQLE9MgO4fGmxYrpzJXk+a2EzYcZprG3Kfl9nZhcQ8 jHK9t/vNX4tjYa2uHoilf94KfYs69tyvTV+i91Ybne8F8qu/uPPfIGAeKsVzX6H50hHT GW+ZzEzcPUcomism22+lONo5QtFEgmLlOpCEqT4NVvOzAXicrpw/Qv0gI4g5RhYZze/R 7EYA== 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 bf5-v6si22665856plb.400.2018.11.22.01.08.25; Thu, 22 Nov 2018 01:08:40 -0800 (PST) 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 S2390076AbeKVJDx (ORCPT + 99 others); Thu, 22 Nov 2018 04:03:53 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46114 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731518AbeKVJDw (ORCPT ); Thu, 22 Nov 2018 04:03:52 -0500 Received: by mail-pl1-f194.google.com with SMTP id t13so7405253ply.13; Wed, 21 Nov 2018 14:27:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9/mmPtPKqrsZS371CzVCZIeQCBycbWbaT7BE+fZVnK8=; b=bsRT8YrI4JasIplQ3IRkl9rt7gJJ6qTzlfA3U8I8Q6zPhY9w14SchAIDZ9+c8RTStN litwBsYAIbMnNL77GOfn0yYdc/z2yDg7IKRNpHGn7hUl9gkaekJXGTVlMpAT1Tcp0vae Ehp6NQCVoAs0ZiLnWO3gHfR9hkGoId8hZid9m83/Fri3v8i/BshY/7Dp66vlirX3DNQ+ MiTpcfGrLc7hgzPdOM4fqZZWNQNAgKzyeZgmvN80oll3B8YqX5pASUtzT/lFGWoGkoUK a0I9ZcE2T7lMgXFM5komTyMM038Cty5dM+0QmYq/2CQqAZVxF0oSllSCexupmLeyeRN6 4+nA== X-Gm-Message-State: AA+aEWZoIOp5sNx9Jz7xX71Hkj7zIU3da+9Z5OsYG1a+Ua2o/8R4nN/X I1Bxy9Sr5p16a5XJOXYo0d0= X-Received: by 2002:a17:902:8346:: with SMTP id z6mr8606578pln.340.1542839254376; Wed, 21 Nov 2018 14:27:34 -0800 (PST) Received: from garbanzo.do-not-panic.com (c-73-71-40-85.hsd1.ca.comcast.net. [73.71.40.85]) by smtp.gmail.com with ESMTPSA id b2sm73540386pfm.3.2018.11.21.14.27.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 14:27:33 -0800 (PST) Received: by garbanzo.do-not-panic.com (sSMTP sendmail emulation); Wed, 21 Nov 2018 14:27:30 -0800 Date: Wed, 21 Nov 2018 14:27:30 -0800 From: Luis Chamberlain To: Lei Yang Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] sysctl: kselftests: fix test_modprobe issue Message-ID: <20181121222730.GA4922@garbanzo.do-not-panic.com> References: <1536229374-25699-1-git-send-email-Lei.Yang@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536229374-25699-1-git-send-email-Lei.Yang@windriver.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2018 at 06:22:54PM +0800, Lei Yang wrote: > when CONFIG_TEST_SYSCTL=y, there is no "/sys/module/test_sysctl/" > when CONFIG_TEST_SYSCTL=m, checking /sys/module/test_sysctl/ is > before kernel module loading > > you'll get below error message > root@intel-x86-64:/tmp/sysctl# ./sysctl.sh > Checking production write strict setting ... ok > ./sysctl.sh: /sys/module/test_sysctl/ not present > You must have the following enabled in your kernel: > > This patch will fix this issue. > when CONFIG_TEST_SYSCTL=y, it has no chance to check "/sys/module/test_sysctl/" > when CONFIG_TEST_SYSCTL=m, it will load kernel module first before checking sys > interface. > > Signed-off-by: Lei Yang > --- > tools/testing/selftests/sysctl/sysctl.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh > index 584eb8e..08dc995 100755 > --- a/tools/testing/selftests/sysctl/sysctl.sh > +++ b/tools/testing/selftests/sysctl/sysctl.sh > @@ -120,6 +120,7 @@ test_reqs() > > function load_req_mod() > { > + trap "test_modprobe" EXIT > if [ ! -d $DIR ]; then > if ! modprobe -q -n $TEST_DRIVER; then > echo "$0: module $TEST_DRIVER not found [SKIP]" > @@ -770,7 +771,6 @@ function parse_args() > test_reqs > allow_user_defaults > check_production_sysctl_writes_strict > -test_modprobe Better yet, we can just depend on /proc/config stuff for test modules, refer to check_mods() on tools/testing/selftests/firmware/fw_lib.sh. Feel free to make helpers if you can come up with a generic directory, otherwise just duplicate the effort for now. Luis