On Aug 16, 2023 / 16:14, Daniel Wagner wrote: > On Wed, Aug 16, 2023 at 12:04:24PM +0000, Shinichiro Kawasaki wrote: [...] > > 2) Rework _find_nvme_dev into two new functions _find_nvme_ctrl_dev and > > _find_nvme_ns_dev, and do the readiness check in _find_nvme_ns_dev. > > IMO, this confusion comes from the fact that _find_nvme_dev returns control > > device, but some test cases use it to operate namespaces by adding "n1" to > > the control device name. If a test case uses namespace device, it's the > > better to call _find_nvme_ns_dev. But I worry this approach may be too much. > > As we already have an argument parser in _nvme_connect_subsys, we could > also introduce a new option which allows to select the wait type. With > this _nvmet_passtrhu_target_connect could be something like > > _nvmet_passthru_target_connect() { > [...] > > _nvme_connect_subsys "${trtype}" "${subsys_name}" \ > --wait-for=device || return > > [...] > } > > and for the rest of the test cases we just set the default for > --wait-for to ns. Thanks. This idea sounds good. It will fix the failure and avoid the 1 second wait. Will implement this and send out as v2.