All of lore.kernel.org
 help / color / mirror / Atom feed
* main - tests: devicesfile-vpd-ids add nvme wwid
@ 2022-11-21 16:58 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2022-11-21 16:58 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2da4ca7ce163fe89b3c79b1d6c55aa30eaa6307d
Commit:        2da4ca7ce163fe89b3c79b1d6c55aa30eaa6307d
Parent:        e0ea0706dc884916c36b7fca285b621eafefc2bf
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Mon Nov 21 10:57:30 2022 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Mon Nov 21 10:57:30 2022 -0600

tests: devicesfile-vpd-ids add nvme wwid

---
 test/shell/devicesfile-vpd-ids.sh | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/test/shell/devicesfile-vpd-ids.sh b/test/shell/devicesfile-vpd-ids.sh
index 0eca56935..2801310ef 100644
--- a/test/shell/devicesfile-vpd-ids.sh
+++ b/test/shell/devicesfile-vpd-ids.sh
@@ -62,8 +62,8 @@ setup_sysfs() {
 cleanup_sysfs() {
 	rm -f $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid
 	rm -f $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/vpd_pg83
-	rmdir $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device
-	rmdir $SYS_DIR/dev/block/$MAJOR1:$MINOR1
+	rmdir $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device || true
+	rmdir $SYS_DIR/dev/block/$MAJOR1:$MINOR1 || true
 }
 
 
@@ -193,9 +193,34 @@ rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid
 pvs "$DEV1"
 cleanup_sysfs
 
+# Test nvme wwid that starts with "nvme" instead of naa/eui/t10
+rm $DF
+aux wipefs_a "$DEV1"
+mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/
+echo "nvme.111111111111111111122222222222333333333333333-44444444444444444445555555555556666666666666666662-00000001" > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/wwid
+lvmdevices --adddev "$DEV1"
+cat $DF
+vgcreate $vg "$DEV1"
+lvcreate -l1 -an $vg
+cat $DF
+pvs -o+deviceidtype,deviceid "$DEV1" |tee out
+grep sys_wwid out
+grep nvme.111 out
+grep sys_wwid $DF
+grep nvme.111 $DF
+lvmdevices --deldev "$DEV1"
+not lvmdevices --adddev "$DEV1" --deviceidtype wwid_eui
+lvmdevices --adddev "$DEV1" --deviceidtype sys_wwid
+lvmdevices | grep nvme.111
+lvremove -y $vg
+sleep 1
+lvs $vg
+vgremove $vg
+rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/wwid
+cleanup_sysfs
 
 # TODO: lvmdevices --adddev <dev> --deviceidtype <type> --deviceid <val>
 # This would let the user specify the second naa wwid.
 
 remove_base
-rmmod scsi_debug
+rmmod scsi_debug || true


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-21 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 16:58 main - tests: devicesfile-vpd-ids add nvme wwid David Teigland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.