mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 00/13] firewire: core: add KUnit tests for config ROM parser and generator
@ 2026-09-01 13:45 Takashi Sakamoto
  2026-09-01 13:45 ` [PATCH 01/13] firewire: core: add KUnit test skeleton " Takashi Sakamoto
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Takashi Sakamoto @ 2026-09-01 13:45 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel, mistermidi, sreekuttan2156239

Hi,

(Resent because the previous email was sent to the wrong address...)

This series adds KUnit tests for the configuration ROM parser and
generator in the core function.

The parser tests cover existing device quirks and malformed configuration
ROMs, including out-of-bounds directory/leaf entries.

The generator tests cover AV/C and IIDC devices layouts, combinations of
units, and invalid or oversized extension data.

The tests are intended to document existing behavior and provide regression
coverage for the parser and generator.

The test execution samples:

```
$ python3 tools/testing/kunit/kunit.py run \
  --kunitconfig=drivers/firewire/ \
  'firewire-config-rom-*'
[22:12:56] Configuring KUnit Kernel ...
[22:12:56] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=16
[22:12:59] Starting KUnit Kernel (1/1)...
[22:12:59] ============================================================
Running tests with:
$ .kunit/linux 'kunit.filter_glob=firewire-config-rom-*' kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[22:12:59] ======== firewire-config-rom-generator (4 subtests) ========
[22:12:59] ================ test_config_rom_generator  ================
[22:12:59] [PASSED] bare
[22:12:59] [PASSED] with_avc_unit
[22:12:59] [PASSED] with_iidc_unit
[22:12:59] [PASSED] with_avc_and_iidc_unit
[22:12:59] ============ [PASSED] test_config_rom_generator ============
[22:12:59] [PASSED] add_descriptor_with_invalid_length
[22:12:59] [PASSED] add_descriptor_with_invalid_data
[22:12:59] [PASSED] add_descriptor_beyond_upper_limit
[22:12:59] ========== [PASSED] firewire-config-rom-generator ==========
[22:12:59] ========= firewire-config-rom-parser (2 subtests) ==========
[22:12:59] ============= test_parser_with_regular_cases  ==============
[22:12:59] [PASSED] detect_irm_is_1394_1995_only_quirk
[22:12:59] [PASSED] detect_irm_ignores_bus_manager_quirk
[22:12:59] [PASSED] detect_ack_packet_with_invalid_pending_code_quirk
[22:12:59] [PASSED] detect_unstable_at_s400_quirk
[22:12:59] ========= [PASSED] test_parser_with_regular_cases ==========
[22:12:59] [PASSED] test_parser_with_overflowed_case
[22:12:59] =========== [PASSED] firewire-config-rom-parser ============
[22:12:59] ============================================================
[22:12:59] Testing complete. Ran 12 tests: passed: 12
[22:12:59] Elapsed time: 2.743s total, 0.001s configuring, 2.625s building, 0.085s running
```

Regards


Takashi Sakamoto (13):
  firewire: core: add KUnit test skeleton for config ROM parser and
    generator
  firewire: core: add test to detect irm-is-1394-1995-only quirk in
    config ROM parser
  firewire: core: add test to detect irm-ignores-bus-manager quirk in
    config ROM parser
  firewire: core: add test to detect
    ack-packet-with-invalid-pending-code quirk in config ROM parser
  firewire: core: add test to detect unstable-at-s400 quirk in config
    ROM parser
  firewire: core: add test to avoid excessive configuration ROM length
  firewire: core: add test for root directory generation in config ROM
    generator
  firewire: core: add test to generate with AV/C unit in config ROM
    generator
  firewire: core: add test to generate with IIDC unit in config ROM
    generator
  firewire: core: add test to generate with both AV/C and IIDC units in
    config ROM generator
  firewire: core: add test for invalid length in config ROM generator
  firewire: core: add invalid block test for config ROM generator
  firewire: core: add test for beyond-boundary case in config ROM
    generator

 drivers/firewire/.kunitconfig                |   1 +
 drivers/firewire/Kconfig                     |  16 +
 drivers/firewire/config-rom-generator-test.c | 407 +++++++++++++++++++
 drivers/firewire/config-rom-parser-test.c    | 355 ++++++++++++++++
 drivers/firewire/core-card.c                 |   4 +
 drivers/firewire/core-device.c               |   4 +
 drivers/firewire/core-transaction.c          |   4 +
 7 files changed, 791 insertions(+)
 create mode 100644 drivers/firewire/config-rom-generator-test.c
 create mode 100644 drivers/firewire/config-rom-parser-test.c


base-commit: 61defa04bf0578ff9f7a52a8c74a9cb5acd8fced
-- 
2.53.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-09-03  0:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01 13:45 [PATCH 00/13] firewire: core: add KUnit tests for config ROM parser and generator Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 01/13] firewire: core: add KUnit test skeleton " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 02/13] firewire: core: add test to detect irm-is-1394-1995-only quirk in config ROM parser Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 03/13] firewire: core: add test to detect irm-ignores-bus-manager " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 04/13] firewire: core: add test to detect ack-packet-with-invalid-pending-code " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 05/13] firewire: core: add test to detect unstable-at-s400 " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 06/13] firewire: core: add test to avoid excessive configuration ROM length Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 07/13] firewire: core: add test for root directory generation in config ROM generator Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 08/13] firewire: core: add test to generate with AV/C unit " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 09/13] firewire: core: add test to generate with IIDC " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 10/13] firewire: core: add test to generate with both AV/C and IIDC units " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 11/13] firewire: core: add test for invalid length " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 12/13] firewire: core: add invalid block test for " Takashi Sakamoto
2026-09-01 13:45 ` [PATCH 13/13] firewire: core: add test for beyond-boundary case in " Takashi Sakamoto
2026-09-03  0:01 ` [PATCH 00/13] firewire: core: add KUnit tests for config ROM parser and generator Takashi Sakamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®