Message ID | 20230203170653.414990-1-marpagan@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp959965wrn; Fri, 3 Feb 2023 09:17:28 -0800 (PST) X-Google-Smtp-Source: AK7set8MZXjcU45BcscR6V84JiXS+mQ3lb/C+96+AJiJso8BoihL0L68vgLRbm4RlTOd+601RGGs X-Received: by 2002:aa7:9618:0:b0:58b:c3b3:d3dd with SMTP id q24-20020aa79618000000b0058bc3b3d3ddmr9701723pfg.21.1675444648055; Fri, 03 Feb 2023 09:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675444648; cv=none; d=google.com; s=arc-20160816; b=o3sUJZWnzuIZ52q23sidixFc6x2PJRTPhLkMNclgQDjhybHld5kT7g7Y0IONuNnSIh VivJj5UYqckWYiGMy3Eh1YxydNjVaQzxk3K8y9p3OjeeZ8EoNVPMpETqVlmNnMDdsTC2 rCKooenOwMNfXjaqPhyidK7d1VK4pTz1QQ7qfTieNpICzPHP8QA9MwQDclkdE8sBNhqE gQlopslX7SdL0/STFi6MEuIuFM36jmO09kEZavPN7MTaY0CRkkAjJsGg0oyLAh1hy34l EO2ngzk+az7PX+Spjx144fu1gzabwzgWsYmw9finr6SuNofzZoOv/cRo3vcSYjnWtl0E zA+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=P+vuSKEpv7Ptnqb54aBjdlAa8wCTiq9HDLYMTKqctAU=; b=bc+j9JPDxu8VVOAiiQx5dzrAN2aJeSJolNnSgAydAhjsO2tgf4LutAosxxFkx+tkOs KGDQ0VlFuMufYAY0HDLBkzzQ2SiqIQaDNXuSZaIea2CHQ8Mj1iYtGvErT0XTLWqqNZUT l+wFQmB9r7/nKmrVVoFWjQ3rpz6RsUKsYnATM/UMI5Myi0MFOjksjdXcV3p5w3kQF83T KbK7QOl6XMUovF+dRshKY5ZDcCLKOLac41PDwvcgNVE17hfRDh+pp/hsYct3+sruagJK zYJzHbl6kWv/nf1jtuWoV6yABLQB78OUBIKZeiYkxDf2BVgIamiw3rYZULVEjRZIncq8 rdQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YX2se+78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020aa79468000000b00587be58a022si3208727pfq.1.2023.02.03.09.16.53; Fri, 03 Feb 2023 09:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YX2se+78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233650AbjBCRIV (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Fri, 3 Feb 2023 12:08:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233060AbjBCRIL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Feb 2023 12:08:11 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB935A9132 for <linux-kernel@vger.kernel.org>; Fri, 3 Feb 2023 09:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675444038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=P+vuSKEpv7Ptnqb54aBjdlAa8wCTiq9HDLYMTKqctAU=; b=YX2se+78B5ITSPLAoHs/7527DOQWYL0UQg0oTrKNLSqFemm0D1WUr1/ZScEWNKPepdwU3J /Bq7SuEBrUXRo2Ihedy5cj1tcdDBHZOExnGBWgTGmPdPiQtqGNtNJqZfWvowfMrVIYLk2z iNzNiweU6LNvsbvvAQWwm+2vCXbQm40= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-141-UgLcflunOKCF_M8Uyb9IOA-1; Fri, 03 Feb 2023 12:07:15 -0500 X-MC-Unique: UgLcflunOKCF_M8Uyb9IOA-1 Received: by mail-qv1-f71.google.com with SMTP id jo26-20020a056214501a00b0053aa15f61d4so3061143qvb.7 for <linux-kernel@vger.kernel.org>; Fri, 03 Feb 2023 09:07:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=P+vuSKEpv7Ptnqb54aBjdlAa8wCTiq9HDLYMTKqctAU=; b=QAMm9ljEKFhQtQx0KU7nFD9nAyaIffAKz6ZmkMtuwUpPr78MQsO7fZquzNWmEHFcBN zNTFoGmx4djKyOc9whEIrCglAnc2ldgKlukJmFunN1WM5i/PRwcfbxGlHxwZsysA+/2G mw/x0J4XSVEroe+uiHk8s3D5FKsHEr8gGGM9r8TUB0YKIOZhnVdZl08g9gvAeu0NfIWj IUMflbaj9QmzOIze13ahQiCJOyn1IBItTqWOW+syPjsC4mNIiRZNopFa+omrJZGw1Lv3 m4iIWZ1VxN1I4iKhGcknAOzkcsHxwwPDwoRQULE23MsWIFh4GWuHwgnuomBVEEhId/d2 ipXA== X-Gm-Message-State: AO0yUKWo3TLT96KoHdWOsWURjK6O7cV76LI8Glv8OIgJnIk18NzNS065 bYYfzjqP0bWXqsYbiR+OGoPq/p99Ygr2/cebkeaw329wy+t5IHXHe25iOCJKjYTIQAPRqYbe3Zc +N/LAFX02N6ENHqtu08RRBFY= X-Received: by 2002:a05:622a:10c:b0:3b8:5c86:37ea with SMTP id u12-20020a05622a010c00b003b85c8637eamr20570114qtw.61.1675444034630; Fri, 03 Feb 2023 09:07:14 -0800 (PST) X-Received: by 2002:a05:622a:10c:b0:3b8:5c86:37ea with SMTP id u12-20020a05622a010c00b003b85c8637eamr20570093qtw.61.1675444034444; Fri, 03 Feb 2023 09:07:14 -0800 (PST) Received: from klayman.redhat.com (net-2-34-30-183.cust.vodafonedsl.it. [2.34.30.183]) by smtp.gmail.com with ESMTPSA id b13-20020ac801cd000000b003a6a19ee4f0sm1884287qtg.33.2023.02.03.09.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 09:07:14 -0800 (PST) From: Marco Pagani <marpagan@redhat.com> To: Moritz Fischer <mdf@kernel.org>, Wu Hao <hao.wu@intel.com>, Xu Yilun <yilun.xu@intel.com>, Tom Rix <trix@redhat.com> Cc: Marco Pagani <marpagan@redhat.com>, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [RFC PATCH 0/4] fpga: add initial KUnit test suite for the subsystem Date: Fri, 3 Feb 2023 18:06:49 +0100 Message-Id: <20230203170653.414990-1-marpagan@redhat.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756831047586071447?= X-GMAIL-MSGID: =?utf-8?q?1756831047586071447?= |
Series |
fpga: add initial KUnit test suite for the subsystem
|
|
Message
Marco Pagani
Feb. 3, 2023, 5:06 p.m. UTC
This patch set introduces a KUnit suite to test the core components of the FPGA subsystem. More specifically, the suite tests the core functions of the FPGA manager, FPGA bridge, and FPGA region. These components are tested using "fake" modules that allow observing their internals without altering the source code. The test suite can be run using [user@localhost linux]$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/fpga/tests Marco Pagani (4): fpga: add initial KUnit test suite fpga: add fake FPGA region fpga: add fake FPGA manager fpga: add fake FPGA bridge drivers/fpga/Kconfig | 2 + drivers/fpga/Makefile | 3 + drivers/fpga/tests/.kunitconfig | 5 + drivers/fpga/tests/Kconfig | 15 ++ drivers/fpga/tests/Makefile | 6 + drivers/fpga/tests/fake-fpga-bridge.c | 214 +++++++++++++++ drivers/fpga/tests/fake-fpga-bridge.h | 36 +++ drivers/fpga/tests/fake-fpga-mgr.c | 365 ++++++++++++++++++++++++++ drivers/fpga/tests/fake-fpga-mgr.h | 42 +++ drivers/fpga/tests/fake-fpga-region.c | 186 +++++++++++++ drivers/fpga/tests/fake-fpga-region.h | 37 +++ drivers/fpga/tests/fpga-tests.c | 264 +++++++++++++++++++ 12 files changed, 1175 insertions(+) create mode 100644 drivers/fpga/tests/.kunitconfig create mode 100644 drivers/fpga/tests/Kconfig create mode 100644 drivers/fpga/tests/Makefile create mode 100644 drivers/fpga/tests/fake-fpga-bridge.c create mode 100644 drivers/fpga/tests/fake-fpga-bridge.h create mode 100644 drivers/fpga/tests/fake-fpga-mgr.c create mode 100644 drivers/fpga/tests/fake-fpga-mgr.h create mode 100644 drivers/fpga/tests/fake-fpga-region.c create mode 100644 drivers/fpga/tests/fake-fpga-region.h create mode 100644 drivers/fpga/tests/fpga-tests.c
Comments
On 2/3/23 09:06, Marco Pagani wrote: > This patch set introduces a KUnit suite to test the core components > of the FPGA subsystem. More specifically, the suite tests the core > functions of the FPGA manager, FPGA bridge, and FPGA region. > > These components are tested using "fake" modules that allow > observing their internals without altering the source code. > > The test suite can be run using > [user@localhost linux]$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/fpga/tests When I tried running these tests, I got an error until I created this file: drivers/fpga/tests/.kunitconfig: CONFIG_KUNIT=y CONFIG_FPGA=y CONFIG_FPGA_REGION=y CONFIG_FPGA_BRIDGE=y CONFIG_FPGA_KUNIT_TESTS=y I think this file needs to be included in your patchset? - Russ > > Marco Pagani (4): > fpga: add initial KUnit test suite > fpga: add fake FPGA region > fpga: add fake FPGA manager > fpga: add fake FPGA bridge > > drivers/fpga/Kconfig | 2 + > drivers/fpga/Makefile | 3 + > drivers/fpga/tests/.kunitconfig | 5 + > drivers/fpga/tests/Kconfig | 15 ++ > drivers/fpga/tests/Makefile | 6 + > drivers/fpga/tests/fake-fpga-bridge.c | 214 +++++++++++++++ > drivers/fpga/tests/fake-fpga-bridge.h | 36 +++ > drivers/fpga/tests/fake-fpga-mgr.c | 365 ++++++++++++++++++++++++++ > drivers/fpga/tests/fake-fpga-mgr.h | 42 +++ > drivers/fpga/tests/fake-fpga-region.c | 186 +++++++++++++ > drivers/fpga/tests/fake-fpga-region.h | 37 +++ > drivers/fpga/tests/fpga-tests.c | 264 +++++++++++++++++++ > 12 files changed, 1175 insertions(+) > create mode 100644 drivers/fpga/tests/.kunitconfig > create mode 100644 drivers/fpga/tests/Kconfig > create mode 100644 drivers/fpga/tests/Makefile > create mode 100644 drivers/fpga/tests/fake-fpga-bridge.c > create mode 100644 drivers/fpga/tests/fake-fpga-bridge.h > create mode 100644 drivers/fpga/tests/fake-fpga-mgr.c > create mode 100644 drivers/fpga/tests/fake-fpga-mgr.h > create mode 100644 drivers/fpga/tests/fake-fpga-region.c > create mode 100644 drivers/fpga/tests/fake-fpga-region.h > create mode 100644 drivers/fpga/tests/fpga-tests.c >
On 2023-02-14 02:20, Russ Weight wrote: > > > On 2/3/23 09:06, Marco Pagani wrote: >> This patch set introduces a KUnit suite to test the core components >> of the FPGA subsystem. More specifically, the suite tests the core >> functions of the FPGA manager, FPGA bridge, and FPGA region. >> >> These components are tested using "fake" modules that allow >> observing their internals without altering the source code. >> >> The test suite can be run using >> [user@localhost linux]$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/fpga/tests > When I tried running these tests, I got an error until I created this file: > > drivers/fpga/tests/.kunitconfig: > CONFIG_KUNIT=y > CONFIG_FPGA=y > CONFIG_FPGA_REGION=y > CONFIG_FPGA_BRIDGE=y > CONFIG_FPGA_KUNIT_TESTS=y > > I think this file needs to be included in your patchset? > > - Russ > Patch 1/4 includes a .kunitconfig file with these configs set =y > diff --git a/drivers/fpga/tests/.kunitconfig b/drivers/fpga/tests/.kunitconfig > new file mode 100644 > index 000000000000..a1c2a2974c39 > --- /dev/null > +++ b/drivers/fpga/tests/.kunitconfig > @@ -0,0 +1,5 @@ > +CONFIG_KUNIT=y > +CONFIG_FPGA=y > +CONFIG_FPGA_REGION=y > +CONFIG_FPGA_BRIDGE=y > +CONFIG_FPGA_KUNIT_TESTS=y To double-check for any patch format errors, I downloaded the patch set from lore.kernel.org and applied it on a fresh tree with Git (version 2.39.1) using git am. In my case, Git created the .kunitconfig file and I was able to run the tests. >> >> Marco Pagani (4): >> fpga: add initial KUnit test suite >> fpga: add fake FPGA region >> fpga: add fake FPGA manager >> fpga: add fake FPGA bridge >> >> drivers/fpga/Kconfig | 2 + >> drivers/fpga/Makefile | 3 + >> drivers/fpga/tests/.kunitconfig | 5 + >> drivers/fpga/tests/Kconfig | 15 ++ >> drivers/fpga/tests/Makefile | 6 + >> drivers/fpga/tests/fake-fpga-bridge.c | 214 +++++++++++++++ >> drivers/fpga/tests/fake-fpga-bridge.h | 36 +++ >> drivers/fpga/tests/fake-fpga-mgr.c | 365 ++++++++++++++++++++++++++ >> drivers/fpga/tests/fake-fpga-mgr.h | 42 +++ >> drivers/fpga/tests/fake-fpga-region.c | 186 +++++++++++++ >> drivers/fpga/tests/fake-fpga-region.h | 37 +++ >> drivers/fpga/tests/fpga-tests.c | 264 +++++++++++++++++++ >> 12 files changed, 1175 insertions(+) >> create mode 100644 drivers/fpga/tests/.kunitconfig >> create mode 100644 drivers/fpga/tests/Kconfig >> create mode 100644 drivers/fpga/tests/Makefile >> create mode 100644 drivers/fpga/tests/fake-fpga-bridge.c >> create mode 100644 drivers/fpga/tests/fake-fpga-bridge.h >> create mode 100644 drivers/fpga/tests/fake-fpga-mgr.c >> create mode 100644 drivers/fpga/tests/fake-fpga-mgr.h >> create mode 100644 drivers/fpga/tests/fake-fpga-region.c >> create mode 100644 drivers/fpga/tests/fake-fpga-region.h >> create mode 100644 drivers/fpga/tests/fpga-tests.c >> > Thanks, Marco
On 2/15/23 03:19, Marco Pagani wrote: >> When I tried running these tests, I got an error until I created this file: >> >> drivers/fpga/tests/.kunitconfig: >> CONFIG_KUNIT=y >> CONFIG_FPGA=y >> CONFIG_FPGA_REGION=y >> CONFIG_FPGA_BRIDGE=y >> CONFIG_FPGA_KUNIT_TESTS=y >> >> I think this file needs to be included in your patchset? >> >> - Russ >> > Patch 1/4 includes a .kunitconfig file with these configs set =y > >> diff --git a/drivers/fpga/tests/.kunitconfig b/drivers/fpga/tests/.kunitconfig >> new file mode 100644 >> index 000000000000..a1c2a2974c39 >> --- /dev/null >> +++ b/drivers/fpga/tests/.kunitconfig >> @@ -0,0 +1,5 @@ >> +CONFIG_KUNIT=y >> +CONFIG_FPGA=y >> +CONFIG_FPGA_REGION=y >> +CONFIG_FPGA_BRIDGE=y >> +CONFIG_FPGA_KUNIT_TESTS=y > To double-check for any patch format errors, I downloaded the patch set > from lore.kernel.org and applied it on a fresh tree with Git (version > 2.39.1) using git am. In my case, Git created the .kunitconfig file and > I was able to run the tests. > > I can see the .kunitconfig file in the emailed patch. I had to resolve some conflicts when I applied patch #1 - I must have missed this file when I committed the changes. Thanks, - Russ