Everything is the same except "If btrfs creation fails..."
I can only come up with three reasonable strategies for dealing with the
possibility that the specified options are causing the failure of volume
creation. These strategies are all based on the belief that the only way
of finding out what btrfs considers wrong with the options is to parse the
error output, something that really ought not to be attempted.
The first is just give up immediately, which is a good, simple strategy.
I'm happy to go with that. I thought it might be better to be more forgiving,
hence...
The second strategy is to try just once more, accepting the defaults,
which is what the first patch did. There were some objections to that patch,
hence...
The third strategy is to try out combinations of the specified options,
giving up after all have failed. That's the second and current revised patches.
This strategy could be time-consuming, but I'm betting that if mkfs.btrfs
has a problem with the specified options it will terminate quickly.
I can't think of any other strategies which don't require making dubious
and uncheckable predictions about btrfs's behavior.
mulhern (11):
Remove some extra imports.
Update BTRFS initializer comments for level type.
Explicitly accept a string as well as a RAIDLevel object.
Move skipUnless decorator to the top level class of skipped classes.
Add num_blocks parameter to makeLoopDev().
Use correct parameters in __init__() in subclasses of
unittest.TestCase.
Make DevicelibsTestCase devices configurable.
Add a test for a btrfs error associated with small devices (#1109195)
Accept None for btrfs raid levels (#1109195)
If btrfs creation fails, try with fewer specified options (#1109195)
Move DevicelibsTestCase up to the top level of the testing directory.
blivet/devicelibs/btrfs.py | 12 +++--
blivet/devices.py | 73 ++++++++++++++++---------
tests/devicelibs_test/baseclass.py | 77 --------------------------
tests/devicelibs_test/btrfs_test.py | 53 +++++++++++-------
tests/devicelibs_test/crypto_test.py | 29 +++++-----
tests/devicelibs_test/lvm_test.py | 24 ++++-----
tests/devicelibs_test/mdraid_test.py | 21 +++-----
tests/devicelibs_test/swap_test.py | 10 ++--
tests/devices_test.py | 4 --
tests/devicetree_test.py | 2 -
tests/formats_test/fslabeling.py | 46 +++++-----------
tests/formats_test/labeling_test.py | 18 ++-----
tests/formats_test/selinux_test.py | 17 +++---
tests/imagebackedtestcase.py | 1 +
tests/loopbackedtestcase.py | 102 +++++++++++++++++++++++++++++++++++
tests/partitioning_test.py | 2 -
16 files changed, 254 insertions(+), 237 deletions(-)
delete mode 100644 tests/devicelibs_test/baseclass.py
create mode 100644 tests/loopbackedtestcase.py
--
1.9.3