From patchwork Sun Dec 1 23:25:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11268661 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 B8EF114B7 for ; Sun, 1 Dec 2019 23:26:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 970F1217AB for ; Sun, 1 Dec 2019 23:26:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kytsNh2A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727282AbfLAXZp (ORCPT ); Sun, 1 Dec 2019 18:25:45 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46866 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727266AbfLAXZp (ORCPT ); Sun, 1 Dec 2019 18:25:45 -0500 Received: by mail-wr1-f67.google.com with SMTP id z7so38468918wrl.13; Sun, 01 Dec 2019 15:25:43 -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=HYMDGCEmGcRSgznIZqiDAqfjbK/Kr8elskjbFdh/a+8=; b=kytsNh2AsL4R2YGin9NHm3swj8566Bw36YlupJ91/bJ8mc+KxBt8QR5TXV/bHeP30I wV4NEfjSRSshzUTZG0+vnSfqN+OivW1D1lnGhe9MeRUEMTAsmT83J4OncMdik/qt8/KL 4SzJELjewY70o+mR+BrfzlZ1MgAZUzxw2uywZ8FJAn8Pt4aVqSx+fZywrMwpL0l5Fd/t Id+DpLp+0L4UJs+y+9jaXHxMxo2+bdSqg2SJ39XATzcxG589teqqCbWvQRmICQAu6yWk oOWZkPX/YSw/QNo9PJyEx6mCrmTXNvYmY9C/82BJgnaSjlfO0BMMHKZv9fmwAGjMYqgH 19Gw== 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=HYMDGCEmGcRSgznIZqiDAqfjbK/Kr8elskjbFdh/a+8=; b=I1bJQx5JIPrlTdYqdylASEI/cZGntVvIxioJFBq9GK2D2J7tGY7LsuoH7f9W9CC1Bs kJYGQ3HLWHPfvvJWVpkuxz7sULscowy5pvIsil9asn+U+e+RBZsCWqDLmcgh5QVv25A3 dZk45lq3ICq8nFevbPN/z8lCcCSi+une0YeyCnecnceGm9JJtsEqVw5UToOALx98bdQT uTqciBf+zSFkCIHlo933PuVE0tzIYdM4fYOudmBJCYbdgq6jZvbekovFa83K2Xb2J/5o UP/aJm8CSN5m1KTSleWLMIhpb0oDyP1zo6J67rlC2GJ/uSjCru/fWrDuZWBjIoZcfMFi cNcg== X-Gm-Message-State: APjAAAWcFy7IEcYja8HwX/yc/7GA+n/CRh47pz9ytQ/cpg/8tjNadvGF Z2JXif6lsQfI/5HsHE+/9wI= X-Google-Smtp-Source: APXvYqy1luSgtaDxhS/XlxRiPYxiWqzgWyjAEQaSVT72yqkQysRWTNzVHpAzskZqwnYCVk/CGMQRpg== X-Received: by 2002:adf:8147:: with SMTP id 65mr65094833wrm.230.1575242742682; Sun, 01 Dec 2019 15:25: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 y6sm37450454wrl.17.2019.12.01.15.25.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Dec 2019 15:25:42 -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, SeongJae Park Subject: [PATCH 1/6] docs/kunit/start: Use in-tree 'kunit_defconfig' Date: Mon, 2 Dec 2019 08:25:19 +0900 Message-Id: <1575242724-4937-2-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575242724-4937-1-git-send-email-sj38.park@gmail.com> References: <1575242724-4937-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 Sun Dec 1 23:25:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11268655 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 F09C614B7 for ; Sun, 1 Dec 2019 23:26:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDA9821774 for ; Sun, 1 Dec 2019 23:26:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FXWEsZWq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727356AbfLAXZr (ORCPT ); Sun, 1 Dec 2019 18:25:47 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37081 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727322AbfLAXZr (ORCPT ); Sun, 1 Dec 2019 18:25:47 -0500 Received: by mail-wr1-f67.google.com with SMTP id w15so10980386wru.4; Sun, 01 Dec 2019 15:25: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=FiRRG2p82soPNqcF4uwVMsDMa1xe32ae/CmIwI9GvRo=; b=FXWEsZWqdM0HtJD58FCT1Rj1Z26liaQf4IqJUi0Rf6/xRzsjNfQoGS82ulaf5B/0qI JlPa24PjmqeVDfW5/SF/h0escIGncSAxheBfa7OjAodBAzG0b4e0EvSO3+h/DXvbR+ZV s2ko6DLc+iohdp/tfA+8KsoBrM0Y8DSeHf0VlMN1zmi0zTyEwaD8bYb+OmGwBgK858eU xTefMN4a/l1gEuC1lX+RlDuQy43HfpVdoyxKhet6PgkVoFbHxV9NUOG6iiWSYjb8Iudo nF4P2YPXFGxuFQRaNDX3fYrGKIY4BRKUaR2misvmIxWaQQu28lJn0mnWQ7suktB59Vlq xCWw== 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=FiRRG2p82soPNqcF4uwVMsDMa1xe32ae/CmIwI9GvRo=; b=f/3lfktvE/OR5ByeWJDEt6MwiZIC4l1iaux7DM74cDkQSVHisFixbSPRTS4tmYxDQJ dDz7gqu6bCshKyhFPh4Tvm3kbn9YfwM2CDIbUcQu54vg5PZnixXAeSqtTybYTD6e26nl aMtCugTx99A17dUbJhiGn+lFdeSGRTWvdr6Fo+GRTuFEvFpn+u/gzXv8xeXZPK5ad8Ly GYY8kGTTxBqZK1as1eKm44Q0DGUBiLv2ZLSkvxZOComYrmIMIir3fsvzOfk3wSfJbAK6 EicgAXN7ezpw729oicRvWUsuaWEb6Ts2CDnDl8qDreeKv42tBI5fd9VruMDHWFDHOmcJ GD9w== X-Gm-Message-State: APjAAAXIroESDyiai7PWDWaXehPhcqDLC0bypHmhzTS0APcr/0/Et9aM AVLFoEUpFRe5fEyvL524428= X-Google-Smtp-Source: APXvYqw0R3sFDkURJkd9Dz4MSbZHogznT9g0FuJ0XMlBrcykLtllZunRB4FDtIoRGmtGgER8S6VhIA== X-Received: by 2002:a5d:538e:: with SMTP id d14mr8853855wrv.358.1575242743809; Sun, 01 Dec 2019 15:25: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 y6sm37450454wrl.17.2019.12.01.15.25.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Dec 2019 15:25:43 -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, SeongJae Park Subject: [PATCH 2/6] docs/kunit/start: Skip wrapper run command Date: Mon, 2 Dec 2019 08:25:20 +0900 Message-Id: <1575242724-4937-3-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575242724-4937-1-git-send-email-sj38.park@gmail.com> References: <1575242724-4937-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 'Getting Started' document first shows the wrapper running command. However, a new user who simply following the command might encounter a failure like below: $ ./tools/testing/kunit/kunit.py run Traceback (most recent call last): File "./tools/testing/kunit/kunit.py", line 140, in main(sys.argv[1:]) File "./tools/testing/kunit/kunit.py", line 126, in main linux = kunit_kernel.LinuxSourceTree() File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line 85, in __init__ self._kconfig.read_from_file(KUNITCONFIG_PATH) File "/home/sjpark/linux/tools/testing/kunit/kunit_config.py", line 65, in read_from_file with open(path, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: 'kunitconfig' Though the reason of the failure ('kunitconfig') is explained in its next section, it would be better to reduce any failure that user might encounter. This commit removes the example command for the reason. Signed-off-by: SeongJae Park --- Documentation/dev-tools/kunit/start.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index 78a0aed..e25978d 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -15,12 +15,6 @@ Included with KUnit is a simple Python wrapper that helps format the output to easily use and read KUnit output. It handles building and running the kernel, as well as formatting the output. -The wrapper can be run with: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run - Creating a kunitconfig ====================== The Python script is a thin wrapper around Kbuild as such, it needs to be From patchwork Sun Dec 1 23:25:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11268657 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 272E413A4 for ; Sun, 1 Dec 2019 23:26:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05EDC20725 for ; Sun, 1 Dec 2019 23:26:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eBXBJJOq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727366AbfLAXZs (ORCPT ); Sun, 1 Dec 2019 18:25:48 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52020 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727266AbfLAXZr (ORCPT ); Sun, 1 Dec 2019 18:25:47 -0500 Received: by mail-wm1-f67.google.com with SMTP id g206so19832703wme.1; Sun, 01 Dec 2019 15:25: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=BocdlsrLrUjQrAehWv4mAG7o8KdApwLekyWEKiTyhzs=; b=eBXBJJOqQsgoShxc0EqW+IxlAtt6JSkE86+RlV4UWRL3wvhD/QVNGqUQlq+RKatXIN OJaWLgKWHQzZIqVSHJfKD5aGeNL/DJtCP+Ujro0KfrgyrkaicYPDGtTmPu+ecKvZaQq5 CfYo1Y1LD1B7HL28modNAOvp+VQdbQcta0UOAfrj3bjHSOyFsHkEXBiDsyTM0C4o8dUW ksYeFgSFRR0GJ20AV9OXf76PUpv/P+mnBpvtfbb7LP2uexsMS6kugAaxMQZ2s5m1Y0+M LMJzoBZrExLpbu9Bmh6sUs1QrHp6DGogfyZ7+AON6ttWZ7lgKSNnYgBVaSISuQdym98z g4bw== 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=BocdlsrLrUjQrAehWv4mAG7o8KdApwLekyWEKiTyhzs=; b=uf3zeO3s+ARlq9UvaX3VuWB0L5npLRk1k8QjFCWraNMxxJuvOtSzLGhRRxBJEiC6Xq zRVuGP/tLYpYMM6ZiIroo5V8QLRaRCSTqZfhufe9hz73aHOCTX18kB685BzZJGexRJJq u7uWHU/VNfr2zhekg6ber9WruA68q2On5jJ0mHRF3Zz3GedLbxoum2tbdYJe04z83j5G yFvt8n+njgeXgchxi2nroGGGTmMdVyzzfRSWcK4eH1oPzVorCs79zQ8nnHTKHvZ5Auy/ SqW0pD0/bnL9XtyIriWxd27YzPjLeOsnRb/csGNKfx4NDeQBLqssKipxw1JE0IwgVKpf 4ETw== X-Gm-Message-State: APjAAAXTnV8zwZ28NE4JFMjflPx3X01FIuvlfQEyZ0+mG7HSAI2Z7Ee0 KS8bWWqNsqWTTEmVYgGb11w= X-Google-Smtp-Source: APXvYqzGHaKtd5jorQciodJy8Ctlzb3Zs/Z4kLACV2tH4wQ4fWpw5F0ZIeLXQbhFuz/jigZzYL+RNQ== X-Received: by 2002:a1c:106:: with SMTP id 6mr24541246wmb.33.1575242745049; Sun, 01 Dec 2019 15:25: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 y6sm37450454wrl.17.2019.12.01.15.25.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Dec 2019 15:25:44 -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, SeongJae Park Subject: [PATCH 3/6] kunit: Remove duplicated defconfig creation Date: Mon, 2 Dec 2019 08:25:21 +0900 Message-Id: <1575242724-4937-4-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575242724-4937-1-git-send-email-sj38.park@gmail.com> References: <1575242724-4937-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 Sun Dec 1 23:25:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11268653 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 2F91914B7 for ; Sun, 1 Dec 2019 23:26:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DDFF218AC for ; Sun, 1 Dec 2019 23:26:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oH1SpGE7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727443AbfLAX0D (ORCPT ); Sun, 1 Dec 2019 18:26:03 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37086 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727279AbfLAXZs (ORCPT ); Sun, 1 Dec 2019 18:25:48 -0500 Received: by mail-wr1-f68.google.com with SMTP id w15so10980433wru.4; Sun, 01 Dec 2019 15:25:46 -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=vGbeK0zgYCmWlSmgxBPs/jpmt323fVhKZnVym+DQBus=; b=oH1SpGE7VHgGjG8/Dx7tPCF0v5UNTNlLI1evs3DIp9Mrjdo+R9sVjlqhEySpi9o2Gq mJ9V92jEHiXEhBgon60ow5Ac0gu7sz1RVN5H+6OqEY6YZewPCMHiD+78yV5TRDMwfhHT kcw/8sV9z35UWzZlmN5hwrvx45ssjbo/cXtufMTNOxIN3gggaq95pZRyIgdFyXxG8PQE cfeTat8Rud86zjOjWH5kJ5QeplJwmtWT7BmnJcTa8yeHASsO9QaT69n7MmnNRdpWoaro fbLT2Up3g2SJ3x1dfWzUwtuBPgjekHd+A1UbusFVtu5Vn2bFTHnF/x56PlCw9KeUP1JX GW5Q== 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=vGbeK0zgYCmWlSmgxBPs/jpmt323fVhKZnVym+DQBus=; b=BQkclDntuFDkWt7QhHlL+8OQIaSu3BJ5IQw0vUrfMODrFTomTEeiBOdjU12zj14tFB Pp1l5EJUJBjwfBDHtFt7KZeu0r+AVbndllOT5e0x3+uhJ/nnjRZRGep1KOBoDNfd3drK mLja8goCVc1KloEIdoyCtxBtUKXqqGlj857L4G8ag2WXsFSDNv1h5h0sEYvXAIWNOkUL 2ksSqmgbd40PXzHAEUU4RLCmYP1nQSoJC018fYgamqapahW55sRmEZGh373+e7pqFtOK 3EYwR8lGYNihga7mDatzYOX7Ymnqcldj38V5WRlNBYwFFZbR+XSHOVD5W+5mnoCIAOpO W4gg== X-Gm-Message-State: APjAAAV33uB5gyQGU/jf2FqXiQ4V9w8mo3RRi/Cp0CAslkcwzXaufjLH vNtnXU8OxR8zS6SS7MDymcQ= X-Google-Smtp-Source: APXvYqwZ/Iti69NVkcCu6wCaCpEPeSP3LVRE1q3go6xDOzFwri5p6l9Qmz/0S07snc3kpBSHyN1qYQ== X-Received: by 2002:adf:eb42:: with SMTP id u2mr47495946wrn.173.1575242746142; Sun, 01 Dec 2019 15:25: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 y6sm37450454wrl.17.2019.12.01.15.25.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Dec 2019 15:25:45 -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, SeongJae Park Subject: [PATCH 4/6] kunit: Create default config in 'build_dir' Date: Mon, 2 Dec 2019 08:25:22 +0900 Message-Id: <1575242724-4937-5-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575242724-4937-1-git-send-email-sj38.park@gmail.com> References: <1575242724-4937-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 --- tools/testing/kunit/kunit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index f8f2695..1746330 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -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() From patchwork Sun Dec 1 23:25:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11268649 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 2B96514B7 for ; Sun, 1 Dec 2019 23:25:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFB45217AB for ; Sun, 1 Dec 2019 23:25:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tYIrnVgk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727409AbfLAXZu (ORCPT ); Sun, 1 Dec 2019 18:25:50 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40003 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbfLAXZt (ORCPT ); Sun, 1 Dec 2019 18:25:49 -0500 Received: by mail-wr1-f66.google.com with SMTP id c14so17327577wrn.7; Sun, 01 Dec 2019 15:25: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=t7zZ15/MkMeD2pktuUDCc/OY3s5R2FWR8O7+ReQTC+I=; b=tYIrnVgk9aI1KJvogaeo/QtrReLg6sEsR8L8cs+2Xl/J3ls2POR+IeWuCXCmDIyPFq e1E2+9GUTp+jFCOuCntKKlo6UHJgBXPl/9J3iE6p7jrX8zX3PDi2FA4v7a0NnLOgn3bA f4DrQJe3ipEYXn3XvzwDkmIvqJWfaFlFmB8jnuPiNKOy3F+2qHDCyQZ45G4vdbqWZKDr CD49VPzD129nOo+NrcOAJK3CozFkfsXuzc9C74CtyAxqKc/j/5OVJXK+Af0ZzFZi9gQo IdGBd9/hHrxAiBma3/ztHGUQ/O0YyfHWosT+OPEWVbNuP/QZzCgpV58eu4tKrqQgAoML E9Dw== 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=t7zZ15/MkMeD2pktuUDCc/OY3s5R2FWR8O7+ReQTC+I=; b=cF/rDrgCPSxQXHmcAkgKtywGFLTvd13/8fYi+QmScwyBiULWbfFLcla2SCUeCzRzrp hTvv0qUdqyKrvTVKRhq3QTxLkki2JP9B7tQuEjPaLC2YYtTei0lBOUUF5olsAZo3g+wC s73ByEp8Ll7sqBQUm7k2HdHhejc9AqggIp2/+zsL4W7gkbHjKvRwuk6xPXGozwhEna/5 Axe1wUSrLkvFh8k1MiZcQUD6hxMdgWM8KYxGpsQ+hrCWRwRmH9sLOm+hnGxnYId1A6o+ W0fg8a1EJb6TwSAWZjOdGAFts6FQSNEJtZYEe961DIVGFh2MHFy07sDjD+v3Q4M8KZ7k G61w== X-Gm-Message-State: APjAAAVrzq8jkksjfQKviq0mOty9VjKQ0PyOnSOS5VgAr36IcTIUYWsA tD9Ujfm6SLUf1zRT0DSiL/w= X-Google-Smtp-Source: APXvYqy5HTNhTM5ksfWeN137d3ZVA274K6KE8STUGBol/0GEgl1EaRC7FL3Z5RjSwtlpXho2NrmWdA== X-Received: by 2002:adf:8bde:: with SMTP id w30mr25729729wra.124.1575242747376; Sun, 01 Dec 2019 15:25: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 y6sm37450454wrl.17.2019.12.01.15.25.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Dec 2019 15:25:46 -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, SeongJae Park Subject: [PATCH 5/6] kunit: Place 'test.log' under the 'build_dir' Date: Mon, 2 Dec 2019 08:25:23 +0900 Message-Id: <1575242724-4937-6-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575242724-4937-1-git-send-email-sj38.park@gmail.com> References: <1575242724-4937-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 bf38768..b640939 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 Sun Dec 1 23:25: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: 11268651 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 A346913A4 for ; Sun, 1 Dec 2019 23:25:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 826F1215F1 for ; Sun, 1 Dec 2019 23:25:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mp6PBDwo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727430AbfLAXZx (ORCPT ); Sun, 1 Dec 2019 18:25:53 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35664 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727266AbfLAXZu (ORCPT ); Sun, 1 Dec 2019 18:25:50 -0500 Received: by mail-wr1-f67.google.com with SMTP id g17so9888754wro.2; Sun, 01 Dec 2019 15:25:49 -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=fWlVQQ7BGjjRSAk/bgCXHsVzfE8yYuX6nxPeJuLphn8=; b=Mp6PBDwok9zKHQgQwFIqsk8Kp13EuqwQgDStOdtp+jslRIbHY+t8AK1gLB3dgxw38i nmeKUiA+Le18w85SifDtKTcp8iDoQHbJjj46dUpMKHu81+z79UApQwecxqo8/EA9TE8b KmfXPa0Ib+SsF+e8rJEhfzdSQMR8w18Cixxn0VoSA+RJCpdQZPDREbHtklOiEEa/AlVE GqmWPwOcLfwiPTAWT1IXXuUlCbX7KDh2BWFZuQspi8fFe7wXxPfHPWBeaKIOXdHSIdtl 36YQNx5tiSYurc8WxjJvi48yeyYTfIPdi1so4DPMlmbsLw86YETOD205NyLJdT+06H7G Y8Bg== 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=fWlVQQ7BGjjRSAk/bgCXHsVzfE8yYuX6nxPeJuLphn8=; b=A3a+CpgTncmypnuBtT6FxDr+a//ejGVHNF3oXm8BMr76MR2b+4zWA1mKeQKv2UKsoU bBYBSkXt04P2t76B7TX2IGiIDzYZF/tY36gQFMIJv35xHPqPUmq883W2fWnfzPedDhgu Ikte8cagU3FKI/m/v5fWsqfiJUDHdUUWvfmv/M3+uel08wZAv6YexAgvaJ/D8mQ49KYK iaOeuqUZA3xXH4rK76QEPc0xGOnytW+OlY91p5ynlV+9UuKLub2bHBscl9zWyjfScEdH cTx0mBxGr2eEbEGj80S4Z5XZlXmDXvujim1Zv6sMnMKjUmABOJSgj5dcpD6P+sXwNC/n wxuQ== X-Gm-Message-State: APjAAAU4q1eQv4+MxVPhwVmL+4t+E6Cd37mQ7Y6M0G51Lxq1xuEvvL8u iWVKIZrHs9SrIFu6Yol2yrk= X-Google-Smtp-Source: APXvYqzn/ztyle4DWAe6RVHE5z16tim7uASA6oB6ZOky9JKO0016DSgwVvnTw5//h32ruU28bIH4gA== X-Received: by 2002:a05:6000:1044:: with SMTP id c4mr46983995wrx.204.1575242748425; Sun, 01 Dec 2019 15:25:48 -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 y6sm37450454wrl.17.2019.12.01.15.25.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Dec 2019 15:25:47 -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, SeongJae Park Subject: [PATCH 6/6] kunit: Rename 'kunitconfig' to '.kunitconfig' Date: Mon, 2 Dec 2019 08:25:24 +0900 Message-Id: <1575242724-4937-7-git-send-email-sj38.park@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1575242724-4937-1-git-send-email-sj38.park@gmail.com> References: <1575242724-4937-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 --- 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 e25978d..f2e585e 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -15,18 +15,16 @@ Included with KUnit is a simple Python wrapper that helps format the output to easily use and read KUnit output. It handles building and running the kernel, as well as formatting the output. -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 --------------------- @@ -141,7 +139,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 1746330..309d6e3 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 b640939..507364d 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()