[blivet:master 08/11] Add a test for a btrfs error associated with small devices (#1109195)
mulhern
amulhern at redhat.com
Tue Jun 17 15:07:59 UTC 2014
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")
+ self.assertEqual(btrfs.create_volume(self.loopDevices), 0)
+
if __name__ == "__main__":
unittest.main()
--
1.9.3
More information about the anaconda-patches
mailing list