"The test needs to verify that the drive is writable, so if I can't write to it, it should still fail, but do so in a graceful manner."
Are you sure ? What is this test supposed to do ? I thought it was just to check if Ubuntu can mount a partition from a USB stick/harddrive. Why should it necessarily be writable ? I know that most partitions should and will be. But let's say you are doing in the test with an external harddrive used on a Mac ? Or maybe an NTFS partition not closed properly. Does it mean that this test is failing ? I don't think so.
But then it's a bit complicated to perform this test. It should react accordingly to the partition format. And maybe just do a read test on partitions Ubuntu can't write on.
"The test needs to verify that the drive is writable, so if I can't write to it, it should still fail, but do so in a graceful manner."
Are you sure ? What is this test supposed to do ? I thought it was just to check if Ubuntu can mount a partition from a USB stick/harddrive. Why should it necessarily be writable ? I know that most partitions should and will be. But let's say you are doing in the test with an external harddrive used on a Mac ? Or maybe an NTFS partition not closed properly. Does it mean that this test is failing ? I don't think so.
But then it's a bit complicated to perform this test. It should react accordingly to the partition format. And maybe just do a read test on partitions Ubuntu can't write on.