device-mapper-test-suite icon indicating copy to clipboard operation
device-mapper-test-suite copied to clipboard

make a flakey device

Open akiradeveloper opened this issue 12 years ago • 2 comments

Hi Joe,

I tried to add new test having following scenario:

  1. create a wb device with devices carved out from tvm
  2. grab ruby, extract and configure it on it.
  3. remove the device
  4. recreate the wb device
  5. wrap one of the underlying devices by flakey with random (up, down)
  6. compile ruby
  7. fails at some moment
  8. remove the device
  9. repeat from 4

this test is to see wb device can terminate itself after IO error without failure no matter where the IO error occured.

However, I couldn't make at the step 5. The problem is that the device to wrap is carved out from tvm and thus hides its implementation except its a linear device. All we need to know to make a wrapped device in step 5 is that the offset and the name of underlying device of the device.

For example, in thin-provisioning/pool_resize_tests.rb you makes a flakey device but you are using @metadata_dev not the metadata variable knowing that the metadata is starting from LBA 0 of the @metadata_dev.

This is not a good code because it depends on the implicit information. Actually, it should be able to write this code like this

table = Table.new(FlakeyTarget.new(dev_size(metadata.dev), metadata.dev, metadata.start, up_interval, 60))

where metadata.dev is the device under metadata.

There seems a workaround by parsing the table of the linear device to get the (dev, sector). Should I work this way?

akiradeveloper avatar Apr 20 '14 23:04 akiradeveloper

Please advice me if you have time. I have four consecutive holidays and thus can do some works. I will try to write two tests (this is the one and the other is to test a unlikely cache-hit path).

akiradeveloper avatar May 02 '14 22:05 akiradeveloper

On 21 April 2014 00:14, Akira Hayakawa [email protected] wrote:

For example, in thin-provisioning/pool_resize_tests.rb you makes a flakey device but you are using @metadata_dev not the metadata variable knowing that the metadata is starting from LBA 0 of the @metadata_dev.

I'm not really sure what the problem is here. You can wrap one of the linear devices with a flakey device in exactly the same way as I did with the @metadata_dev. There's no need for an offset unless you want to make a specific sub region of the linear device flakey; in which case use another tvm to carve up the linear.

  • Joe

jthornber avatar May 03 '14 08:05 jthornber