On 5/15/25 11:24 AM, Alison Schofield wrote:
> On Fri, May 09, 2025 at 09:39:15AM -0700, Dave Jiang wrote:
>> Add a unit test to verify the features ioctl commands. Test support added
>> for locating a features device, retrieve and verify the supported features
>> commands, retrieve specific feature command data, retrieve test feature
>> data, and write and verify test feature data.
>>
>> Acked-by: Dan Williams <dan.j.willi...@intel.com>
>> Signed-off-by: Dave Jiang <dave.ji...@intel.com>
>> ---
>> v6:
>> - Provide a fwctl option and move everything behind it. (Dan)
>> - Rename test app back to fwctl.c. (Dan)
>> - Fix spelling error. (Dan)
>> - Expand scope of fwctl device in documentation. (Dan)
>> ---
>> cxl/fwctl/cxl.h | 2 +-
>> meson_options.txt | 2 +
>> test/cxl-features.sh | 31 +++
>> test/fwctl.c | 439 +++++++++++++++++++++++++++++++++++++++++++
>> test/meson.build | 19 ++
>> 5 files changed, 492 insertions(+), 1 deletion(-)
>> create mode 100755 test/cxl-features.sh
>> create mode 100644 test/fwctl.c
>>
>
> skip -
>
>
>> diff --git a/test/meson.build b/test/meson.build
>> index d871e28e17ce..918db7e6049b 100644
>> --- a/test/meson.build
>> +++ b/test/meson.build
>> @@ -17,6 +17,13 @@ ndctl_deps = libndctl_deps + [
>> versiondep,
>> ]
>>
>> +libcxl_deps = [
>> + cxl_dep,
>> + ndctl_dep,
>> + uuid,
>> + kmod,
>> +]
>> +
>> libndctl = executable('libndctl', testcore + [ 'libndctl.c'],
>> dependencies : libndctl_deps,
>> include_directories : root_inc,
>> @@ -235,6 +242,18 @@ if get_option('keyutils').enabled()
>> ]
>> endif
>>
>> +uuid_dep = dependency('uuid', required: false)
>> +if get_option('fwctl').enabled() and uuid_dep.found()
>> + fwctl = executable('fwctl', 'fwctl.c',
>> + dependencies : libcxl_deps,
>> + include_directories : root_inc,
>> + )
>> + cxl_features = find_program('cxl-features.sh')
>> + tests += [
>> + [ 'cxl-features.sh', cxl_features, 'cxl' ],
>> + ]
>> +endif
>
> Is the fwctl feature enabled fuss still needed now that the UAPI headers
> are vendored locally? Seems the test will quickly SKIP if fwctl dev not
> found. I kind of like the idea of seeing a 'SKIP' and knowing the test
> didn't run than seeing nothing at all in the test output.
This gives the option to disable fwctl if needed. Also there is a libuuid
dependency since we use uuid lib calls.
>
>> +
>> foreach t : tests
>> test(t[0], t[1],
>> is_parallel : false,
>> --
>> 2.49.0
>>