Skip to content

fpga: add initial KUnit tests for the subsystem

Marco Pagani linux-fpga lkml 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest4 patches 6 repliesIn review
  2. v94 patches 1 replySuperseded
  3. v84 patches 4 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v74 patches7 repliesSuperseded
v6 RFC4 patches8 repliesSuperseded
v5 RFC4 patches7 repliesSuperseded
v4 RFC4 patches8 repliesSuperseded
v3 RFC4 patches0 repliesSuperseded
v2 RFC4 patches6 repliesSuperseded
v1 RFC4 patches17 repliesSuperseded

Changes in v10 from the cover letter

- Improved code style and fixed comment typos for FPGA Manager ops

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4fpga: add an initial KUnit suite for the FPGA Managerdrivers/fpga/tests/fpga-mgr-test.c+327 -03 replies
2/4fpga: add an initial KUnit suite for the FPGA Bridgedrivers/fpga/tests/fpga-bridge-test.c+175 -01 reply
3/4fpga: add an initial KUnit suite for the FPGA Regiondrivers/fpga/tests/fpga-region-test.c+211 -01 reply
4/4fpga: add configuration for the FPGA KUnit test suites.drivers/fpga/Kconfig drivers/fpga/Makefile drivers/fpga/tests/.kunitconfig +2 more+27 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchXu Yilun
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v10 thread

Cover letter [PATCH v10 0/4] fpga: add initial KUnit tests for the subsystem

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

v10:
- Improved code style and fixed comment typos for FPGA Manager ops

v9:
- Improved and commented test ops for the FPGA Manager test suite
- Fixed minor capitalization discrepancies

v8:
- Using memset to set header and payload of the test image
- Using sg_miter_* functions to check the image in the write_sg op
- Includes sorted in alphabetical order
- Add commas for fpga_bridge_ops
- Improved Makefile

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           |   6 +
 drivers/fpga/tests/fpga-bridge-test.c | 175 ++++++++++++++
 drivers/fpga/tests/fpga-mgr-test.c    | 327 ++++++++++++++++++++++++++
 drivers/fpga/tests/fpga-region-test.c | 211 +++++++++++++++++
 8 files changed, 740 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: fdf0eaf11452d72945af31804e2a1048ee1b574c

Signature · 1 line
2.41.0