Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 2020 21:23:39 +0000 (UTC)
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r359904 - stable/12/sbin/nvmecontrol/tests
Message-ID:  <202004132123.03DLNdoC079582@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lwhsu
Date: Mon Apr 13 21:23:39 2020
New Revision: 359904
URL: https://svnweb.freebsd.org/changeset/base/359904

Log:
  MFC r359903:
  
  Ensure `kyua list` working when there is no /dev/nvme*
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/sbin/nvmecontrol/tests/basic.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/nvmecontrol/tests/basic.sh
==============================================================================
--- stable/12/sbin/nvmecontrol/tests/basic.sh	Mon Apr 13 21:08:54 2020	(r359903)
+++ stable/12/sbin/nvmecontrol/tests/basic.sh	Mon Apr 13 21:23:39 2020	(r359904)
@@ -33,7 +33,7 @@
 
 DANGEROUS=false # Set to true to run "dangerous" tests
 # Select a nvme device to use for testing. If none exist, use nvme0.
-TEST_DEV=$(cd /dev/;ls nvme[0-9]* | grep 'nvme[0-9][0-9]*$' | head -1) 2>/dev/null
+TEST_DEV=$(cd /dev/; ls -1 nvme[0-9]* 2> /dev/null | grep -E 'nvme[0-9][0-9]*$' | head -n 1)
 TEST_DEV=${TEST_DEV:-nvme0}
 TEST_DEV_PATH=/dev/${TEST_DEV}
 INV_OPT="-z"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004132123.03DLNdoC079582>