[blivet] groundwork for better blivet unit test coverage

David Lehman dlehman at redhat.com
Wed Jul 23 21:04:24 UTC 2014


The first two patches establish a framework for using regular files as fake
disks so that things that depend on parted objects (most of blivet) can
function without root access. While the primary motivation was testing
partition allocation in a non-destructive way as a non-root user, this also
enables unit testing of several areas of the devicetree, action registration,
sorting and pruning, the device factories, and determining resize constraints
for existing filesystems.

The other two are the first tests to use the framework.

David Lehman (4):
  Add a contextmanager to create and remove sparse tempfiles.
  Add a DiskFile class for testing partitioning code as a non-root user.
  Add a couple of tests for blivet.partitioning.DiskChunk.
  Add some tests for blivet.partitioning.addPartition.

 blivet/devices.py          |  29 ++++++
 blivet/util.py             |  16 +++
 tests/partitioning_test.py | 243 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 288 insertions(+)

-- 
1.9.3



More information about the anaconda-patches mailing list