From patchwork Tue Dec 3 08:18:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11270813 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 717011593 for ; Tue, 3 Dec 2019 08:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5175F206EC for ; Tue, 3 Dec 2019 08:19:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BBgi+WWq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726452AbfLCITR (ORCPT ); Tue, 3 Dec 2019 03:19:17 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39548 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbfLCITR (ORCPT ); Tue, 3 Dec 2019 03:19:17 -0500 Received: by mail-wm1-f67.google.com with SMTP id s14so2365713wmh.4; Tue, 03 Dec 2019 00:19:15 -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=BBgi+WWqAttoUkdZsDU5N6LxlC+t8hvemSP8NZWg8F9Dj1P0/4UrRbC9aa5omO1IJQ q5XTvMzBWPrKmp486nQgcaLKN04np240K10uGf+ORgU+p4gS/4za7/o0ANKAHNHF4xfm eWFiNM4WweY6Lhfn5JLALOTyASRS6tYsf5a8P+cJiZF9b4pC9VWfFMo32+wIP03DqEeu 1LP0e0+SGrb2nZiwWXq5g6tCj4TS/OvIwctlyMcFZMVEDs18efTR1klq5VL8xrLr7kTo dSEMvUZZm8nLUGxfTgotrvQxXJhiNjq9p02rvZM0WOEhjO0X7whASlOy4yuYpCGUIMvz bkeA== 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=pfF6TI3ZG4eSKxCoorQTdVsRDJtsb35TrlwrYzU26SZO4Gl+Xs3x1Pk0GXVXJwCp+I R7c1uzNjBTRwQxmVteU2NVrF6xTCx1gxSkmgPWyfB+TlcvKIukqF4CatVrlnIzgi/2oX fzNtEd6NcjhURIIGBzgd25ateCR1RE6cH+hIuepovnQWoU3DqVOTUneigPmy/Eb9zgkN 1jxkGaxb+VX7hiDzs/U3Pd0Km/oriy8LdZmRuqPR4FIY62skRh9phA8YgjaIuys4dAcD MSH59Kp8riQSeogbl4NfQbxoqDIslfyCY73keqGBlfSZrFQPADQLgBqC5+DOC2uMpy6j nofw== X-Gm-Message-State: APjAAAX0aRIVvYM2W4cNOtxb5n+JJr0ZYlmv4tmY/CGLbqm5V+T4dUh+ Prri6sxEwyP7S84+PXW7P00= X-Google-Smtp-Source: APXvYqy0tqj03oWE45FyTibwSYi6op8KSBZc9QWMHOxtWPIBnhiU58JJnMP0yJ7VaLJMRRTOpAR5bg== X-Received: by 2002:a7b:c0d8:: with SMTP id s24mr29443182wmh.30.1575361154886; Tue, 03 Dec 2019 00:19:14 -0800 (PST) Received: from localhost.localdomain (p50991abe.dip0.t-ipconnect.de. [80.153.26.190]) by smtp.gmail.com with ESMTPSA id 188sm2048197wmz.13.2019.12.03.00.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 00:19:14 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com, shuah@kernel.org Cc: corbet@lwn.net, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, sjpark@amazon.de Subject: [PATCH v2 1/5] docs/kunit/start: Use in-tree 'kunit_defconfig' Date: Tue, 3 Dec 2019 17:18:57 +0900 Message-Id: <1575361141-6806-2-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575361141-6806-1-git-send-email-sj38.park@gmail.com> References: <1575361141-6806-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 08:18:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11270811 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 454DD13A4 for ; Tue, 3 Dec 2019 08:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2665A206EC for ; Tue, 3 Dec 2019 08:19:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XWJCfFkr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbfLCITT (ORCPT ); Tue, 3 Dec 2019 03:19:19 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:37032 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbfLCITS (ORCPT ); Tue, 3 Dec 2019 03:19:18 -0500 Received: by mail-wm1-f66.google.com with SMTP id f129so2385431wmf.2; Tue, 03 Dec 2019 00:19:16 -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=XWJCfFkrPHe1Ba4cyqiTHzY629AzEtC9/bijTztY+Chrta5eejzLI9UnDAqC8O3LeW ung4QmEBfsb6D9D14RKydctfEOmEsHEtcuoY99+RUJS33soqYy9JTIxLchAunK8kkpgO opaLm2qYdHDUnxrF1v3C2dXBum3OiapGU/EAAlAThDMAHf1iz0j1Y/OcDvKIbN3O9UYp XwggjFQpIGqSLcvu/AcpPggCAIBfgJ9uEUoNPRI7l5Oh6l0nzyY0/8hDiKF+56Gc+IBo UO1Ig4s030zMF5/PXqqHRmYhOk55Dad/YLhjU2XQ7NRjEFCOaXzYN0JrkUBsaKDPNPBQ rLFQ== 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=BI9EQAUXzajZhsgba7oGrRhFWm6UXaBWD8sn03rAnOWndJdxolzKDvyLr6O9DkLEAw DqztR13tnaywHh8WwE+N9MpcMtpwui9gJsiVV55VVjzlyJd3F9AaANwlo1JrDKocVhw+ N0ory1GUmqIBrf1BRLg0PX6qDrY0WUj0CjXd4AXUmTGpGxh1K7vpiNqciIVxJOwkhpM4 io9FBtvDlB2P2nFLAxdGj4011Q6pHNSz1oaEYFlUJSchq2g2e/6Es40dL7W5VJcKxW4G EBdvss1euilqU7c7OHzQhRJOGkBstOCqR1VFBCpLvI4hMT1u9ivnpKC1HwErTrW6tQbx Fyuw== X-Gm-Message-State: APjAAAUBZLnQvFt0MEY2VEi0XD18FuedU5WilvX32mQfTfMSl2brAGS8 iiToK+ZC/uR2NlxHjOCoe2g= X-Google-Smtp-Source: APXvYqwtzqgb604MYHUY923Uhk6K2ccj3q0xJ14ecw55x0JbrMqhaFx9/7cnGm/XmCXNugQzRxFnAg== X-Received: by 2002:a1c:9e58:: with SMTP id h85mr34239551wme.77.1575361156150; Tue, 03 Dec 2019 00:19:16 -0800 (PST) Received: from localhost.localdomain (p50991abe.dip0.t-ipconnect.de. [80.153.26.190]) by smtp.gmail.com with ESMTPSA id 188sm2048197wmz.13.2019.12.03.00.19.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 00:19:15 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com, shuah@kernel.org Cc: corbet@lwn.net, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, sjpark@amazon.de Subject: [PATCH v2 2/5] kunit: Remove duplicated defconfig creation Date: Tue, 3 Dec 2019 17:18:58 +0900 Message-Id: <1575361141-6806-3-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575361141-6806-1-git-send-email-sj38.park@gmail.com> References: <1575361141-6806-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 08:18:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11270809 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 A240613A4 for ; Tue, 3 Dec 2019 08:19:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 814BC2073F for ; Tue, 3 Dec 2019 08:19:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iZdF/isV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726190AbfLCITb (ORCPT ); Tue, 3 Dec 2019 03:19:31 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42313 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbfLCITU (ORCPT ); Tue, 3 Dec 2019 03:19:20 -0500 Received: by mail-wr1-f66.google.com with SMTP id a15so2445325wrf.9; Tue, 03 Dec 2019 00:19:18 -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=sxVxvQmhg7LzrPKzHlacPLZnPKCitY+jA/j0y588woI=; b=iZdF/isVr0+lhgJgHIclUn/T/ujKA4Ofwgus5QlQk3IvcTdRfl3bCp1ulO0smK0p7O MCRzRo2HjT3ERIOlrUUhHZU8R4OTtA9ZVAKQXxwWOzUt0kQx+tjL6InrWBM6VvL3xXYW R8EqrWfveut5XteLUdD5i8yPABV7Ich0HlZIzDQu19im2jejkl1rParrYMBj97UTqwSE KP/NyGYLul6bUsXv/q+QTnEEXWZw/3ZqanVBvmeOdZUVdiPLI/zh22d5BjPtt4mLdPdt pqFuNvR6hXD8YEBChrh9D/JWhjgzUMpPkbKQrnmZd+MnoV94KDVw5lDSWYhBLy6B63Kj khEA== 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=sxVxvQmhg7LzrPKzHlacPLZnPKCitY+jA/j0y588woI=; b=G/JJ9xtxqNTvTTJsiDDsmunDkpdnhSUsgzeA/TgGoOKMG4HUNbw0KAyQBjHQeCBviy YfdPaur3TPh07Ddupe4TKltUxZtqOw7fA0XAXZoOZ7BtDiCy9zCZ5/IaQbZdC8OS9dZJ 7yGrTMg1tk/HXf0efwV0adpDXd50E0ayD/2xgyu5UmVQLb9eEHdLVQ/mRpxCRlBW+2eH JNjByofMxN9NsjL+ssoCtujwy2w4g/xpMfIOTG9GW0IpCs74NbAUhI0uYflaV2MuTD41 n3UBrE97AdBBdr9OfUeKCwL/rdYxYDTcxqOtq59jYvUdske/oc0MqYDiEYIdnlyA/J+/ WtWQ== X-Gm-Message-State: APjAAAVTr5ojumtV2c6pjYTewKYkxnKxgtBXiSSH8DNSEV37fNs5/Ima ifNaVY3eQOO3h1OCcNJA8W8= X-Google-Smtp-Source: APXvYqzPduh/ecAUf0bT8pY0t3aKgtKtdT/tClgE3f3TBy8UaMBUnUBYheqOUSJSVq7uBOZMuXrIfQ== X-Received: by 2002:a05:6000:367:: with SMTP id f7mr3608473wrf.174.1575361157508; Tue, 03 Dec 2019 00:19:17 -0800 (PST) Received: from localhost.localdomain (p50991abe.dip0.t-ipconnect.de. [80.153.26.190]) by smtp.gmail.com with ESMTPSA id 188sm2048197wmz.13.2019.12.03.00.19.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 00:19:17 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com, shuah@kernel.org Cc: corbet@lwn.net, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, sjpark@amazon.de Subject: [PATCH v2 3/5] kunit: Create default config in '--build_dir' Date: Tue, 3 Dec 2019 17:18:59 +0900 Message-Id: <1575361141-6806-4-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575361141-6806-1-git-send-email-sj38.park@gmail.com> References: <1575361141-6806-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 --- tools/testing/kunit/kunit.py | 9 +++++++-- tools/testing/kunit/kunit_kernel.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index f8f2695..02a54d8 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,11 @@ def main(argv, linux=None): cli_args = parser.parse_args(argv) if cli_args.subcommand == 'run': + if 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 08:19:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11270805 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 5718F13A4 for ; Tue, 3 Dec 2019 08:19:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 356A820659 for ; Tue, 3 Dec 2019 08:19:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EaFrvuF1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbfLCITV (ORCPT ); Tue, 3 Dec 2019 03:19:21 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41682 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfLCITV (ORCPT ); Tue, 3 Dec 2019 03:19:21 -0500 Received: by mail-wr1-f66.google.com with SMTP id b18so2446142wrj.8; Tue, 03 Dec 2019 00:19:19 -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=EaFrvuF1S5hhmzUC76mTiY3HPdLuj0+RgiKfW7SS45FEHSht+ipE7VedfJlyouwFkx FTrD3ciVl6iNEWuF77uTERQ+9JfY2DYRr32N3kI4P6co4RtJO93i4uSmGUYYEOBwgMuX 2ReZNRt2c+Ycwx66kDdo7PgsFPk9sWR1FczYernokfSnZxUBJA822TfH01GvCEPr7Cli qFzwYX3FDLrcKHudyuNyluW0kkraHmoYgoM6ez/FMya7bYzZQ2YeQwQnEqPQEnynnRwg 0TK6/n3Eg++k2WtnbjoSgGooNH6twRSacTR4/IkAEVYJE7nxnK4kcDjGIseIRUL1OFJu LDMQ== 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=GYOgIvJ9pchDYvDfysb//MTVWyGK6mOQNoZXH1ADa9s4GOxpLJAs+VVXHq57T/Ylt1 qm+ZoXnV+NA4Ef+pItGfn9lNeMCfpTRayG7GAGKfJXIBzs55I9kjN/je7fDTFrvEORhx nSrlDtkaZa73NsX9E2/vZUgT1cNr95rWXjz8chGoVz7rrsRrFE1BHXInGRD7rzs1+5e+ ZBIsdrUC8+bFElek7nTgRj9snQhCRxzNjg7qFjUotoBQgfjvrQbrre2rYLvbj48BOVCw jfVwrJ96YDOQTicZMOQV/nXWSnQH3YG5m4EM0BAHOZBQsmc6LO0/PUsBVVNrwoMWKs6c uDYw== X-Gm-Message-State: APjAAAXrcv6O9QUdLB9lLLc1lhLkm19TN5XW8/axu9Rep85L2iViWFUi tt6PC4teo+VRUuyBFWxfD0wXJicd X-Google-Smtp-Source: APXvYqxU5z5BUxoGxZV/IuHWZpw1B7M5IxrBog2ie+TwtWqK704jwMpWkyaAZbpQqujW5qknp36PRg== X-Received: by 2002:adf:fe8c:: with SMTP id l12mr1901628wrr.215.1575361158753; Tue, 03 Dec 2019 00:19:18 -0800 (PST) Received: from localhost.localdomain (p50991abe.dip0.t-ipconnect.de. [80.153.26.190]) by smtp.gmail.com with ESMTPSA id 188sm2048197wmz.13.2019.12.03.00.19.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 00:19:18 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com, shuah@kernel.org Cc: corbet@lwn.net, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, sjpark@amazon.de Subject: [PATCH v2 4/5] kunit: Place 'test.log' under the 'build_dir' Date: Tue, 3 Dec 2019 17:19:00 +0900 Message-Id: <1575361141-6806-5-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575361141-6806-1-git-send-email-sj38.park@gmail.com> References: <1575361141-6806-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 08:19:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11270807 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 8721E13A4 for ; Tue, 3 Dec 2019 08:19:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65FFC206EC for ; Tue, 3 Dec 2019 08:19:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HEB7pHIF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbfLCIT0 (ORCPT ); Tue, 3 Dec 2019 03:19:26 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50560 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726785AbfLCITW (ORCPT ); Tue, 3 Dec 2019 03:19:22 -0500 Received: by mail-wm1-f67.google.com with SMTP id p9so1997839wmg.0; Tue, 03 Dec 2019 00:19:20 -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=hrxYiLpa3QTymxbUAIdHVm+JWAvpyOBH5sypJmOwe7c=; b=HEB7pHIFMe8tGDiqif9q6gOd0S0IlCgYJebKo6KUjXI6/jQuLq8MBWNpVIZpwI2tFE Kor7si9mr1kcjzjkw/89qU+Pw3StyZYreX+j+U5tChsCh0J6AOPBLubUoszpR0ApZbYP vKsZTfSFixVG95knJ3gpy+cjiTIsjB4CYeD+hxP37hsab3ZIP5/napk6ZciZyuHig9rW DbOMndMJHLUHFVbalFRn255Y7NEDyiBtNpnQPzPtQPItMcYDiIE/1n78v7MEd9RkjEU0 jAFg6ua4DqsRaWtcFE97RWJ8OodPfLfd79MNh9vc3KsonphCBgmkj+QaeegbyYZnx7We wJdA== 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=hrxYiLpa3QTymxbUAIdHVm+JWAvpyOBH5sypJmOwe7c=; b=n0jdN4MOFoUip/9eOgFQ1ZLOU8/IavC3uLf4Fj+q4j56lvN4em3N0T4zJKV/guNB0z UBXwWhxANUFm1/zqdxLNjChFUmbgQ+BcXtzavdFqrzNWMJ2x8Ow5FMTYeLSEn2GNnTd3 3cPXgrkXL7wB+6U7vDfa/2FK4CSxMeO66N1Diwmga7O0jdCqZRJBNiMCpe30bmyddrjU BOKSDpwKf/ucguribH+GxjzltpTDC9jOFIE2Lh7c+veIEVugEyx1k4krZk/06xGTT1bL y7G1tHLAeLIiWKsV/M4CsXj6NQR1oyjq7YEH7heU5Au4ezEIjN+wzM5wkbJqpUf2RCZg SgxA== X-Gm-Message-State: APjAAAWjztiDcbzqeAt1j8c5ArOUNomS+O/mqBbZkLl5N+j9LopZbVPk 6/BRUETQpZ7dcxwLVvuGYH4= X-Google-Smtp-Source: APXvYqxOfbxqVAk5joKQvTT+mo/q8KQ2fLmYjsAmLWIaeBZW9B+YiUDwVNl8ONBIKD3hkuRHy2tkIg== X-Received: by 2002:a1c:8086:: with SMTP id b128mr30595682wmd.80.1575361159979; Tue, 03 Dec 2019 00:19:19 -0800 (PST) Received: from localhost.localdomain (p50991abe.dip0.t-ipconnect.de. [80.153.26.190]) by smtp.gmail.com with ESMTPSA id 188sm2048197wmz.13.2019.12.03.00.19.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Dec 2019 00:19:19 -0800 (PST) From: SeongJae Park To: brendanhiggins@google.com, shuah@kernel.org Cc: corbet@lwn.net, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, sjpark@amazon.de Subject: [PATCH v2 5/5] kunit: Rename 'kunitconfig' to '.kunitconfig' Date: Tue, 3 Dec 2019 17:19:01 +0900 Message-Id: <1575361141-6806-6-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575361141-6806-1-git-send-email-sj38.park@gmail.com> References: <1575361141-6806-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 02a54d8..8c0b2c4 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()