Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2467227pxb; Fri, 5 Feb 2021 20:21:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyl+wY5j/l2GEt30KIq1RjnTu38Rl+m9lzUM4vS97nVGbHJWkL3JLYEPSi6u2h4VUgqbqGP X-Received: by 2002:a17:906:1118:: with SMTP id h24mr840791eja.145.1612585281529; Fri, 05 Feb 2021 20:21:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612585281; cv=none; d=google.com; s=arc-20160816; b=JpYiNXVtPpQu+9j4BVRjMQtdttRX38MktGIqSHVTcHmTI3EDo3+m0LMlyBvWDPMz/6 3QY3N7I2fekq7wX7GTyD6OyOsMwhmCFyfCQ5KcjuTyMcQkZ560j/ZVofGSHP9USYlFp6 stmD5b2UGGxnQEbfEu7TRkrbqGSnvNOFRU8zr/9lgJg1BaRt5kluksH/mG/Lh/Hmc0zW nIURlStOsrlwBKxrpsmHMmZWNdFSd6HgEtag4pQLzQmfHR10p8Lx9+2TGu20JltfDPR+ lRkbsgSUV/5rMZ6zscul+jKj6Rg3VvWfpdNg8AeDjlz3dM4EQ48ApQg0/qNcpa6UnzeD /YfA== 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 :sender:dkim-signature; bh=i3/JC2Cwh7xZ8b0cCoTT3RVdoEzv5GBHxf2BMEc4UJ0=; b=BBx1wphQmgJZ3RHYUuVrPsiWJ4Yqfw9hnz7UEkLhco4d5G9FDtEP7iQGEm19HFPjz0 5H34Sl4s39y74fO4aT5CgjlreppnTkcFYru3rZlzuQaAV9pGvvlfkUCPJkMVKVeJyJMH fzR9gYIt0wq7gyt9KE2MIdoi1G56+CieK6Yt2e5YNLjwT0PZl8N24TzlLPWCoJkWzZeM M8JKezb9c463YM0oeFFakidsTmaKag2OvglT07eXnGo2u9SYpbpvJZDwqqIMlAVjdG8l eWAswtTayNYevrp1jqKo1QoxBvC7FcZXtbIYE2sYkZsMalWCBSOBFbmc/E0xfROvfeA7 lg9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="WUF/00cM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si6822446edd.505.2021.02.05.20.20.57; Fri, 05 Feb 2021 20:21:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="WUF/00cM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229783AbhBFET4 (ORCPT + 99 others); Fri, 5 Feb 2021 23:19:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbhBFCbs (ORCPT ); Fri, 5 Feb 2021 21:31:48 -0500 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93242C08EE15 for ; Fri, 5 Feb 2021 16:09:04 -0800 (PST) Received: by mail-pf1-x449.google.com with SMTP id a12so6103602pfh.19 for ; Fri, 05 Feb 2021 16:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=i3/JC2Cwh7xZ8b0cCoTT3RVdoEzv5GBHxf2BMEc4UJ0=; b=WUF/00cMWBAIrZtgcIEZ04af1Kbg95o3THqYe6MOel4ajWpgKa2+csrn7FA2Mm/XE1 nXdbnc9uTMo4xdIWW0kaeQoIu1GAeFPAf9Vby66h95Uc+quS62YNR9tgEySbIHLXc02j gSycaS6O7GXT6l2M3b21rLo7BkWlYIBYCplLCXDZqZMgRaQFvv7MEyeE6YxeZHZoaCn2 KfBr0d9z/BE/JDKEhIdKk8CmC9BsDbCEsdGlV5MAzppB9u2R+S0iR8TcC3VXYEw9b46K hAYcdf6U5BlPBK2aTuAn1gKDr9nm+FmURzKQK7K/cWp1RwSd3HpWyCMOCItFqFpYxHpI +/Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=i3/JC2Cwh7xZ8b0cCoTT3RVdoEzv5GBHxf2BMEc4UJ0=; b=gQZk2tWvmkp4hXQgilRoDplRc67zDMym3xoPJdZblbrZu/u1xA3EB2NE/kL3YsPdDx 6iz4wr1M4h8zCiTYNjNLlQjUp1t55RojfkYE699KGAfmnRNKJv9kiXsdG14k84r2HaEH FYm13D+NNV1/CS5ZqUiep9cQtYXfbzajy9FsmfQOxjomCZjFr7IjRXZI1ml3AExT0FDy HiH3f8PTbo41NMXR1NL8DxElvoABZFh6f/fKzQeh4TlURUUydLfbWrXhHRgbG/V/QUt+ NOF87bmqqxG4dcHWbbPAXYKuF8AYV3pUdssGA7U3hHlW4LddsvMRhTnc8KiI6fw6hr+W pzRA== X-Gm-Message-State: AOAM530lAqyDXkc94/1AiSw3bB2Ajz231e/Zfb6DWDBKj1MHflxNjlgq XjLrFcoi1NFlAgqeWN+jiLh7DyGpLAp3yA== Sender: "dlatypov via sendgmr" X-Received: from dlatypov.svl.corp.google.com ([2620:15c:2cd:202:a8b1:128a:69fa:86fb]) (user=dlatypov job=sendgmr) by 2002:a17:902:778e:b029:de:b475:c430 with SMTP id o14-20020a170902778eb02900deb475c430mr6143681pll.53.1612570144115; Fri, 05 Feb 2021 16:09:04 -0800 (PST) Date: Fri, 5 Feb 2021 16:08:51 -0800 Message-Id: <20210206000854.2037923-1-dlatypov@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.478.g8a0d178c01-goog Subject: [PATCH v4 0/3] kunit: support running subsets of test suites from kunit.py From: Daniel Latypov To: brendanhiggins@google.com Cc: davidgow@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When using `kunit.py run` to run tests, users must populate a `kunitconfig` file to select the options the tests are hidden behind and all their dependencies. The patch [1] to allow specifying a path to kunitconfig promises to make this nicer as we can have checked in files corresponding to different sets of tests. But it's still annoying 1) when trying to run a subet of tests 2) when you want to run tests that don't have such a pre-existing kunitconfig and selecting all the necessary options is tricky. This patch series aims to alleviate both: 1) `kunit.py run 'my-suite-*'` I.e. use my current kunitconfig, but just run suites that match this glob 2) `kunit.py run --alltests 'my-suite-*'` I.e. use allyesconfig so I don't have to worry about writing a kunitconfig at all. See the first commit message for more details and discussion about future work. This patch series also includes a bugfix for a latent bug that can't be triggered right now but has worse consequences as a result of the changes needed to plumb in this suite name glob. [1] https://lore.kernel.org/linux-kselftest/20210201205514.3943096-1-dlatypov@google.com/ --- v1 -> v2: Fix free of `suites` subarray in suite_set. Found by Dan Carpenter and kernel test robot. v2 -> v3: Add MODULE_PARM_DESC() for kunit.filter_glob. v3 -> v4: Rebase on top of kunit_tool_test.py and typing fixes for merging. Daniel Latypov (3): kunit: add kunit.filter_glob cmdline option to filter suites kunit: tool: add support for filtering suites by glob kunit: tool: fix unintentional statefulness in run_kernel() lib/kunit/Kconfig | 1 + lib/kunit/executor.c | 93 +++++++++++++++++++++++--- tools/testing/kunit/kunit.py | 21 ++++-- tools/testing/kunit/kunit_kernel.py | 6 +- tools/testing/kunit/kunit_tool_test.py | 15 +++-- 5 files changed, 115 insertions(+), 21 deletions(-) base-commit: aa919f3b019d0e10e0c035598546b30cca7bcb19 -- 2.30.0.478.g8a0d178c01-goog