From patchwork Thu Sep 6 10:22:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Yang X-Patchwork-Id: 10590407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD5DD112B for ; Thu, 6 Sep 2018 10:21:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 865822A3BB for ; Thu, 6 Sep 2018 10:21:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 784982A5AA; Thu, 6 Sep 2018 10:21:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E8872A3BB for ; Thu, 6 Sep 2018 10:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727733AbeIFOzn (ORCPT ); Thu, 6 Sep 2018 10:55:43 -0400 Received: from mail1.windriver.com ([147.11.146.13]:49951 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbeIFOzn (ORCPT ); Thu, 6 Sep 2018 10:55:43 -0400 Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id w86AKtBF027974 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 6 Sep 2018 03:20:55 -0700 (PDT) Received: from pek-lyang0-d1.corp.ad.wrs.com (128.224.162.194) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.408.0; Thu, 6 Sep 2018 03:20:53 -0700 From: Lei Yang To: , , , Subject: [PATCH v2] sysctl: kselftests: fix test_modprobe issue Date: Thu, 6 Sep 2018 18:22:54 +0800 Message-ID: <1536229374-25699-1-git-send-email-Lei.Yang@windriver.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 load_req_mod trap "test_finish" EXIT