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

mulhern amulhern at redhat.com
Fri Dec 6 16:50:10 UTC 2013


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.

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
-- 
1.8.3.1



More information about the anaconda-patches mailing list