[PATCH v2 4/7] tests/nvme: restrict tests to specific transports

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Thu Aug 6 23:15:36 EDT 2020


On 8/6/20 12:15, Sagi Grimberg wrote:
> diff --git a/tests/nvme/027 b/tests/nvme/027
> index 805a3c63eba2..53766775e096 100755
> --- a/tests/nvme/027
> +++ b/tests/nvme/027
> @@ -12,6 +12,7 @@ QUICK=1
>   requires() {
>   	_nvme_requires
>   	_have_modules loop
> +	_require_nvme_trtype_not_pci
>   }
>   
>   test() {
> diff --git a/tests/nvme/028 b/tests/nvme/028
> index c9bd3dde7f20..6fbf0d6d7938 100755
> --- a/tests/nvme/028
> +++ b/tests/nvme/028
> @@ -12,6 +12,7 @@ QUICK=1
>   requires() {
>   	_nvme_requires
>   	_have_modules loop
> +	_require_nvme_trtype_not_pci
>   }
>   
>   test() {
> diff --git a/tests/nvme/029 b/tests/nvme/029
> index 7bf904b16edc..7a4fd8d6d4c5 100755
> --- a/tests/nvme/029
> +++ b/tests/nvme/029
> @@ -13,6 +13,7 @@ QUICK=1
>   requires() {
>   	_nvme_requires
>   	_have_modules loop
> +	_require_nvme_trtype_not_pci
>   }
>   
>   test_user_io()
> diff --git a/tests/nvme/030 b/tests/nvme/030
> index 220b29f42962..44f3b56dec4e 100755
> --- a/tests/nvme/030
> +++ b/tests/nvme/030
> @@ -12,6 +12,7 @@ QUICK=1
>   requires() {
>   	_nvme_requires
>   	_have_modules loop
> +	_require_nvme_trtype_not_pci
>   }
>   
>   
> diff --git a/tests/nvme/031 b/tests/nvme/031
> index 001f9d2b0b3a..a5714982b5d9 100755
> --- a/tests/nvme/031
> +++ b/tests/nvme/031
> @@ -20,6 +20,7 @@ QUICK=1
>   requires() {
>   	_nvme_requires
>   	_have_modules loop
> +	_require_nvme_trtype_not_pci
>   }
>   
>   test() {
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 191f0497416a..a2cb0c0add93 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -46,6 +46,22 @@ _require_test_dev_is_nvme() {
>   	return 0
>   }
>   
> +_require_nvme_trtype_is_loop() {
> +	if [[ "${nvme_trtype}" != "loop" ]]; then
> +		SKIP_REASON="nvme_trtype=${nvme_trtype} is not supported in this test"
> +		return 1
> +	fi
> +	return 0
> +}
> +
> +_require_nvme_trtype_not_pci() {
> +	if [[ "${nvme_trtype}" == "pci" ]]; then
> +		SKIP_REASON="nvme_trtype=${nvme_trtype} is not supported in this test"
> +		return 1
> +	fi
> +	return 0
> +}
> +
how about instead of not_pci  if we can requires_nvme_trtype_fabrics -> 
returns true for loop/rdma/tcp etc ?

It is a same thing, just my preference to void not.
>   _cleanup_nvmet() {
>   	local dev
>   	local port
> -- 2.25.1




More information about the Linux-nvme mailing list