Merge lp:~brendan-donegan/checkbox/bug887049_usb_test into lp:checkbox

Proposed by Brendan Donegan
Status: Merged
Merged at revision: 1119
Proposed branch: lp:~brendan-donegan/checkbox/bug887049_usb_test
Merge into: lp:checkbox
Diff against target: 30 lines (+7/-3)
2 files modified
debian/changelog (+2/-0)
scripts/usb_test (+5/-3)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/bug887049_usb_test
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+81855@code.launchpad.net

Description of the change

Previously the usb_test script wasn't checking that the device in question actually had a path in the filesystem. This was causing an exception when the script was trying to read the non-existent path. This merge adds a guard around the statements which depend on the path existing.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

I tested on a USB drive containing multiple partitions (3 primary and one extended containing 2 logical partitions) and it handles them correctly. A problem remains when there are no write permissions but that's outside the scope of the linked bug, so I'm merging this as it works as intended. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-11-10 09:21:34 +0000
+++ debian/changelog 2011-11-10 14:02:06 +0000
@@ -35,6 +35,8 @@
35 * Have the bluetooth/detect tests require a device with the category35 * Have the bluetooth/detect tests require a device with the category
36 BLUETOOTH to run, thus preventing the test from failing on systems with36 BLUETOOTH to run, thus preventing the test from failing on systems with
37 no Bluetooth device (LP: #862322)37 no Bluetooth device (LP: #862322)
38 * Guard against trying to write files to logical partitions on USB sticks
39 (which will obviously fail) in usb_test (LP: #887049)
3840
39 [ Javier Collado ]41 [ Javier Collado ]
40 * Broken job dependencies fixed (LP: #888447)42 * Broken job dependencies fixed (LP: #888447)
4143
=== modified file 'scripts/usb_test'
--- scripts/usb_test 2011-09-20 10:43:56 +0000
+++ scripts/usb_test 2011-11-10 14:02:06 +0000
@@ -68,9 +68,11 @@
68 if not device_props.Get('org.freedesktop.UDisks.Device',"DeviceIsDrive"):68 if not device_props.Get('org.freedesktop.UDisks.Device',"DeviceIsDrive"):
69 if device_props.Get('org.freedesktop.UDisks.Device', "DriveConnectionInterface") == 'usb':69 if device_props.Get('org.freedesktop.UDisks.Device', "DriveConnectionInterface") == 'usb':
70 devFile = str(device_props.Get('org.freedesktop.UDisks.Device',"DeviceFile"))70 devFile = str(device_props.Get('org.freedesktop.UDisks.Device',"DeviceFile"))
71 print str(device_props.Get('org.freedesktop.UDisks.Device',"DeviceMountPaths"))71
72 devPath = str(device_props.Get('org.freedesktop.UDisks.Device',"DeviceMountPaths")[0])72 if len(device_props.Get('org.freedesktop.UDisks.Device',"DeviceMountPaths")) > 0:
73 disks[devFile] = devPath73 print str(device_props.Get('org.freedesktop.UDisks.Device',"DeviceMountPaths"))
74 devPath = str(device_props.Get('org.freedesktop.UDisks.Device',"DeviceMountPaths")[0])
75 disks[devFile] = devPath
74 76
75 return disks77 return disks
7678

Subscribers

People subscribed via source and target branches