From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D8AFC47404 for ; Mon, 7 Oct 2019 23:05:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07E7021479 for ; Mon, 7 Oct 2019 23:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570489551; bh=8oHovXaH88Y52gIETFe+urtMKFGQyhxJM6iuIR0K5YM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-ID:From; b=ZLQzaWF/+adLj+0c9hWS3NjjlqKJw1/Xcbi12nTvlMT435+iQeNRLmc3nqD5cnLmW bIijuE89tTeFkYRGt/jmFH9p6eafP/cATDqljacR41sqnq3zOXCD+a9icb1C37MyhO HTsV3Wv7o4kCFN/9X0xDysGWyrRBQmBFP3UZzkO8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729252AbfJGXFu (ORCPT ); Mon, 7 Oct 2019 19:05:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:54536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728980AbfJGXFu (ORCPT ); Mon, 7 Oct 2019 19:05:50 -0400 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52A4220835; Mon, 7 Oct 2019 23:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570489549; bh=8oHovXaH88Y52gIETFe+urtMKFGQyhxJM6iuIR0K5YM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Wqqja5alOoCXGTFDib0sgR8qwdNMfnro8xiyxfIYXb6vtGC9jCrFqQqkuGqll3DJb BNCpr1FP2QlGs4x3U/EUd33kpQBJz3HbG/9nkI3t0+CHS1ZVv16zDkEUKeP9fcxyXK v0TPXNmkupRoILsZIxKVGL+9s+/5Euc3K4KPAZO0= Subject: Re: [PATCH] kunit: Fix '--build_dir' option To: Brendan Higgins Cc: SeongJae Park , "open list:KERNEL SELFTEST FRAMEWORK" , kunit-dev@googlegroups.com, Linux Kernel Mailing List , shuah References: <1567786314-12330-1-git-send-email-sj38.park@gmail.com> <1bc1c5da-2810-60d3-4e76-8d0b73fdd521@kernel.org> From: shuah Message-ID: <3b98db74-1b74-1797-c73d-ef7ee375d997@kernel.org> Date: Mon, 7 Oct 2019 17:05:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On 10/7/19 4:03 PM, Brendan Higgins wrote: > On Fri, Sep 6, 2019 at 7:33 PM shuah wrote: >> >> On 9/6/19 7:16 PM, Brendan Higgins wrote: >>> On Fri, Sep 6, 2019 at 9:12 AM SeongJae Park wrote: >>>> >>>> Running kunit with '--build_dir' option gives following error message: >>>> >>>> ``` >>>> $ ./tools/testing/kunit/kunit.py run --build_dir ../linux.out.kunit/ >>>> [00:57:24] Building KUnit Kernel ... >>>> [00:57:29] Starting KUnit Kernel ... >>>> Traceback (most recent call last): >>>> File "./tools/testing/kunit/kunit.py", line 136, in >>>> main(sys.argv[1:]) >>>> File "./tools/testing/kunit/kunit.py", line 129, in main >>>> result = run_tests(linux, request) >>>> File "./tools/testing/kunit/kunit.py", line 68, in run_tests >>>> test_result = kunit_parser.parse_run_tests(kunit_output) >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line >>>> 283, in parse_run_tests >>>> test_result = >>>> parse_test_result(list(isolate_kunit_output(kernel_output))) >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line >>>> 54, in isolate_kunit_output >>>> for line in kernel_output: >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line >>>> 145, in run_kernel >>>> process = self._ops.linux_bin(args, timeout, build_dir) >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line >>>> 69, in linux_bin >>>> stderr=subprocess.PIPE) >>>> File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ >>>> restore_signals, start_new_session) >>>> File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child >>>> raise child_exception_type(errno_num, err_msg) >>>> FileNotFoundError: [Errno 2] No such file or directory: './linux' >>>> ``` >>>> >>>> This error occurs because the '--build_dir' option value is not passed >>>> to the 'run_kernel()' function. Consequently, the function assumes >>>> the kernel image that built for the tests, which is under the >>>> '--build_dir' directory, is in kernel source directory and finally raises >>>> the 'FileNotFoundError'. >>>> >>>> This commit fixes the problem by properly passing the '--build_dir' >>>> option value to the 'run_kernel()'. >>>> >>>> Signed-off-by: SeongJae Park >>> >>> Reviewed-by: Brendan Higgins >>> Tested-by: Brendan Higgins >>> >>> Thanks! >>> >> >> Thanks Brendan! I will apply the patch for 5.4-rc1. > > Shuah, can you apply this to the kselftest KUnit branch? This should > not require a resend. > Done. Applied to https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git test thanks, -- Shuah