diff options
author | David Teigland <teigland@redhat.com> | 2023-02-06 12:18:55 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2023-02-06 12:24:18 -0600 |
commit | dc99f0def17b936f95c63612a56ae2a6ae81db0e (patch) | |
tree | 2c2a52adf69577182257685663385715dc630461 /test/shell | |
parent | 57ad78d4369ee531ab0173b42aa91048eb316353 (diff) | |
download | lvm2-dc99f0def17b936f95c63612a56ae2a6ae81db0e.tar.gz |
device_id: ignore quotes in device id
A t10 wwid string was found containing a " character
which breaks vg metadata parsing. Ignore any quotation
marks in device id strings.
Diffstat (limited to 'test/shell')
-rw-r--r-- | test/shell/devicesfile-vpd-ids.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/shell/devicesfile-vpd-ids.sh b/test/shell/devicesfile-vpd-ids.sh index 2801310ef..b2042fb9a 100644 --- a/test/shell/devicesfile-vpd-ids.sh +++ b/test/shell/devicesfile-vpd-ids.sh @@ -219,6 +219,30 @@ vgremove $vg rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/wwid cleanup_sysfs +# Test t10 wwid containing quote +rm $DF +aux wipefs_a "$DEV1" +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/ +echo "t10.ATA_2.5\"_SATA_SSD_1112-A___111111111111" > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/wwid +lvmdevices --adddev "$DEV1" +cat $DF +vgcreate $vg "$DEV1" +lvcreate -l1 -an $vg +cat $DF +# check wwid string in metadata output +pvs -o+deviceidtype,deviceid "$DEV1" |tee out +grep sys_wwid out +# the quote is removed after the 5 +grep 2.5_SATA_SSD out +# check wwid string in system.devices +grep sys_wwid $DF +# the quote is removed after the 5 +grep 2.5_SATA_SSD $DF +lvremove -y $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. |