Skip to content

tests: consistent test names and group suites - #4221

Merged
igaw merged 8 commits into
linux-nvme:masterfrom
dwsuse:test-names
Oct 19, 2026
Merged

igaw merged 8 commits into
linux-nvme:masterfrom
dwsuse:test-names

Conversation

@dwsuse

@dwsuse dwsuse commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The test names are not consistent: some end in -cli, some in _mock_test, some use underscores or spaces, and the plugin tests repeat the plugin name up to three times:

micron+micron-cli - nvme-cli:nvme-cli - micron_latency_mock_test
fuzz - nvme-cli:nvme-cli - fuzz-ini
nvme-cli:nvme-discoverd - missing --config

This series applies one rule: every test is named <component> - <test> and is in exactly one group suite.

  • <component> is what the test covers: nvme-cli, libnvme, shared, a daemon or a plugin.
  • <test> is kebab-case and names the feature, without -cli/_mock_test suffixes. Fuzz and e2e tests start with fuzz-/e2e-, so they don't collide with the unit and mock tests of the same thing. Tests over a set of inputs use / like the existing header/ tests: nbft/, python/.
  • The group says how a test runs:
Group Tests What runs
unit 97 a test program for library or internal code
mock 50 the nvme binary or a daemon, with a mock where it needs a device
e2e 39 the nvme binary against a real device
fuzz 5 a fuzz target over its corpus
check 38 consistency checks: headers, symbols, docs, install tags, generated completions
mock - nvme-cli:micron - latency
fuzz - nvme-cli:nvme-cli - fuzz-ini
mock - nvme-cli:nvme-discoverd - missing-config
e2e  - nvme-cli:micron - e2e-id-ctrl

meson test --suite unit --suite mock runs all behaviour tests, and a name pattern selects a component, e.g. meson test 'micron - *'. The unused plugin suites (micron-cli, ...) are dropped; --suite fuzz works as documented before. Documentation/TESTING.md gets a section on the names and groups.

Nothing in CI or scripts refers to the old names. Each commit configures on its own (229 tests, no duplicate names, e2e names checked with -De2e-tests=true), and the test suite passes.

Half of the tests of the nvme binary end in -cli, the other half do not,
and some names use underscores or a space. Name each test after the
feature it covers, in kebab-case like the other tests:

  nvme-cli - print-cli         -> nvme-cli - print
  nvme-cli - fabrics-mock-cli  -> nvme-cli - fabrics
  nvme-cli - argconfig_parse   -> nvme-cli - argconfig-parse
  nvme-cli - plugin dispatch   -> nvme-cli - plugin-dispatch

The test of the e2e runner is no e2e test, but its name starts like one.
Name it after the runner, nvme-cli-e2e - tap.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The plugin tests run as part of nvme-cli and repeat the plugin name in
the test name and in two suites:

  micron+micron-cli - nvme-cli:nvme-cli - micron_latency_mock_test

Use the plugin as the component, as the e2e plugin tests do, and name
the test after the command it covers, without the _mock_test suffix:

  nvme-cli:micron - latency

The micron and ocp names are derived from the file names, so the files
keep their names. Drop the plugin suites, nothing uses them: a name
pattern selects the tests of a plugin, e.g. meson test 'micron - *'.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The fabrics-conf target fuzzes the libnvme config parser, but its test
is named after nvme-cli. Let a target name its component, and name the
fabrics-conf test libnvme - fuzz-fabrics-conf.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Some daemon test names contain spaces or the option they test, e.g.
'nvme-keysd - missing --config'. Use kebab-case like the other tests:

  nvme-keysd - --help            -> nvme-keysd - help
  nvme-keysd - unknown option    -> nvme-keysd - unknown-option
  nvme-keysd - missing --config  -> nvme-keysd - missing-config
  nvme-keysd - kmip tls          -> nvme-keysd - kmip-tls

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The NBFT tests are named after their table file, e.g. libnvme -
NBFT-rhpoc, the Python binding tests start with python-. Group them
with a / like the header tests: libnvme - nbft/rhpoc and libnvme -
python/config.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The e2e test names are the file names, e.g. nvme-cli -
nvme_id_ctrl_test, and the plugin e2e tests are in a suite of their
plugin. A mock test and an e2e test of the same command cannot be told
apart by their name once the file name suffixes are gone.

Name the e2e tests e2e-<command>, e.g. nvme-cli - e2e-id-ctrl and
micron - e2e-id-ctrl, and put all of them in the e2e suite. Update the
README of the plugin e2e tests to select them with it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Only the fuzz and e2e tests are in a suite, so there is no way to run,
e.g., just the fast tests which need neither a device nor a mock. Put
every test in exactly one group, which says how the test runs:

  unit   a test program for library or internal code
  mock   the nvme binary or a daemon, with a mock where it needs a
         device
  e2e    the nvme binary against a real device
  fuzz   a fuzz target over its corpus
  check  a consistency check of the tree: headers, symbols, docs,
         install tags, generated completions

meson test --suite unit --suite mock then runs all behaviour tests,
and meson test prints the group in front of every test.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Describe how tests are named, what the groups mean and how to select
tests by group or by name.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
@igaw
igaw merged commit 9530e56 into linux-nvme:master Oct 19, 2026
35 checks passed
@dwsuse
dwsuse deleted the test-names branch October 23, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants