]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: populate /dev/disk/by-partuuid for scsi_debug 11411/head
authorLoic Dachary <ldachary@redhat.com>
Tue, 23 Aug 2016 10:17:00 +0000 (12:17 +0200)
committerLoic Dachary <ldachary@redhat.com>
Thu, 13 Oct 2016 12:14:45 +0000 (14:14 +0200)
The scsi_debug SCSI devices do not have a symlink in /dev/disk/by-partuuid
because they are filtered out by 60-persistent-storage.rules. That was
worked around by 60-ceph-partuuid-workaround-rules which has been
removed by 9f76b9ff31525eac01f04450d72559ec99927496.

Add create rules targetting this specific case, only for tests since the
problem does not show in real use cases.

Fixes: http://tracker.ceph.com/issues/17100
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 7cbf1f0a5eced402e6c7242015550668e3b568f3)

qa/workunits/ceph-disk/60-ceph-by-partuuid.rules [new file with mode: 0644]
qa/workunits/ceph-disk/ceph-disk.sh

diff --git a/qa/workunits/ceph-disk/60-ceph-by-partuuid.rules b/qa/workunits/ceph-disk/60-ceph-by-partuuid.rules
new file mode 100644 (file)
index 0000000..1ed0b12
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# Make sure /dev/disk/by-partuuid is populated
+#
+
+# forward scsi device event to corresponding block device
+ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
+
+ACTION=="remove", GOTO="persistent_storage_end_two"
+
+SUBSYSTEM!="block", GOTO="persistent_storage_end_two"
+
+# skip rules for inappropriate block devices
+KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|md*", GOTO="persistent_storage_end_two"
+
+# ignore partitions that span the entire disk
+TEST=="whole_disk", GOTO="persistent_storage_end_two"
+
+# for partitions import parent information
+ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
+
+# skip unpartitioned removable media devices from drivers which do not send "change" events
+ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end_two"
+
+# probe filesystem metadata of disks
+KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
+
+LABEL="persistent_storage_end_two"
index cf36324fb45229abece70e89a951f7f09a59869e..4bac24f112cc05ad761ae47b0ae79a929c363c2e 100755 (executable)
@@ -20,6 +20,9 @@ fi
 sudo ceph osd crush rm osd.0 || true
 sudo ceph osd crush rm osd.1 || true
 
+sudo cp $(dirname $0)/60-ceph-by-partuuid.rules /lib/udev/rules.d
+sudo udevadm control --reload
+
 perl -pi -e 's|pid file.*|pid file = /var/run/ceph/\$cluster-\$name.pid|' /etc/ceph/ceph.conf
 
 PATH=$(dirname $0):$(dirname $0)/..:$PATH
@@ -32,6 +35,7 @@ fi
 sudo env PATH=$(dirname $0):$(dirname $0)/..:$PATH py.test -s -v $(dirname $0)/ceph-disk-test.py
 result=$?
 
+sudo rm -f /lib/udev/rules.d/60-ceph-by-partuuid.rules
 # own whatever was created as a side effect of the py.test run
 # so that it can successfully be removed later on by a non privileged 
 # process