summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-05-29 15:47:38 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-05-29 15:47:38 +0200
commit1f6ad356dcc73acf7d5c75a75e5f829809ee96af (patch)
tree5cd82eee3acf8d556339ca3b21dadfc498958bd1 /test
parent9fcbba900c87a41a85281bec3ee1989258f3a3db (diff)
downloadgvfs-1f6ad356dcc73acf7d5c75a75e5f829809ee96af.tar.gz
gvfs-test: Do not assume that /run/udev/rules.d/ exists
Create the directory if necessary. Recent udev versions do not create it automatically any more.
Diffstat (limited to 'test')
-rwxr-xr-xtest/gvfs-test1
-rwxr-xr-xtest/gvfs-testbed3
2 files changed, 3 insertions, 1 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index 6c0fc119..e97c4b8e 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -1168,6 +1168,7 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd
self.addCleanup(cleanup)
rootsh = subprocess.Popen(['./rootsh'], stdin=subprocess.PIPE)
rootsh.communicate(b'''export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+mkdir -p /run/udev/rules.d
echo 'SUBSYSTEM=="block", ATTRS{model}=="scsi_debug*", ENV{ID_MEDIA_PLAYER}="MockTune"' > /run/udev/rules.d/40-scsi_debug-fake-mediaplayer.rules
sync
pkill --signal HUP udevd || pkill --signal HUP systemd-udevd
diff --git a/test/gvfs-testbed b/test/gvfs-testbed
index cd21dc32..b21bf848 100755
--- a/test/gvfs-testbed
+++ b/test/gvfs-testbed
@@ -52,7 +52,8 @@ MNT=`mktemp -d`
# work around scsi_debug not implementing CD-ROM SCSI commands
# see https://launchpad.net/bugs/1043182 for details
-if [ -d /run/udev/rules.d/ -a ! -e /run/udev/rules.d/60-persistent-storage-scsi_debug.rules ]; then
+if [ -d /run/udev/ -a ! -e /run/udev/rules.d/60-persistent-storage-scsi_debug.rules ]; then
+ mkdir -p /run/udev/rules.d
cat <<EOF > /run/udev/rules.d/60-persistent-storage-scsi_debug.rules
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ATTRS{model}=="scsi_debug*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid \$tempnode"
EOF