[blivet] groundwork for better blivet unit test coverage

Vratislav Podzimek vpodzime at redhat.com
Thu Jul 24 06:27:06 UTC 2014


On Wed, 2014-07-23 at 16:04 -0500, David Lehman wrote:
> 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(+)
Wow, this does not at all look that bad I thought it would! These all
look good to me.

-- 
Vratislav Podzimek

Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic




More information about the anaconda-patches mailing list