[blivet:master 08/11] Add a test for a btrfs error associated with small devices (#1109195)

Brian C. Lane bcl at redhat.com
Wed Jun 18 00:40:20 UTC 2014


On Tue, Jun 17, 2014 at 11:07:59AM -0400, mulhern wrote:
> Related: fed#1109195
> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  tests/devicelibs_test/btrfs_test.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/tests/devicelibs_test/btrfs_test.py b/tests/devicelibs_test/btrfs_test.py
> index 740bb1c..40a26de 100755
> --- a/tests/devicelibs_test/btrfs_test.py
> +++ b/tests/devicelibs_test/btrfs_test.py
> @@ -177,5 +177,20 @@ class BTRFSAsRootTestCase2(BTRFSMountDevice):
>          subvolumes = btrfs.list_subvolumes(self.mountpoint)
>          self.assertEqual(len([v for v in subvolumes if v['path'].find("SV1.1") != -1]), 1)
>  
> +class BTRFSAsRootTestCase3(baseclass.DevicelibsTestCase):
> +
> +    def __init__(self, methodName='runTest'):
> +        super(BTRFSAsRootTestCase3, self).__init__(methodName=methodName, deviceSpec=[8192])
> +
> +    def testSmallDevice(self):
> +        """ Creation of a smallish device will result in an error if the
> +            data and metadata levels are specified differently, but not if
> +            they are unspecified.
> +        """
> +        self.assertRaises(BTRFSError,
> +           btrfs.create_volume,
> +           self.loopDevices, data="single", metadata="dup")

Please align multiline arguments with the start of the first argument.


> +        self.assertEqual(btrfs.create_volume(self.loopDevices), 0)
> +
>  if __name__ == "__main__":
>      unittest.main()
> -- 
> 1.9.3
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list