From patchwork Tue Dec 3 18:08:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11271809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52C00112B for ; Tue, 3 Dec 2019 18:09:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D24020661 for ; Tue, 3 Dec 2019 18:09:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZFR6MePF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727212AbfLCSIp (ORCPT ); Tue, 3 Dec 2019 13:08:45 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43433 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbfLCSIo (ORCPT ); Tue, 3 Dec 2019 13:08:44 -0500 Received: by mail-wr1-f68.google.com with SMTP id d16so261110wre.10; Tue, 03 Dec 2019 10:08:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dVR4fIFnqBj1P8D1zyzrE8lPHinFuQJmdruk8S76xeM=; b=ZFR6MePFa1i+dE+IejZsEVQ+ggVuhk+uX1/eyUtgpVLYaLp9cXVcfB5fhq7g4JhtHq qh4IsKFVoECDrgukBm+aYjjatsHRlStMekjNLOsDcovS7qemIPa0XeSQWE+PgMLO7qVw uE5yvGQ2DkYnLMTvdVswWi/0pxPjv8/oifVwT+hC12FiUDWnpPQT1V0xhVMRpBIT7VkX CeA5T44Krb5XUJKG2jO8iSaGi6JeKMiz2f3ySOShCXS0iuEM0SsvEamncWK2XS6dahlW s9skNbf4B88DW2UPR6XO263+7WxoGLOBIicDK8nQCNMH6L6AKpjapSyqLGqR3xf2trTW 6nHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dVR4fIFnqBj1P8D1zyzrE8lPHinFuQJmdruk8S76xeM=; b=F+ZuRs0BQATX8zOglSPZwgh+5BTNrpDZGaednYNMeKidxBhPxPbq9RbQHi4sJeWDp+ AAZlRLl7uoybsp65whZ3utj8uMTDAT/pPFbrCH9YG0m3XqFi7kR3puicZgDdCgu2llt5 UXJmYi5MKiaOjZITdKaG7wx0o513aB8Ow62OMilVgtcKxwMzwjD+xlKL9ZT8VhbZmGe8 Ru7rwXjCLf9mrFs+FA58UfL/zaAh3Kd3Fkj5lm1RPEmfgWjc4BSuE2z++PN3zFISWiZM fpE1kEg5SnkyqKoq3m04JnBdeAWSIB/+rlMw2m/1pu5mCmyIaEkpuy6h/SH+oJLKWXGX rIrw== X-Gm-Message-State: APjAAAXz2CQjageHOQIflxzdMijCY+lTZlXYEh2S7drOzsRGuqIV+E6K 0ezgKWViCInwuoT646BZRqM= X-Google-Smtp-Source: APXvYqykqh6vdQpsd+DKnRDsKk+uqB69pXw67V4k68Eh4ZMPioC4HmgJ/ZPhkcPAbqBeclwUq8gV5A== X-Received: by 2002:a5d:6ca1:: with SMTP id a1mr6470527wra.36.1575396522250; Tue, 03 Dec 2019 10:08:42 -0800 (PST) Received: from localhost.localdomain (cable-86-56-100-90.cust.telecolumbus.net. [86.56.100.90]) by smtp.gmail.com with ESMTPSA id f11sm3847641wmc.25.2019.12.03.10.08.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 10:08:41 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com Cc: corbet@lwn.net, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, sj38.park@gmail.com, sjpark@amazon.de Subject: [PATCH v3 1/5] docs/kunit/start: Use in-tree 'kunit_defconfig' Date: Wed, 4 Dec 2019 03:08:24 +0900 Message-Id: <1575396508-21480-2-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> References: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: SeongJae Park The kunit doc suggests users to get the default `kunitconfig` from an external git tree. However, the file is already located under the `arch/um/configs/` of the kernel tree. Because the local file is easier to access and maintain, this commit updates the doc to use it. Signed-off-by: SeongJae Park Reviewed-by: Brendan Higgins --- Documentation/dev-tools/kunit/start.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index aeeddfa..78a0aed 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -29,9 +29,8 @@ regular Kernel config, with the specific test targets as well. .. code-block:: bash - git clone -b master https://kunit.googlesource.com/kunitconfig $PATH_TO_KUNITCONFIG_REPO cd $PATH_TO_LINUX_REPO - ln -s $PATH_TO_KUNIT_CONFIG_REPO/kunitconfig kunitconfig + cp arch/um/configs/kunit_defconfig kunitconfig You may want to add kunitconfig to your local gitignore. From patchwork Tue Dec 3 18:08:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11271811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20919112B for ; Tue, 3 Dec 2019 18:09:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF3472080F for ; Tue, 3 Dec 2019 18:09:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hKyaRaxt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727290AbfLCSJA (ORCPT ); Tue, 3 Dec 2019 13:09:00 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38962 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727206AbfLCSIp (ORCPT ); Tue, 3 Dec 2019 13:08:45 -0500 Received: by mail-wr1-f65.google.com with SMTP id y11so4891722wrt.6; Tue, 03 Dec 2019 10:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fspx7bIXXs0k8mMRF6gpjQkO0Aw1T/BQQAXOr83Gdx0=; b=hKyaRaxtc9iaT45IweuHESVDA4caCMdb7T+Bl1ZoEQFIDVQgv2OARPq3JfRa03Q192 9InfjsvAfjiqt/tLV+H+pC2aSWfpiUNEZIRbflt25FMjU7iJHCDqp+nkdVU2fgA449WF Fsaa4iCWFLL6I6OKI3cViC3jIRyO+p/5+oVbHNNVrRHPPgRKs/G0YIdCtteldfv1bxJP TWS3VANBwEqvldoIp38N48uM4PUw7VUGssv0D15HYtw5FvBeXN6S08byGRl6Rq+GNklY +QpDyL2nowooD2FyfsBYd5MV3mHZGNkr5/DZlUewlwP7ublaINeg09j3ok3JdbS6Qb/d rpAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Fspx7bIXXs0k8mMRF6gpjQkO0Aw1T/BQQAXOr83Gdx0=; b=MJiD4C5OOrBgwsHFRR8eVtR8bhPZnwkWQIUPxnir5QCmt3d4ocxa1E1eowi2x7r2fw Ev4IVnvg4gKDfF31Re94UchVlkZeZoyFWUGdRSw43E305H3r/uHmAVVgV0q9F3PAhFej jzAWvyPEbnn2TqDVilY+eQWbDILwav6MFDRdLJjrf6lbgx7YtHJo3Er9Vk+pRA/H9jvv g1BvnvDW2v0wL0KIUSEkdiNHFW79zvtQkhr+Lde30yhADqYppiGAMjSZ6U6GjZpmNpaF 8cttwet1dtkIRXVhNt6ENqT8owMupyuzR+41A2mUuYb08/GE/6ub/CqcF6SyfPS+jWHD 3eig== X-Gm-Message-State: APjAAAUOtr2qPM11nPvJxF3OHHZmIBB7hFpiAD34CMVrD8rOLDaATaCW z8Ma/ceYw9vs1ld10s00pXk= X-Google-Smtp-Source: APXvYqxwVeda6AJH+unoZ0ri/RM91nuhADVTjGSRVMc86r3Jhdn9f0i+Kl1S+MwTlxxIOjvXgzOitQ== X-Received: by 2002:adf:f606:: with SMTP id t6mr6450005wrp.85.1575396523754; Tue, 03 Dec 2019 10:08:43 -0800 (PST) Received: from localhost.localdomain (cable-86-56-100-90.cust.telecolumbus.net. [86.56.100.90]) by smtp.gmail.com with ESMTPSA id f11sm3847641wmc.25.2019.12.03.10.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 10:08:42 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com Cc: corbet@lwn.net, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, sj38.park@gmail.com, sjpark@amazon.de Subject: [PATCH v3 2/5] kunit: Remove duplicated defconfig creation Date: Wed, 4 Dec 2019 03:08:25 +0900 Message-Id: <1575396508-21480-3-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> References: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: SeongJae Park '--defconfig' option is handled by the 'main() of the 'kunit.py' but again handled in following 'run_tests()'. This commit removes this duplicated handling of the option in the 'run_tests()'. Signed-off-by: SeongJae Park Reviewed-by: Brendan Higgins --- tools/testing/kunit/kunit.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index efe06d6..f8f2695 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -37,9 +37,6 @@ def create_default_kunitconfig(): def run_tests(linux: kunit_kernel.LinuxSourceTree, request: KunitRequest) -> KunitResult: - if request.defconfig: - create_default_kunitconfig() - config_start = time.time() success = linux.build_reconfig(request.build_dir) config_end = time.time() From patchwork Tue Dec 3 18:08:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11271807 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49F1A6C1 for ; Tue, 3 Dec 2019 18:08:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2367120803 for ; Tue, 3 Dec 2019 18:08:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TPAqcrUB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727259AbfLCSIr (ORCPT ); Tue, 3 Dec 2019 13:08:47 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46838 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727225AbfLCSIr (ORCPT ); Tue, 3 Dec 2019 13:08:47 -0500 Received: by mail-wr1-f68.google.com with SMTP id z7so4823395wrl.13; Tue, 03 Dec 2019 10:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=utI8T3ub3njoo3SG3qDSzeTSz7Igjg4spb9ZghayKKs=; b=TPAqcrUBFgsNoCNlfTYvD79cGW3We4dCSvEpwKac8sXZjVaROaRAC6byzyAvOp3tD7 j4aELxcnPwwj/TyFchTPDxOY/IT1ZzWlIrpNYwlJDZoagOeyF23RjmS6iqngebj7d5WC i5bjSovI+wJlea+K1Xn1TwkSP3bobu/DtA80K/4w12J8o9uogkRtY44izC6F3D76jXxE sXTQuw5adD2ZX6YffnKEnq0K/cU4H5JHWRvB2n/QXFLSSFhHsem+hCWnHOIyZvydVNsY MtAH+54bmIFybguY/MT1hXxkn6HK23qiNgcM6I+DM6muMr6e0CYQ7kAER7eLgfdlxQ0r sziQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=utI8T3ub3njoo3SG3qDSzeTSz7Igjg4spb9ZghayKKs=; b=Kg05LaULpBfBN+ycZg8xuRytMPUdutXb6T6VjUJSlawUiPHpb0CXPh129e/wv8dfxg EIOpYhPDk2lvsMcT6Gd3O/a0Jdfh6XMvk/WSPIbdEgllHb3BE9nWc+dx8DLacJSwxy3b EV2hNvrweBSq8ecdeVXNp29iEf9bVdWkGYL4xGhZXmUOOwcThgLchhegBw7/FHT+pGB8 p42Mcgv7LTjjy/nsLzBQXXhup8562xfmoZvDUXEfx1PMYWqKZEbbXp24JmXx19xCkQkO PcCWYWLU8gM0qLet9RqyEi6KE5o+hXefBnqOhO1hI5xPhHxOKhS07I6m9dDaINjOX5Uu mOsw== X-Gm-Message-State: APjAAAXmZ4pG3zdn3GWybS/YaevdySbLUYT0NUEfjWoiCdt3DPS5AJvd BEZWyTfVopECrfa72ZjMQCg= X-Google-Smtp-Source: APXvYqw3TlmYnGRbwHnOsrvUt+RJYDvE7lNoIJCWOMCOhMzR3oNZs3vvtEGjD6vhoYuTqhE9HzsVXw== X-Received: by 2002:adf:ee88:: with SMTP id b8mr6981474wro.249.1575396525182; Tue, 03 Dec 2019 10:08:45 -0800 (PST) Received: from localhost.localdomain (cable-86-56-100-90.cust.telecolumbus.net. [86.56.100.90]) by smtp.gmail.com with ESMTPSA id f11sm3847641wmc.25.2019.12.03.10.08.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 10:08:44 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com Cc: corbet@lwn.net, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, sj38.park@gmail.com, sjpark@amazon.de Subject: [PATCH v3 3/5] kunit: Create default config in '--build_dir' Date: Wed, 4 Dec 2019 03:08:26 +0900 Message-Id: <1575396508-21480-4-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> References: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: SeongJae Park If both '--build_dir' and '--defconfig' are given, the handling of '--defconfig' ignores '--build_dir' option. This commit modifies the behavior to respect '--build_dir' option. Signed-off-by: SeongJae Park Suggested-by: Brendan Higgins Reported-by: Brendan Higgins Reviewed-by: Brendan Higgins --- tools/testing/kunit/kunit.py | 11 +++++++++-- tools/testing/kunit/kunit_kernel.py | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index f8f2695..5b22241 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -31,9 +31,9 @@ class KunitStatus(Enum): TEST_FAILURE = auto() def create_default_kunitconfig(): - if not os.path.exists(kunit_kernel.KUNITCONFIG_PATH): + if not os.path.exists(kunit_kernel.kunitconfig_path): shutil.copyfile('arch/um/configs/kunit_defconfig', - kunit_kernel.KUNITCONFIG_PATH) + kunit_kernel.kunitconfig_path) def run_tests(linux: kunit_kernel.LinuxSourceTree, request: KunitRequest) -> KunitResult: @@ -114,6 +114,13 @@ def main(argv, linux=None): cli_args = parser.parse_args(argv) if cli_args.subcommand == 'run': + if cli_args.build_dir: + if not os.path.exists(cli_args.build_dir): + os.mkdir(cli_args.build_dir) + kunit_kernel.kunitconfig_path = os.path.join( + cli_args.build_dir, + kunit_kernel.kunitconfig_path) + if cli_args.defconfig: create_default_kunitconfig() diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index bf38768..c04a12e 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -14,7 +14,7 @@ import os import kunit_config KCONFIG_PATH = '.config' -KUNITCONFIG_PATH = 'kunitconfig' +kunitconfig_path = 'kunitconfig' class ConfigError(Exception): """Represents an error trying to configure the Linux kernel.""" @@ -82,7 +82,7 @@ class LinuxSourceTree(object): def __init__(self): self._kconfig = kunit_config.Kconfig() - self._kconfig.read_from_file(KUNITCONFIG_PATH) + self._kconfig.read_from_file(kunitconfig_path) self._ops = LinuxSourceTreeOperations() def clean(self): From patchwork Tue Dec 3 18:08:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11271805 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 908716C1 for ; Tue, 3 Dec 2019 18:08:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B7FA2080F for ; Tue, 3 Dec 2019 18:08:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ekwJ0ErR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727296AbfLCSIt (ORCPT ); Tue, 3 Dec 2019 13:08:49 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40864 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbfLCSIs (ORCPT ); Tue, 3 Dec 2019 13:08:48 -0500 Received: by mail-wr1-f68.google.com with SMTP id c14so4879472wrn.7; Tue, 03 Dec 2019 10:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x54qeaA6lnhhJC5TBmsbkdVTvf2Oqp7EQuSTFX3fSbQ=; b=ekwJ0ErRBR2nGmvyT1ADqbt1ZEI0OsPOrO5QN2jY86mfvc4OUIhxK+HnjPHUQZNyK7 vq29RaNP1XMXIFz9qZjGdI2MPO6uneY7w5VAH9RxyP5C9PoyeEjcQmnQK2lnpYbzX11A g2alW1+y046jgO4LYi3w0XOG9sm+R4XhgpIRSI1DGm1eryLeZQ/upY6QgpH+TXwGcaHT ADcKbNa3whGejqSgviTedUkOjqGUMabfak1qDxAOkJztOytZK7JR15POx34CsQO3mKC8 Oslugs2NaMNj8ZeTOWCIw5ugUKIGR9a80f6auq7x7EZLwKr5uTy1qpEZdMLbfKrHiA1U F6Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x54qeaA6lnhhJC5TBmsbkdVTvf2Oqp7EQuSTFX3fSbQ=; b=gb/1V74JpagK8JejpvySzYmtoVwdvVqlazB/zgE8QCqRLkqWahHfoC0XKMKfOXLuDp tua7yIjsuFBdYClCBxFQNXjdvLOmzo68Xv08tY2H2V7e+q8dRR9ACkeA7ylixzId4rXC LCayqxyhY/zWLGGOgUEDjDxWcWCfsRizKOLWkDDE7OzbuvA7Sg9+7bOCzgm2xQCUCsJJ yk0fb8bo6Ov3w1y+Qii133fZ523X15+zwKmgJm9firKeInzG98fuLIeK8uezo6xxjrKB JRmyYEdgbZniHWs3PM7q/EKl3mTg2kHmO58ASFEZWHnty58bUTyfVsoCnbohD+TEPDIQ 9+dA== X-Gm-Message-State: APjAAAX63nsmpwsj3NkA0PM2D8gBpHMILcUPJsYJcg7JM4xi1gB1NAEj FBOc1Nk9XPPAaxv3fbuQR2k= X-Google-Smtp-Source: APXvYqxksk1sT2ZZdAJxnzOVW5/5ECpcZrfCYxKcazhIOcGu3CMRqfFJX/Xnh6ZGkKyllyN8vWnwdA== X-Received: by 2002:a5d:4b47:: with SMTP id w7mr6999917wrs.276.1575396526558; Tue, 03 Dec 2019 10:08:46 -0800 (PST) Received: from localhost.localdomain (cable-86-56-100-90.cust.telecolumbus.net. [86.56.100.90]) by smtp.gmail.com with ESMTPSA id f11sm3847641wmc.25.2019.12.03.10.08.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 10:08:46 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com Cc: corbet@lwn.net, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, sj38.park@gmail.com, sjpark@amazon.de Subject: [PATCH v3 4/5] kunit: Place 'test.log' under the 'build_dir' Date: Wed, 4 Dec 2019 03:08:27 +0900 Message-Id: <1575396508-21480-5-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> References: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: SeongJae Park 'kunit' writes the 'test.log' under the kernel source directory even though a 'build_dir' option is given. As users who use the option might expect the outputs to be placed under the specified directory, this commit modifies the logic to write the log file under the 'build_dir'. Signed-off-by: SeongJae Park Reviewed-by: Brendan Higgins --- tools/testing/kunit/kunit_kernel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index c04a12e..5bec97e 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -143,7 +143,7 @@ class LinuxSourceTree(object): def run_kernel(self, args=[], timeout=None, build_dir=None): args.extend(['mem=256M']) process = self._ops.linux_bin(args, timeout, build_dir) - with open('test.log', 'w') as f: + with open(os.path.join(build_dir, 'test.log'), 'w') as f: for line in process.stdout: f.write(line.rstrip().decode('ascii') + '\n') yield line.rstrip().decode('ascii') From patchwork Tue Dec 3 18:08:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11271803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01E036C1 for ; Tue, 3 Dec 2019 18:08:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D013620661 for ; Tue, 3 Dec 2019 18:08:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TqWyU0JY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727316AbfLCSIv (ORCPT ); Tue, 3 Dec 2019 13:08:51 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:32836 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727290AbfLCSIt (ORCPT ); Tue, 3 Dec 2019 13:08:49 -0500 Received: by mail-wr1-f65.google.com with SMTP id b6so4967972wrq.0; Tue, 03 Dec 2019 10:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3nP6VZ8Fjqwgvw9G0ddXuiCEaSnGP/358VA7wzbcUPI=; b=TqWyU0JYS/1QxWfJrpgPb0N3WdqRrJMsCIXH26w2dmUVLbCq//aExSX3fVv1Z/XTiy /5PtnOUdGo8/wT1ifLbawDVCAseNygP8jl0iVfnDXg9TkSPaRH29AI8dpTbZqR5nxYzO 19fpDGKUmizGcJAe02oKx8uRBO8e0VB/Y4z1c+kTFHk6IxwYaBwTJNAewyFlHI8RxIwQ QGm2JQhy6WJoQnAJ07Q+9C3f6aX1Ltwqq6s5plp0fGCuXT7QmHaT2fbZI/05ujj2omgB Lkze9Ppo4CcF5Lt6LvYrYjpuooEFlxhmNf/Hc1UFVKAhX5EJMedLVk0faDRDmHqFYcVt RpCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3nP6VZ8Fjqwgvw9G0ddXuiCEaSnGP/358VA7wzbcUPI=; b=NinNYLuwutl5MLJOn+bZnhUXxKF2V51Ijn1DXSNQ8TzlO66FsuTw3ucwW4+Y4OZHow Pxijikit2cKRq2JY+x0lx/bucJTVuirPH0/rgKNt3O6NMWRnbDz4JnXc+SFuPRQjOvuA 9B+WqYU69XkBUzr8IKGSMsZf0S+9fMhRveqPd6LPxBUdYp/e8i80boVXWbh9RxP3uCf2 nWDt7L/jXYx2EChuMuJNsUVchMA1BfxMIuPuzdX7rOHPcCXuevC8zIvHa5l+DaLX/vJT ZmF23CHmRYj0g5PN28RftjwYl+tXjGO6QkS8hnDcOwCLEcA+pHfe8Q7KoeX821ZKIYvJ zk6A== X-Gm-Message-State: APjAAAUBLWUxhdiz74QgODtw4PhJQVk9YibqJj2pwhqFuHssKF5/DwvO HKrroDsyrujy26n6Gm9IBwo= X-Google-Smtp-Source: APXvYqxunmSS3YEJs+zJB8zE7O7p6NgDz/9D7hcFGKvEsuTvUE5qFlMI3ca8sfDP1HhRV/Fb0t7tgQ== X-Received: by 2002:a5d:608a:: with SMTP id w10mr6229894wrt.136.1575396527796; Tue, 03 Dec 2019 10:08:47 -0800 (PST) Received: from localhost.localdomain (cable-86-56-100-90.cust.telecolumbus.net. [86.56.100.90]) by smtp.gmail.com with ESMTPSA id f11sm3847641wmc.25.2019.12.03.10.08.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 10:08:47 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com Cc: corbet@lwn.net, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, sj38.park@gmail.com, sjpark@amazon.de Subject: [PATCH v3 5/5] kunit: Rename 'kunitconfig' to '.kunitconfig' Date: Wed, 4 Dec 2019 03:08:28 +0900 Message-Id: <1575396508-21480-6-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> References: <1575396508-21480-1-git-send-email-sj38.park@gmail.com> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: SeongJae Park This commit renames 'kunitconfig' to '.kunitconfig' so that it can be automatically ignored by git and do not disturb people who want to type 'kernel/' by pressing only the 'k' and then 'tab' key. Signed-off-by: SeongJae Park Reviewed-by: Brendan Higgins --- Documentation/dev-tools/kunit/start.rst | 12 +++++------- tools/testing/kunit/kunit.py | 2 +- tools/testing/kunit/kunit_kernel.py | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index 78a0aed..faa6fa9 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -21,18 +21,16 @@ The wrapper can be run with: ./tools/testing/kunit/kunit.py run -Creating a kunitconfig -====================== +Creating a .kunitconfig +======================= The Python script is a thin wrapper around Kbuild as such, it needs to be -configured with a ``kunitconfig`` file. This file essentially contains the +configured with a ``.kunitconfig`` file. This file essentially contains the regular Kernel config, with the specific test targets as well. .. code-block:: bash cd $PATH_TO_LINUX_REPO - cp arch/um/configs/kunit_defconfig kunitconfig - -You may want to add kunitconfig to your local gitignore. + cp arch/um/configs/kunit_defconfig .kunitconfig Verifying KUnit Works --------------------- @@ -147,7 +145,7 @@ and the following to ``drivers/misc/Makefile``: obj-$(CONFIG_MISC_EXAMPLE_TEST) += example-test.o -Now add it to your ``kunitconfig``: +Now add it to your ``.kunitconfig``: .. code-block:: none diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index 5b22241..257722f 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -108,7 +108,7 @@ def main(argv, linux=None): type=str, default=None, metavar='build_dir') run_parser.add_argument('--defconfig', - help='Uses a default kunitconfig.', + help='Uses a default .kunitconfig.', action='store_true') cli_args = parser.parse_args(argv) diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index 5bec97e..fca1933 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -14,7 +14,7 @@ import os import kunit_config KCONFIG_PATH = '.config' -kunitconfig_path = 'kunitconfig' +kunitconfig_path = '.kunitconfig' class ConfigError(Exception): """Represents an error trying to configure the Linux kernel.""" @@ -111,7 +111,7 @@ class LinuxSourceTree(object): return True def build_reconfig(self, build_dir): - """Creates a new .config if it is not a subset of the kunitconfig.""" + """Creates a new .config if it is not a subset of the .kunitconfig.""" kconfig_path = get_kconfig_path(build_dir) if os.path.exists(kconfig_path): existing_kconfig = kunit_config.Kconfig()