public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: Bart Van Assche <bvanassche@acm.org>, Omar Sandoval <osandov@fb.com>
Cc: linux-block@vger.kernel.org,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: Re: [PATCH blktests] Make the NVMe tests more reliable
Date: Tue, 6 Aug 2019 09:43:00 -0600	[thread overview]
Message-ID: <dccabead-a290-ff2f-976a-c1dcdc4ea2c2@deltatee.com> (raw)
In-Reply-To: <20190805232512.50992-1-bvanassche@acm.org>



On 2019-08-05 5:25 p.m., Bart Van Assche wrote:
> When running blktests with kernel debugging enabled it can happen that
> _find_nvme_loop_dev() returns before the NVMe block device has appeared
> in sysfs. This patch avoids that the NVMe tests fail as follows:
> 
> +cat: /sys/block/nvme1n1/uuid: No such file or directory
> +cat: /sys/block/nvme1n1/wwid: No such file or directory
> 
> Cc: Logan Gunthorpe <logang@deltatee.com>
> Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> Cc: Johannes Thumshirn <jthumshirn@suse.de>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Makes sense to me.

Reviewed-by: Logan Gunthorpe <logang@deltatee.com>

> ---
>  tests/nvme/rc | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 348b4a3c2cbc..05dfc5915a13 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -169,8 +169,16 @@ _find_nvme_loop_dev() {
>  		transport="$(cat "/sys/class/nvme/${dev}/transport")"
>  		if [[ "$transport" == "loop" ]]; then
>  			echo "$dev"
> +			for ((i=0;i<10;i++)); do
> +				[ -e /sys/block/$dev/uuid ] &&
> +					[ -e /sys/block/$dev/wwid ] &&
> +					return 0
> +				sleep .1
> +			done
> +			return 1
>  		fi
>  	done
> +	return 1
>  }
>  
>  _filter_discovery() {
> 

  parent reply	other threads:[~2019-08-06 15:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 23:25 [PATCH blktests] Make the NVMe tests more reliable Bart Van Assche
2019-08-06  8:11 ` Johannes Thumshirn
2019-08-06 15:11   ` Bart Van Assche
2019-08-07  7:14     ` Johannes Thumshirn
2019-08-06 15:43 ` Logan Gunthorpe [this message]
2019-08-07 17:23 ` Omar Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dccabead-a290-ff2f-976a-c1dcdc4ea2c2@deltatee.com \
    --to=logang@deltatee.com \
    --cc=bvanassche@acm.org \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox