Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp418108imm; Thu, 6 Sep 2018 04:44:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbxG4hykLVlZI0ik84UX2EovizVkSNMjPQQU6yskGMzQMXlYlcPWjmLNTikT8KzOhj5nx7Q X-Received: by 2002:a65:608b:: with SMTP id t11-v6mr2305953pgu.259.1536234266649; Thu, 06 Sep 2018 04:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536234266; cv=none; d=google.com; s=arc-20160816; b=XShWPbExg1rZuOlP3/Q6QbdTjjYf8tudqIxQ1inv3T/Setegf5n7/cZwIts1JgRoIS 1wHnG2PkEBsSIy6ZDbp/2OWsXAavTmjC+oFElgVmHfLHEuYsAdfymTHonu+Q9Pb8dr7i A1Ud8Ax/9XDKbjjZhCSfV4GIqXY3dVqntELWasJaIHtqFTxipJN/dOf6g3yA6iyaQDi3 BlYKiEeGJ+OfFC/JvOISrpUXCJKQKTTE76hQ6A8Jcc5CEUBruhvxAuvcF+vBu3bYy3yR F7AIxPnF8hohq7eyHlWCAxuQq7rbVwVAFKRn8MpvobiHKXbvVkpt5Ztvf2bQvuE8XVPH /Pjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from; bh=X6YG9MZ44VVvaDT1QYnF7gV0ok3bxs8O551j047SyHU=; b=j5jMUq2V1B5UU2eJM/f1VTmdG2mTg2bcLmS39Td0xqN7n2TrsnBALp3tpWnujJdNvO +hGmE1awz9jKvoVg8wYqEKev7hm9dcSqvgzLPZB5W0ePCaQMahSpUrrSWFguhANlutz3 gvStlB8dC2qAHe+Ur1YJPEQe/cchmTCKP3VSrwjj1ak/DlZsfcoTkEHaeeB6GuJSsc61 VaTCgi6S7fqFsi+0mMiUdY2d9iGtrbgw5ByZ0dsWJSlgusnTeaPw7Yuj/Uzd9cbMLTU2 Kng5Vyk++PECMyc8IkeQog/OF0lTGiDy8rqTSa0jPRTJzOE1u0vSoZzv8qVZTbIDI902 MGVg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12-v6si5101589pgr.267.2018.09.06.04.44.10; Thu, 06 Sep 2018 04:44:26 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728618AbeIFOzn (ORCPT + 99 others); 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 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 1.9.1