Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1461789ybl; Thu, 5 Dec 2019 01:40:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxIEUIkoxFNufiILP/LjswuQGI9ia6/oQaY+026pbeshK4s70s7yH5AEjMA7w5WDoLLjh1t X-Received: by 2002:a9d:53cb:: with SMTP id i11mr6056712oth.158.1575538826307; Thu, 05 Dec 2019 01:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575538826; cv=none; d=google.com; s=arc-20160816; b=ZTLNmatASid5Dj/8hVm5qPTFq9w/8SJ2Fnp3KInGVZznVB85ojWCbKC09yqva56fzq RCazFIS6gxrBR+Ile5WMsa1jZdw0lRieqHQCR8BQ8Is8RBhmmQ4dlZkBQPOqJH6d32xF yrf2PdriLmOrVfE7Fu5Qc1jc4euCrYjAE3RU7uqjMizcg6L0zQnZzwBJ8TK9EZp/N9G+ +3+C2OVgyldXXA6nbda/nfa85rLJveBRYdRQnD8V40V+U/T0EpvmI+Jifku2o+jkdSqd PkQ+RybEibjWcyGtGIiZIgOYBaWRmqi4vDf1yPoRWSdGjwz+U8PCJiWrJANpPPtL6Fxh T9RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=MiFuavq5Qnjsk7KrDh/upooxJoiEUmzFTrl7IlXIUqw=; b=Od4eC1ErJm3cDlLCGp26qSQoz71xiz4dsDySkOGG7s5FuElf0//3HXSIbph2ymBdHO 2YQ8JferozJm2wG4Aj49cRND9A/qbIkNmKsE7lnrkJjRBOj83j/b6AS/5BGcHwIuVYGd Kc4l14TChh1um4nQEwjsrGLvMAmS5eHDHZi7db9mrQ0iLkTk5+2b3CRCSwu5ylCYU5KH 0SeI2INSEWezgQf7pxor1uNJlYUCiBB9Zrndg7buNsfyipC8E3POS5nOyZHwIdCbpX1i VfddPu494npqgwIY72lTUEMHUVTDCFRSpzioGSGN0/f+Bkz6IWBjfrwenaW3Nj99t3v3 jw3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ECN7i7g0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si4770092oti.171.2019.12.05.01.40.14; Thu, 05 Dec 2019 01:40:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ECN7i7g0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729404AbfLEJi4 (ORCPT + 99 others); Thu, 5 Dec 2019 04:38:56 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:55684 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728707AbfLEJiw (ORCPT ); Thu, 5 Dec 2019 04:38:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1575538733; x=1607074733; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=MiFuavq5Qnjsk7KrDh/upooxJoiEUmzFTrl7IlXIUqw=; b=ECN7i7g06pIiVPa7rsFuPX36xqd/va0c5Jap2E5+owf+j/KcMWwD+vZI /h1ubV2jcp88QSsYxCL72+aokNrV2SgfxcTZkzQqWq77Z6RA+BtOlbrun ei++Bo4XnIdhSbRkA+hBLNTbJ7qrvYY/BvXRoHIrwUAl9XBkj9Dq6bBN+ g=; IronPort-SDR: 5PPOhAW7haH6EKJQEUeZiV1/p09w4tUcgXN3MGy0udA95frYz634gZcjrchm6JYYI7SstiQM18 XnmLmRmNJvkw== X-IronPort-AV: E=Sophos;i="5.69,280,1571702400"; d="scan'208";a="7181812" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-8549039f.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 05 Dec 2019 09:38:52 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-8549039f.us-west-2.amazon.com (Postfix) with ESMTPS id 1A82FA1E55; Thu, 5 Dec 2019 09:38:50 +0000 (UTC) Received: from EX13D31EUA004.ant.amazon.com (10.43.165.161) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 5 Dec 2019 09:38:49 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.100) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 5 Dec 2019 09:38:45 +0000 From: SeongJae Park To: CC: , , , , , , , Subject: [PATCH v5 6/6] kunit/kunit_tool_test: Test '--build_dir' option run Date: Thu, 5 Dec 2019 10:38:31 +0100 Message-ID: <20191205093831.22925-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191205093440.21824-1-sjpark@amazon.com> References: <20191205093440.21824-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.100] X-ClientProxiedBy: EX13D05UWC003.ant.amazon.com (10.43.162.226) To EX13D31EUA004.ant.amazon.com (10.43.165.161) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park This commit adds kunit tool test for the '--build_dir' option. Signed-off-by: SeongJae Park --- tools/testing/kunit/kunit_tool_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py index 22f16e66b3c1..cba97756ac4a 100755 --- a/tools/testing/kunit/kunit_tool_test.py +++ b/tools/testing/kunit/kunit_tool_test.py @@ -174,6 +174,7 @@ class KUnitMainTest(unittest.TestCase): kunit.main(['run'], self.linux_source_mock) assert self.linux_source_mock.build_reconfig.call_count == 1 assert self.linux_source_mock.run_kernel.call_count == 1 + self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='', timeout=300) self.print_mock.assert_any_call(StrContains('Testing complete.')) def test_run_passes_args_fail(self): @@ -202,5 +203,12 @@ class KUnitMainTest(unittest.TestCase): self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='', timeout=timeout) self.print_mock.assert_any_call(StrContains('Testing complete.')) + def test_run_builddir(self): + build_dir = '.kunit' + kunit.main(['run', '--build_dir', build_dir], self.linux_source_mock) + assert self.linux_source_mock.build_reconfig.call_count == 1 + self.linux_source_mock.run_kernel.assert_called_once_with(build_dir=build_dir, timeout=300) + self.print_mock.assert_any_call(StrContains('Testing complete.')) + if __name__ == '__main__': unittest.main() -- 2.17.1