diff mbox series

[blktests,v1,4/5] nvme/rc: do not issue errors when disconnecting when using fc transport

Message ID 20240206131655.32050-5-dwagner@suse.de (mailing list archive)
State New, archived
Headers show
Series fc transport cleanups | expand

Commit Message

Daniel Wagner Feb. 6, 2024, 1:16 p.m. UTC
When running the tests with FC as transport and the udev auto connect
enabled, discovery controllers are created and destroys while the tests
are running.

The cleanup code expects that all devices are under blktetsts control,
but this isn't the case. Thus filter out disconnect failures as well.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 tests/nvme/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chaitanya Kulkarni Feb. 6, 2024, 11:09 p.m. UTC | #1
On 2/6/2024 5:16 AM, Daniel Wagner wrote:
> When running the tests with FC as transport and the udev auto connect
> enabled, discovery controllers are created and destroys while the tests
> are running.
> 
> The cleanup code expects that all devices are under blktetsts control,
> but this isn't the case. Thus filter out disconnect failures as well.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>   tests/nvme/rc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index ca6a284a1e25..cdfc738d3aec 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -356,7 +356,7 @@ _cleanup_nvmet() {
>   			if [[ "$transport" != "fc" ]]; then
>   				echo "WARNING: Test did not clean up ${nvme_trtype} device: ${dev}"
>   			fi
> -			_nvme_disconnect_ctrl "${dev}"
> +			_nvme_disconnect_ctrl "${dev}" 2>/dev/null

will this only happen for discovery controller or non-discovery
controllers also ?

-ck
Daniel Wagner Feb. 7, 2024, 8:25 a.m. UTC | #2
On Tue, Feb 06, 2024 at 11:09:56PM +0000, Chaitanya Kulkarni wrote:
> > -			_nvme_disconnect_ctrl "${dev}"
> > +			_nvme_disconnect_ctrl "${dev}" 2>/dev/null
> 
> will this only happen for discovery controller or non-discovery
> controllers also ?

The global cleanup code disconnects all controllers. Another option
would be that we ditch the global cleanup code because every test is
already removing all resources it creates. This would also make blktests
play a bit nicer. But this is how it is currently done for all
transport.
Shin'ichiro Kawasaki Feb. 7, 2024, 10 a.m. UTC | #3
On Feb 06, 2024 / 14:16, Daniel Wagner wrote:
> When running the tests with FC as transport and the udev auto connect
> enabled, discovery controllers are created and destroys while the tests

Same nit comment for "destroys".

> are running.
> 
> The cleanup code expects that all devices are under blktetsts control,

Same spell comment on "blktetsts".

> but this isn't the case. Thus filter out disconnect failures as well.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>  tests/nvme/rc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index ca6a284a1e25..cdfc738d3aec 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -356,7 +356,7 @@ _cleanup_nvmet() {
>  			if [[ "$transport" != "fc" ]]; then
>  				echo "WARNING: Test did not clean up ${nvme_trtype} device: ${dev}"
>  			fi
> -			_nvme_disconnect_ctrl "${dev}"
> +			_nvme_disconnect_ctrl "${dev}" 2>/dev/null
>  		fi
>  	done
>  
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/tests/nvme/rc b/tests/nvme/rc
index ca6a284a1e25..cdfc738d3aec 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -356,7 +356,7 @@  _cleanup_nvmet() {
 			if [[ "$transport" != "fc" ]]; then
 				echo "WARNING: Test did not clean up ${nvme_trtype} device: ${dev}"
 			fi
-			_nvme_disconnect_ctrl "${dev}"
+			_nvme_disconnect_ctrl "${dev}" 2>/dev/null
 		fi
 	done