USB HDD verification seems to be working, yet it's marked as "No"

Bug #887049 reported by François Tissandier
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Medium
Brendan Donegan
0.12
Invalid
Undecided
Unassigned
Oneiric
Invalid
Undecided
Unassigned
checkbox (Ubuntu)
Fix Released
Undecided
Unassigned
Oneiric
Won't Fix
Undecided
Unassigned

Bug Description

I plugged an USB hard drive. All four partitions on it were mounted without problem. Yet, the test was marked as "No". I think everything is working fine, so I manually changed it to "Yes". But it's a bit unclear what is tested. Some people may keep the "No" answer, even if the partitions are mounted without any problem.

[Impact]
USB storage devices with multiple partitions confuse checkbox's usb_test script, which will falsely report the device is not working, thus hurting the system's Ubuntu Friendly score unfairly.

[Development fix]
The usb_test script is updated in revision 1119 to account for USB devices with logical partitions.

[Stable fix]
This is fixed in http://bazaar.launchpad.net/~checkbox-dev/checkbox/trunk/revision/1119. Also, the linked branch (https://code.launchpad.net/~roadmr/ubuntu/oneiric/checkbox/0.12.8.1) contains this and other fixes and merges cleanly against Ubuntu checkbox 0.12.8.

[Test case]
- Prepare a USB stick with at least one logical partition (to really exercise the script, create at least one primary and one extended partition, with the latter containing at least two logical partitions). Format all the partitions and make sure they're all writable by the current user.
- Run /usr/share/checkbox/scripts/usb_test -t

Expected result:
A test report that ends with "Successfully completed 1 USB file transfer test iterations".

Actual result:
Trace as reported in comment #5, ending in "IndexError: list index out of range".

[Regression potential]
This is just adding a safety check for a possible empty array, I don't think this could fail in any situation where it previously worked fine.

Related branches

affects: ubuntu-friendly → checkbox
Revision history for this message
Bob Bolin (bolinr) wrote : Re: [Bug 887049] Re: USB HDD verification seems to be working, yet it's marked as "No"

I had the same experience on this test section, I think it has to do with
mounted drives no longer showing on the desktop and just needs to be
updated to reflect this. But it is very unclear and at quick glance I
suspect most testers would let it stay marked as a Fail.

2011/11/7 Mike Heald <email address hidden>

> ** Project changed: ubuntu-friendly => checkbox
>
> --
> You received this bug notification because you are a member of Ubuntu
> Friendly Squad, which is subscribed to Ubuntu Friendly.
> https://bugs.launchpad.net/bugs/887049
>
> Title:
> USB HDD verification seems to be working, yet it's marked as "No"
>
> Status in Checkbox System Testing:
> New
>
> Bug description:
> I plugged an USB hard drive. All four partitions on it were mounted
> without problem. Yet, the test was marked as "No". I think everything
> is working fine, so I manually changed it to "Yes". But it's a bit
> unclear what is tested. Some people may keep the "No" answer, even if
> the partitions are mounted without any problem.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/checkbox/+bug/887049/+subscriptions
>

--
Cheers,

Bob Bolin

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This test could do with being more robust. It seems to rely on a nicely formatted stick and doesn't handle e.g. multiple partitions well. I'd need to check again but I don't think that, e.g. a Live USB stick works.

Changed in checkbox:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Francois,

It would be helpful if you posted details of how your USB stick was formatted so we can see if the problem is totally reproducible.

Thanks,

Changed in checkbox:
status: Confirmed → Incomplete
Revision history for this message
François Tissandier (baloo) wrote :

1 fat
2 ntfs
1 ext3
1 swap

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

It seems the DBus API used by the usb_test script is made unhappy by multiple partitions and ends up with an exception like this:

dbus.Array([dbus.String(u'/media/B3CC-9BC7')], signature=dbus.Signature('s'), variant_level=1)
dbus.Array([], signature=dbus.Signature('s'), variant_level=1)
Traceback (most recent call last):
  File "./usb_test", line 142, in <module>
    sys.exit(main())
  File "./usb_test", line 104, in main
    usb_disks = GetDiskInfo()
  File "./usb_test", line 62, in GetDiskInfo
    bus = dbus.SystemBus()
IndexError: list index out of range

Actually, just looking at this traceback - Francois, do you have an Logical partitions on your USB stick? You must have to have so many partitions.

Revision history for this message
François Tissandier (baloo) wrote :

Yes of course I have one, with 5 partitions, no choice anyway ;) Sorry if I didnt mention it.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

So, the logical partition gets detected by the DBus API and since it has no path in the file system there is an exception 'out of range'. Checking that there is a path available to read before reading it will solve this. Patch coming soon.

However, there remains an issue that since NTFS is read-only the test will fail if exercised against any NTFS partitions. Still thinking about how to solve this.

Changed in checkbox:
assignee: nobody → Brendan Donegan (brendan-donegan)
status: Incomplete → In Progress
milestone: none → 0.12.9
Revision history for this message
Daniel Manrique (roadmr) wrote :

See bug 877581, it's not about the same problem at all, but just to keep track of reliability improvements needed in usb_test.

tags: added: checkbox-testsuite
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Potentially it is the same problem, or at least part of it, as that's the error you get if you have an NTFS partition (since the directory and file aren't created due to the NTFS partition being read only)

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

A small test disproves my assumption about NTFS (I thought it was read-only at one point, but perhaps it isn't now). Well, let me submit the fix for the problem at hand (logical partitions causing the test to fail) and we'll worry about the other one later.

Daniel Manrique (roadmr)
Changed in checkbox:
status: In Progress → Fix Committed
Daniel Manrique (roadmr)
Changed in checkbox:
status: Fix Committed → Fix Released
Daniel Manrique (roadmr)
description: updated
Daniel Manrique (roadmr)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

Is this also fixed in precise's 0.13? If no, please fix it there first, otherwise please close the task. Thanks!

Revision history for this message
Daniel Manrique (roadmr) wrote :

Hi Martin,

Yes, the change is in 0.13 in Precise. I'll mark the task Fix Released. Sorry for the mixup.

Changed in checkbox (Ubuntu Oneiric):
status: New → Fix Released
Revision history for this message
Daniel Manrique (roadmr) wrote :

Argh, no, it's not "Fix released" in Oneiric until the SRU is available. I'll move back to New. Still, it *is* fixed in Precise's 0.13. Apologies for messing things up. I'll keep an eye on this bug to see how it should be done.

Changed in checkbox (Ubuntu Oneiric):
status: Fix Released → New
Revision history for this message
Chris Halse Rogers (raof) wrote :

Marking al fix-released for the development task; this is fixed in Precise.

Changed in checkbox (Ubuntu):
status: New → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello François, or anyone else affected,

Accepted checkbox into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in checkbox (Ubuntu Oneiric):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
François Tissandier (baloo) wrote :

With this new version, I still have the "no" answer ticked after the test.

here is the partition table :

1 primary, NTFS
1 primary, NTFS,
1 extended containing :
1 logical, NTFS
1 logical, ext3
1 logical, swap

I can write on all NTFS partitions when mounted, but NOT on the ext3 partition though. That could be the reason why it's failing ?

Dmesg part about this partition:

[ 9409.823150] EXT3-fs: barriers not enabled
[ 9410.289178] kjournald starting. Commit interval 5 seconds
[ 9410.296012] EXT3-fs (sdg6): using internal journal
[ 9410.296015] EXT3-fs (sdg6): recovery complete
[ 9410.298755] EXT3-fs (sdg6): mounted filesystem with ordered data mode

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Francois,

It would help if you ran the same test case as described in the bug:

[Test case]
- Prepare a USB stick with at least one logical partition (to really exercise the script, create at least one primary and one extended partition, with the latter containing at least two logical partitions). Format all the partitions and make sure they're *all writable by the current user.*
- Run /usr/share/checkbox/scripts/usb_test -t

Expected result:
A test report that ends with "Successfully completed 1 USB file transfer test iterations".

Revision history for this message
François Tissandier (baloo) wrote :

Hi Brendan

i'm ok to do this test, but it's not a "real word" case, right ? My problem will still be valid.

I will do the test as soon as I can find a spare USB stick I can reformat like that.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Francois, your problem is still of course valid but this SRU does not fix that particular issue of read-only partitions causing the script to fail, just the problem of logical partitions. In fact the comments explicitly state that read-only partitions were still a problem.

https://bugs.launchpad.net/checkbox/+bug/887049/comments/9
https://bugs.launchpad.net/checkbox/+bug/887049/comments/10

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

You might want to raise a seperate bug about the specific problem with read only partitions, something like:

'usb_test fails if a read-only partition exists on the target device'

and please attach the output of the script including any python traces.

Revision history for this message
François Tissandier (baloo) wrote :

Oups sorry, I didn't read all the comments. I will do the test when I have a spare drive.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Yes, when I wrote the test case I was aware that non-writable partitions were still an issue, but I chose to focus on the multiple partition problem, and thus the test case is very specific in that all partitions in the USB device must be writable.

The writable-ness problem still needs to be fixed but as Brendan mentioned, this will be easier to track in a different bug.

François, Thanks for testing!

Revision history for this message
Daniel Manrique (roadmr) wrote :

This is the only Checkbox SRU bug awaiting verification, so I'm wondering if anyone was able to test with a USB stick with all writable partitions, as described in the test case.

Thanks!

Revision history for this message
Daniel Manrique (roadmr) wrote :

I prepared a USB stick with these partitions:

Disk /dev/sdb: 2021 MB, 2021654528 bytes
63 heads, 62 sectors/track, 1010 cylinders, total 3948544 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000cc465

   Device Boot Start End Blocks Id System
/dev/sdb1 2048 206847 102400 83 Linux
/dev/sdb2 206848 3948543 1870848 5 Extended
/dev/sdb5 208896 413695 102400 83 Linux
/dev/sdb6 415744 620543 102400 83 Linux

All partitions were formatted as vfat using mkfs.vfat.

On plugging in the USB stick, I get three Nautilus windows and they're all mounted:

/dev/sdb1 on /media/3132-6747 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
/dev/sdb5 on /media/3157-6374 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
/dev/sdb6 on /media/3169-67D7 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)

I verified that all three partitions are writable.

Using usb_test from checkbox-0.12.8 I get a failure:

/usr/share/checkbox/scripts/usb_test -t
dbus.Array([], signature=dbus.Signature('s'), variant_level=1)
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/usb_test", line 141, in <module>
    sys.exit(main())
  File "/usr/share/checkbox/scripts/usb_test", line 103, in main
    usb_disks = GetDiskInfo()
  File "/usr/share/checkbox/scripts/usb_test", line 72, in GetDiskInfo
    devPath = str(device_props.Get('org.freedesktop.UDisks.Device',"DeviceMountPaths")[0])
IndexError: list index out of range

After updating to checkbox-0.12.9 I get:

dbus.Array([dbus.String(u'/media/3132-6747')], signature=dbus.Signature('s'), variant_level=1)
dbus.Array([dbus.String(u'/media/3157-6374')], signature=dbus.Signature('s'), variant_level=1)
dbus.Array([dbus.String(u'/media/3169-67D7')], signature=dbus.Signature('s'), variant_level=1)
Running USB file transfer test for 1 iterations
Creating Temp Data file
File name is :/tmp/tmpYU7MRQ
File size is 1048576 bytes
Parent hash is: 03d96e906a30941088cad224bcc5e6f7
Copying /tmp/tmpYU7MRQ to /media/3157-6374
Hashing copy on /media/3157-6374
Hash of /media/3157-6374/tmpYU7MRQ on /media/3157-6374 is 03d96e906a30941088cad224bcc5e6f7
Copying /tmp/tmpYU7MRQ to /media/3169-67D7
Hashing copy on /media/3169-67D7
Hash of /media/3169-67D7/tmpYU7MRQ on /media/3169-67D7 is 03d96e906a30941088cad224bcc5e6f7
Copying /tmp/tmpYU7MRQ to /media/3132-6747
Hashing copy on /media/3132-6747
Hash of /media/3132-6747/tmpYU7MRQ on /media/3132-6747 is 03d96e906a30941088cad224bcc5e6f7
Successfully completed 1 USB file transfer test iterations

Global exit code is 0 (for success).

I'll mark this verification-done.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Note that the problem with *unwritable* partitions on USB sticks was filed separately as bug 912522.

tags: added: verification-done
removed: verification-needed
Changed in checkbox (Ubuntu Oneiric):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.