Message ID | 20230616154405.220502-1-marpagan@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1446115vqr; Fri, 16 Jun 2023 09:01:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vXWZp3ZaNF7ps4PJ2l4ZIenBzQ/eOX/1C1Vc3S8unblygs5Xw5MWlNdUpqzKohzRBDq6i X-Received: by 2002:a05:6a00:23c5:b0:65a:cbf3:46a4 with SMTP id g5-20020a056a0023c500b0065acbf346a4mr3055409pfc.5.1686931299694; Fri, 16 Jun 2023 09:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686931299; cv=none; d=google.com; s=arc-20160816; b=WScp0nfomn2x1Xgvr13Vm5kXVXOGFvhbsbtuSD90K6j8xY0aQ5qEZeDdb3OgPx43OV 4Tw1LpHBXh66rnH+qAWYvRgXPqv/sAn3ddl7gwJBcUqwY4FDoB+nnX7vK89b71ZVZ6J/ urp9PPsQSGBSYUAst9FnLRe+ii1rejz9CSVNADNOmF5IVorDOnr1AOXhX79W+/hH+H/o BIrgghJBCrsO6NzahmoAR7VG1r1ITr4Z7HCUixGzh2FV1WFFTH+tpgBXtIQJk39pLQe1 yE/S2c2fIX/ytiHcd9u50SKOAXYOSgwLQJw+0BeGIQ1ZuFrAEqEvDIAHRseBi4rQTiaQ xYBw== 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=+g1pX8kL0ywRot5Ot6dsLwBfrWbbWL9qZYh2h2zCWlA=; b=oWNBIas0kKeJlQ5YM3gMAuYJugUqTb+g3HSXMj8lg0xNXIiUGBbn6Zn2VDhorfZKU7 sC5INgijiD8vbzgvJ257zT2uCg9ugAHxSPaXovZDJiTNQAk/MAvyBpfCYb8r/Cyn7bA4 4kwLMQQaexVwPX0DfsUYEo8oY5BEsW2YeSC67eCmXPkmuUeVhyx5Bc1FwRxwyzymsOX2 DJB+XfAkCpSiaxSnHmE/tVjvwmP9u5k7U5AeXEeFAso1/yxBSvlLaJQFQiBBQzjCukYm O0hHkVtzNeM7vmQfIN5FpKEAE6Oq9ZxuQb+uA3rc9eMTXgA6f5gU0Hzl2+S/IRJVY0VK TmZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a15J1dRV; 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 g17-20020aa79f11000000b006645f87dbf2si11865700pfr.223.2023.06.16.09.01.24; Fri, 16 Jun 2023 09:01:39 -0700 (PDT) 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=a15J1dRV; 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 S1345770AbjFPPpX (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Fri, 16 Jun 2023 11:45:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346123AbjFPPpK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 16 Jun 2023 11:45:10 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 759C0295C for <linux-kernel@vger.kernel.org>; Fri, 16 Jun 2023 08:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686930259; 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=+g1pX8kL0ywRot5Ot6dsLwBfrWbbWL9qZYh2h2zCWlA=; b=a15J1dRVsesGqDNCepfiPPIai5biI0J9iVJUO9aX9hkjz0nlW0KDKqUzdrqIAtM25l4Umo OHFXTH6PRjGR4LSx0O7Jq5O7Lo1/Hxg2xeKTHHFIZN3LDAO9sZTLwBuGIsdimn/IDo3jAe bZvEfDAfhbbe1q1RJNUL4IHA1tLF4aY= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-358-WqvzgqaXO56kNJ1qLK2WrQ-1; Fri, 16 Jun 2023 11:44:18 -0400 X-MC-Unique: WqvzgqaXO56kNJ1qLK2WrQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-75caeec5545so148408885a.0 for <linux-kernel@vger.kernel.org>; Fri, 16 Jun 2023 08:44:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686930258; x=1689522258; 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=+g1pX8kL0ywRot5Ot6dsLwBfrWbbWL9qZYh2h2zCWlA=; b=T0ze/68ozq0AQigBd4fEolxWzUiMXmdqJx374y9SmH1BklyFrndKHFkN1nzPjuJ/aL JecJLwjrqQqIGnjqCDYV7jqmKrZUhCccM8S5te+b9OqU5E/97KHo7EqGQCth/Knh7Sbo sbtXAGyfSlwXe2lo7t1bTWtBMtesUQVA6ZGmzl72p4tIwKtAuj52kr9ENzB9lQ8FrKin iaX4nRTaq+svUP0wFEf9mHzgGvCjuJm9y5SaXK8ruvD3hgodgBYprFD6wUf0ZXdguYVE RS9oB6jOawCwAMcbsuATekdA7JSE5TjeEwjYXoeUCPKa4CrqXgZiaEzwJd9TJy7WaXvA Omrg== X-Gm-Message-State: AC+VfDwLzPe31Efm2iZapKDuOXOFZ7pTiQtxwZDQVNbO8h0CLIqsunNR yFjB8zEkAQj4ZVFQvNahBZsS3gaW0Mqbz4GXKHXQ/62ttTurkN6aB76oAaRb62d+mvHEcxFzirP S61TTyYIvnFj73Vz1HF89Kok= X-Received: by 2002:a05:620a:8d09:b0:75f:2c0:8e6b with SMTP id rb9-20020a05620a8d0900b0075f02c08e6bmr1736544qkn.43.1686930258275; Fri, 16 Jun 2023 08:44:18 -0700 (PDT) X-Received: by 2002:a05:620a:8d09:b0:75f:2c0:8e6b with SMTP id rb9-20020a05620a8d0900b0075f02c08e6bmr1736528qkn.43.1686930258049; Fri, 16 Jun 2023 08:44:18 -0700 (PDT) Received: from klayman.redhat.com (net-2-34-28-201.cust.vodafonedsl.it. [2.34.28.201]) by smtp.gmail.com with ESMTPSA id 27-20020a05620a079b00b007607ecd58ecsm4436931qka.59.2023.06.16.08.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 08:44:17 -0700 (PDT) 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: [PATCH v7 0/4] fpga: add initial KUnit tests for the subsystem Date: Fri, 16 Jun 2023 17:44:01 +0200 Message-Id: <20230616154405.220502-1-marpagan@redhat.com> X-Mailer: git-send-email 2.40.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_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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?1768875674485160182?= X-GMAIL-MSGID: =?utf-8?q?1768875674485160182?= |
Series |
fpga: add initial KUnit tests for the subsystem
|
|
Message
Marco Pagani
June 16, 2023, 3:44 p.m. UTC
This patch set introduces an initial set of KUnit test suites for the core components of the FPGA subsystem. Tests can be run using: [user@localhost linux]$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/fpga/tests v7: - Dropped RFC prefix - Add comments to explain fakes and helper functions - Changed the implementation of the Bridge used in the Region suite v6: - Restructured the code into self-contained test modules - Added tests for the basic behaviors of the components - Improved programming tests for the FPGA Manager - Fixed code/comments mismatch in the list of Bridges test case v5: - Removed most of the exported functions using shared buffers for stats - Moved all KUnit expectations/assertions to the main test module - Removed standalone use case to simplify the code - Removed instances counters from fake components (using device.id instead) - Set header size in the .parse_header op - Improved bridge get_put_list test case v4: - Fix build error v3: - Calling fpga_bridges_put() between reconfigurations - Functions for registering fake modules allocate and return context structs v2: - Restructured code into multiple suites to test components in isolation - Reduced code duplication using init and exit methods - Using a get_bridges() method to build the list of bridges just before programming - Regions and Bridges are organized topologically - Changed bitstream/bit to images - Allocate images dynamically - Renamed fpga-tests to fpga-test - Simplified Kconfig - Add license info to the fpga-test module Marco Pagani (4): fpga: add an initial KUnit suite for the FPGA Manager fpga: add an initial KUnit suite for the FPGA Bridge fpga: add an initial KUnit suite for the FPGA Region fpga: add configuration for the FPGA KUnit test suites. drivers/fpga/Kconfig | 2 + drivers/fpga/Makefile | 3 + drivers/fpga/tests/.kunitconfig | 5 + drivers/fpga/tests/Kconfig | 11 + drivers/fpga/tests/Makefile | 5 + drivers/fpga/tests/fpga-bridge-test.c | 175 +++++++++++++++ drivers/fpga/tests/fpga-mgr-test.c | 302 ++++++++++++++++++++++++++ drivers/fpga/tests/fpga-region-test.c | 211 ++++++++++++++++++ 8 files changed, 714 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/fpga-bridge-test.c create mode 100644 drivers/fpga/tests/fpga-mgr-test.c create mode 100644 drivers/fpga/tests/fpga-region-test.c base-commit: 858fd168a95c5b9669aac8db6c14a9aeab446375