[blivet 10/13] Add a test that probably should fail.

David Lehman dlehman at redhat.com
Fri Dec 6 17:11:35 UTC 2013


On Fri, 2013-12-06 at 11:50 -0500, mulhern wrote:
> This test succeeds because a BTRFSSubVolume does not inherit its format
> from its parent. This is probably incorrect; a BTRFSVolume, if it finds
> itself at the end of the constructor with  a DefaultFormat, constructs
> a BTRFSFormat format instead. Probably a subvolume should do the same.
> Currently, if the format is not passed in the constructor, the subvolume
> just accepts the DefaultFormat object, which can lead to AttributeErrors.

The test should fail as you suggest. BTRFSSubVolumeDevice must always
have a BTRFS instance as its format.

David

> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  tests/devices_test.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/devices_test.py b/tests/devices_test.py
> index 12bd9fc..bbbc6dd 100644
> --- a/tests/devices_test.py
> +++ b/tests/devices_test.py
> @@ -487,6 +487,10 @@ class BTRFSDeviceTestCase(DeviceStateTestCase):
>          with self.assertRaises(AttributeError):
>              self.dev2.defaultSubVolume
>  
> +        # subvolumes do not inherit a format from their parents
> +        with self.assertRaisesRegexp(AttributeError, "volUUID"):
> +            self.dev2.fstabSpec
> +
>          self.assertIsNotNone(self.dev2.volume)
>  
>          # size




More information about the anaconda-patches mailing list