Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5055202rwb; Wed, 17 Aug 2022 10:13:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR6fBeUF5hmuOHUTbPWJ2CjAPqNGS3x5gHvpUpH2K9EVRM+Qf/xASKKPqxxiDmzhgKRyBb13 X-Received: by 2002:a17:906:4fc6:b0:731:137:8656 with SMTP id i6-20020a1709064fc600b0073101378656mr17313102ejw.582.1660756393153; Wed, 17 Aug 2022 10:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660756393; cv=none; d=google.com; s=arc-20160816; b=rSnM8NpG/TXlHoOanwLR0BbDAspE0LJS+Lc9IsOg7iA6xvC9rCi2gf51KgKnroDmqN 0NT0YmoTnPO2e0ofRxis4/jtRMf4ulzYefcf7nNtO4hR+Ff0DLsyEVnygJe5Y0pfHol+ JSEkjwco0zIOFP3wGrV6LNrW1dh1/2VUdYDwsJUrGK8ZsBvrRPOsuO0ynbAXDN5CJ/co S7IRf2sSTIyJT0M/Th/pj9gAOG6ukfSuF047rjeBBzKsNG0yMYBC4tw32mOptksCkUY8 UJUNoMTE1el0MZ5Arvq/OAKUUEN2JKqZKutzI72AhI8SsuxqJZ4TrW0JDqOP8Re7OMrS 8Vlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=MW91VJ8ooYkfI24AARzli0vrC+fjCBUcIuDZQqsMweU=; b=rsnwMt9oFRPoLaId3XMSylGYd05Vt1usz3Rq1qg8EwjXsO69jwZEZ+gdr1CFb3RkI4 39wSjQ0mkIFzalzvQ3oB2E9CJnbnBeiOaU1rpIBXiu5CWXYrWjmQUw0h5pip0TEVjdtp S27HonGtbGJUXFDKSPJMn+7o3wjcmsImwAqWL8TplCP9oTUMxSzFiLVTuBr7RKcSSVaT GuTy2hglAhmDw9LuzBHmaOZ13Qva+5eOCHjipALrDP8pCS4EjNInRdYBA9+HVWwvjKQ9 8KOSevWI5ARSWnUROSFfbsf3xPqbP4vXffDXPP9AIwuuxqYleldaFKfi2PlhhfntH38y F/6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="HrM/4oad"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a05640250cf00b0043bee43477csi13220048edb.576.2022.08.17.10.12.47; Wed, 17 Aug 2022 10:13:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="HrM/4oad"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240739AbiHQQtH (ORCPT + 99 others); Wed, 17 Aug 2022 12:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240665AbiHQQtC (ORCPT ); Wed, 17 Aug 2022 12:49:02 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D322ED6B for ; Wed, 17 Aug 2022 09:48:55 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id r74-20020a632b4d000000b0041bc393913eso5482274pgr.10 for ; Wed, 17 Aug 2022 09:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc; bh=MW91VJ8ooYkfI24AARzli0vrC+fjCBUcIuDZQqsMweU=; b=HrM/4oadRpLuauE3wfAhlaUa6h/4/tqPiPftlRa28vjD29S1Z03AdGrUS4icg55lzz mdpH2/sGlO2S9hGKQFkGWyi/+LVFp8SKN+o6Ufdri1Eo5EiI1GtkyohqsoqWrCooUrse 01YZDaUiHfWsM07FJSgKOCdzFo+AJYOJjv7VIiA5cipO7Feu9OQL1v9EGOc1gBLW2ftE CRW3hP9j6pl8p24dzm74p7zY1Q4Jds3YgzU0HKP0wjd7gBMYe3dQzpfHuhWRGVgNQdK/ WBFuR2RUpFhIfIxXtE4hLpAVk/sIf+JpGOy5CJv1KNh1u6zrH/AyvJkzSkrKjk9fttAo OZsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc; bh=MW91VJ8ooYkfI24AARzli0vrC+fjCBUcIuDZQqsMweU=; b=NSfTioirbP0vFl58IgK1SW1tIOl+64CeC2xIA7doK+GdpuYocoLrdJM2mA1LysXeOf jeddU+QiTQelbO/fjun+kSN56UIDzSxOwOdUv5KkJRyYpvtaMsHWufEdjO/2vdNYCLaK clOjjJZHUpf0nAuailQ6OWvjRVVVMZYyUfxaCowW3TzlxMyxZgWPlMTv/eqRvSJXLsoo EV8iwe6cNDfYlYbGwR4lqqTkIX/ExhQ/e4wdABHE9bgcDKDyWGLXXfR/RKd4+/sFySgv lGt2gRcMGydB/4ulse36BIa/UXzwJHF7ZM1kwWY05GEhbOQqYOC38yes45UjrkCgZfcn eIaQ== X-Gm-Message-State: ACgBeo3qwrkyTk9oKz/xOC9QBwvf05wsIQftsaECKNvCdVsWWfRu+3uo wRjqDT6JkiALscccLxelVNN/oVX/zawH+RU= X-Received: from joefradley-custom-96.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:831]) (user=joefradley job=sendgmr) by 2002:a17:90a:3e48:b0:1fa:99af:d881 with SMTP id t8-20020a17090a3e4800b001fa99afd881mr4647698pjm.243.1660754935326; Wed, 17 Aug 2022 09:48:55 -0700 (PDT) Date: Wed, 17 Aug 2022 09:48:48 -0700 Message-Id: <20220817164851.3574140-1-joefradley@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH 0/2] kunit: add boot time parameter to enable KUnit From: Joe Fradley To: Jonathan Corbet , Brendan Higgins , David Gow Cc: Joe Fradley , kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are some use cases where the kernel binary is desired to be the same for both production and testing. This poses a problem for users of KUnit as built-in tests will automatically run at startup and test modules can still be loaded leaving the kernel in an unsafe state. There is a "test" taint flag that gets set if a test runs but nothing to prevent the execution. This patch adds the kunit.enable module parameter that will need to be set to true in addition to KUNIT being enabled for KUnit tests to run. The default value is true giving backwards compatibility. However, for the production+testing use case the new config option KUNIT_ENABLE_DEFAULT_DISABLED can be enabled to default kunit.enable to false requiring the tester to opt-in by passing kunit.enable=1 to the kernel. Joe Fradley (2): kunit: add kunit.enable to enable/disable KUnit test kunit: no longer call module_info(test, "Y") for kunit modules .../admin-guide/kernel-parameters.txt | 6 ++++++ include/kunit/test.h | 1 - lib/kunit/Kconfig | 8 ++++++++ lib/kunit/test.c | 20 +++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) -- 2.37.1.595.g718a3a8f04-goog