[PATCH blktests 2/2] nvme/rc, md/001: check that nvme-cli supports json output format

Chaitanya Kulkarni chaitanyak at nvidia.com
Tue May 20 12:18:26 PDT 2025


On 5/19/25 23:18, Shin'ichiro Kawasaki wrote:
> When nvme-cli is built on a system without the json-c library, the nvme
> command does not support the json output format. Consequently, the
> "-o json" option, or in the long form "--output-format=json", of the
> nvme command fails. It causes the helper function _nvme_connect_subsys()
> to break. This leads to silent failures in many test cases in the nvme
> test group as well as the test case md/001.
>
> To inform blktests users this prerequisite, call the helper function
> _have_nvme_cli_with_json_support(). As to the nvme test group, do the
> check in group_requires() so that the check is done only once for all of
> the test cases in the group. If the format is unsupported, the nvme test
> group and the test case md/001 are skipped, and the reason to skip is
> printed. This change makes the nvme command existence check in
> _nvme_requires() redundant, then remove it.
>
> Link:https://lore.kernel.org/linux-nvme/20250519054905.GA6156@lst.de/
> Fixes: 444f0df9f0c5 ("nvme: check for controller device in _nvme_connect_subsys()")
> Reported-by: Christoph Hellwig<hch at lst.de>
> Signed-off-by: Shin'ichiro Kawasaki<shinichiro.kawasaki at wdc.com>

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>

-ck




More information about the Linux-nvme mailing list