Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3468884iog; Mon, 27 Jun 2022 17:14:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmuC1yBz+4ersivCPpjk9OgQFMWm0sAExzy1LhP84Ho2ihe748EOc0jZpUO+O6n2lSlqUn X-Received: by 2002:aa7:91cd:0:b0:525:63e5:9690 with SMTP id z13-20020aa791cd000000b0052563e59690mr1763083pfa.1.1656375261843; Mon, 27 Jun 2022 17:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656375261; cv=none; d=google.com; s=arc-20160816; b=fymHzzvtXqh0ljfmWMbizGG3do0Amn5XWWk8mzokvrnhcWqFivKA44lVR4hsia6O/x wjWVU7NGs0xevPDxBs/5opiDZcUE4RZdsu/uMgy/twN0orBzqmEmU3qQS4vCt1T5IZDB hDqTJQdp0vZYTrNPkGIReTQ96eo6fVZhu/NNPU9RN7QMh5ntD6NSWd7pXcnAZyXISECH 08ElIZ5dtifq7f1iy8iEHJTerUxlP1Iuk6ATnAZHtpabwoEo7J8fjjEBNKFXIfxBsRxm WvqJoTwl7WAKOI4Iy3wD8BkaVhwwprFIan0RywOw9gRjhsONrGdPY5hjeAmdP4LXt9Tv 9vdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=36OIarfx5PzM4kjZSSg0l/qf9yDisYQa76AlgarhvfQ=; b=FgGHJqfnrLrQ44MzUumOnVmtjM6o4buqMjuyDwFuX7m4+vw30SX7DNWGY6uY2GGtsW Dc9HnTDb6xb+IDbqBeogwtPC7Z9gpyjUSoSka7ieLjeC+aYFmEbzz2AQQ4HielSsP46d JblNaub91i+96yqqg8xvIBeK+aUdH6x8e1Dk6g5PkERdM73L4akAwfSIWCEVcKWIQxH8 2RnpYFrwZRoBhsFFl6TidedmlSFTORM2Igy1cdF/w26QsCcSkgLEf9ZMzfzt/8ZHtZXL EbUUK8pRwrLw769cU9LKKLiSdENqX8Mu20KjOONHoAofmf8bynQe/0S4X/IIXGSbRMKO MWJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VkW70IK+; 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 w16-20020a1709026f1000b001586fbb2b6dsi8737953plk.566.2022.06.27.17.14.09; Mon, 27 Jun 2022 17:14:21 -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=VkW70IK+; 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 S242285AbiF0XeJ (ORCPT + 99 others); Mon, 27 Jun 2022 19:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241313AbiF0XeH (ORCPT ); Mon, 27 Jun 2022 19:34:07 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 740C6DF8B for ; Mon, 27 Jun 2022 16:34:06 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id p7so17950540ybm.7 for ; Mon, 27 Jun 2022 16:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=36OIarfx5PzM4kjZSSg0l/qf9yDisYQa76AlgarhvfQ=; b=VkW70IK+3vPfOcOnRfWuB6LlV+6vmO/mzt/JCIbzEK4bLDfPMmrzfix3SzjJvMofg5 NjMF1m9bTZAD8EtP+QATDYGTVZptEXbY1wLv5kvTGX8Vcn+YL4rFBBLgIPkCe5FVRnKX RjkNcsqd9AQibP3cTF85ik1u2xfUI53T2U5HwUU9m3bjG+RFbm7U5NYQSWaWN2jBXT56 pRjpx+pbNDOdeJkw4SxT7B5C3A6kqxk6OgMNMc0hd6RQ+F0WNojoMUFFGMfHETX0UMUR EEBDJKNfqSwVDy65n69nDAgOeoLQxrLxd+OXmqDj1JOV8CgLWJZe4U1q/W8tVjfVJ/HE wYDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=36OIarfx5PzM4kjZSSg0l/qf9yDisYQa76AlgarhvfQ=; b=LsXxApwDDTPTzcP3wl7F3l8y1qQr3rLpEglrYvBp/X1HlkELJIjRWDvQi4AV3pj9Hy FmCLahx1k1GRwf7410PB85czbbnYJBFufXK4BRjIUCRLB3ni5mVRq4oyS07h527yGeqz /OQ9OZZLwGsZ2jKvdsNQngstKN22B43s2ciaAC6ZyQgDqmloSOfy250zNZveDcmIegK6 0IREd+vMVCB/6Rffnjo5CyeTzHTG8NvqvjcXM32AL/nA+nnUqZ2T7p5FtpsG/ACpxXBm JE0uOWNs8+DgCJjFM7e/QYjRqCoqoDEYf+BviqrMkBFZR5Gu44RuZszCMzHsZdXPM1qC 5uvw== X-Gm-Message-State: AJIora8kMxJ2h98GvYyEL4gjvINsE1iVyFlypt5+LnkkGWi6f5n0gMxf iBSmHpmWbz47kxRf41WjZdbe0TSEhKFHAeovdYS3eA== X-Received: by 2002:a25:d4d6:0:b0:669:b717:187b with SMTP id m205-20020a25d4d6000000b00669b717187bmr15523053ybf.405.1656372845601; Mon, 27 Jun 2022 16:34:05 -0700 (PDT) MIME-Version: 1.0 References: <20220624084400.1454579-1-davidgow@google.com> In-Reply-To: From: Daniel Latypov Date: Mon, 27 Jun 2022 16:33:54 -0700 Message-ID: Subject: Re: [PATCH] kunit: tool: Enable virtio/PCI by default on UML To: David Gow Cc: Brendan Higgins , Shuah Khan , =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= , kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 On Mon, Jun 27, 2022 at 3:57 PM Daniel Latypov wrote: > > On Fri, Jun 24, 2022 at 1:44 AM David Gow wrote: > > > > There are several tests which depend on PCI, and hence need a bunch of > > extra options to run under UML. This makes it awkward to give > > configuration instructions (whether in documentation, or as part of a > > .kunitconfig file), as two separate, incompatible sets of config options > > are required for UML and "most other architectures". > > > > For non-UML architectures, it's possible to add default kconfig options > > via the qemu_config python files, but there's no equivalent for UML. Add > > a new tools/testing/kunit/configs/arch_uml.config file containing extra > > kconfig options to use on UML. > > > > Signed-off-by: David Gow Reviewed-by: Daniel Latypov LGTM, modulo the pytype error mentioned before. > > tree = kunit_kernel.LinuxSourceTree(build_dir) > > + # Stub out the source tree operations, so we don't have > > + # the defaults for any given architecture get in the > > + # way. > > + tree._ops = kunit_kernel.LinuxSourceTreeOperations(None, None) > > This runs and typechecks under mypy, but not under pytype. > The problem is that the first argument is type str, not Optional[str]. > > I think a fix would be to just use LinuxSourceTreeOperationsUml() instead here. > > Since you recently switched machines, you might want to run: > $ pip install pytype > > And then > $ ./tools/testing/kunit/run_checks.py > would run pytype and show you the complaints here. Oh, I see what you're doing here, we want to avoid the new step where UML now adds to the .kunitconfig file. Something like this could work - tree._ops = kunit_kernel.LinuxSourceTreeOperations(None, None) + tree._ops = kunit_kernel.LinuxSourceTreeOperations('none', None) or we could put 'fake', etc. If we're not happy with using this class directly (since it's meant to subclassed), an alternative, more targeted approach could be: mock.patch.object(tree._ops, 'make_arch_config', lambda x: x).start() But I don't like this and would prefer the above. Daniel