Re: [PATCH blktests v1 2/3] nvme/rc: Avoid triggering host nvme-cli autoconnect

From: Shinichiro Kawasaki
Date: Wed Jun 28 2023 - 06:08:46 EST


On Jun 28, 2023 / 08:09, Daniel Wagner wrote:
> On Tue, Jun 27, 2023 at 10:22:53AM +0000, Shinichiro Kawasaki wrote:
> > On Jun 20, 2023 / 15:27, Daniel Wagner wrote:
> > > When the host has enabled the udev/systemd autoconnect services for the
> > > fc transport it interacts with blktests and make tests break.
> > >
> > > nvme-cli learned to ignore connects attemps when using the
> > > --context command line option paired with a volatile configuration. Thus
> > > we can mark all the resources created by blktests and avoid any
> > > interaction with the systemd autoconnect scripts.
> >
> > This sounds a good idea. Question, is "--context" option of the nvme command
> > mandatory to run nvme test with nvme_trtype=fc?
>
> If nvme-cli is called without the '--context' option, the command will be
> executed. Though if '--context' is provided as option and there is a
> configuration which matches the connect parameters but doesn't match the context
> it will ignore the operation.
>
> The blktests tests expects that nothing behind it's back is fiddling on the
> setup while it is running. So far udev didn't trigger for rdma/tcp but with fc
> it will.
>
> Thus, it's mandatory to use either the '--context' parameter or alternatively
> disable the rule with
>
> ln -s /etc/udev/rules.d/70-nvmf-autoconnect.rules /dev/null
>
> BTW, when the udev rule is active I observed crashes when running blktests. So
> there is more to fix, though one thing at the time.
>
> > Or is it nice-to-have feature
> > depending on the test system OS? If it is mandatory, it's the better to check
> > in _nvme_requires.
>
> Well, I didn't want to make this a hard requirement for all tests. I guess we
> could make it for fc only if this is what you had in mind. The question should
> it only test for nvme-cli supporting --context or should it be really clever and
> test if the udev rule is also active (no idea how but I assume it is possible)?

Thanks for the explanations. It looks that the requirement check I suggested i
_nvme_requires will be will be too much. And I don't have good idea for the udev
rule check either, so let's settle this change without the checks.