[gvfs] gvfs-test: Do not assume that /run/udev/rules.d/ exists



commit 1f6ad356dcc73acf7d5c75a75e5f829809ee96af
Author: Martin Pitt <martinpitt gnome org>
Date:   Wed May 29 15:47:38 2013 +0200

    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.

 test/gvfs-test    |    1 +
 test/gvfs-testbed |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index 6c0fc11..e97c4b8 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 cd21dc3..b21bf84 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]