CA-142595: Fix, unit tests and refactoring

This pull request includes:
-The fix from @wangyanbn (https://github.com/xapi-project/sm/pull/203)
-The testing framework from @matelakat (https://github.com/xapi-project/sm/pull/208)
-The unit tests for the fix, which are built on top of the testing framework
-Some additional refactoring, to prevent side effects when applying the fix

Thanks,
Flavien
Could we rename `_get_block_device_name` to something like `_get_block_device_name_kernel_3x` to communicate that it's the kernel 3.x specific way?