[master 9/19] Make LUKS format resizable.

mulkieran installerbot-noreply at redhat.com
Thu Jun 18 21:04:10 UTC 2015


From: mulhern <amulhern at redhat.com>

Related: #56

* Set _resizable True.
* Set up resize class.
* Fix up size tests that break when LUKS format becomes resizable.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/formats/luks.py          | 2 ++
 tests/formats_test/luks_test.py | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/blivet/formats/luks.py b/blivet/formats/luks.py
index df24ee1..dc17f02 100644
--- a/blivet/formats/luks.py
+++ b/blivet/formats/luks.py
@@ -48,6 +48,8 @@ class LUKS(DeviceFormat):
     _minSize = crypto.LUKS_METADATA_SIZE
     _plugin = availability.BLOCKDEV_CRYPTO_PLUGIN
     _sizeinfoClass = lukstasks.LUKSSize
+    _resizeClass = lukstasks.LUKSResize
+    _resizable = True
 
     def __init__(self, **kwargs):
         """
diff --git a/tests/formats_test/luks_test.py b/tests/formats_test/luks_test.py
index 76bb862..d6127f1 100755
--- a/tests/formats_test/luks_test.py
+++ b/tests/formats_test/luks_test.py
@@ -53,11 +53,14 @@ def testSize(self):
         # update the size info
         self.fmt.updateSizeInfo()
 
+        # set target size to imitate FS constructor
+        self.fmt.targetSize = self.fmt._size
+
         # the size is greater than zero and less than the size of the device
         self.assertLess(self.fmt.size, self.DEFAULT_STORE_SIZE)
         self.assertGreater(self.fmt.size, Size(0))
 
         self.assertEqual(self.fmt.currentSize, self.fmt.size)
-        self.assertEqual(self.fmt.targetSize, Size(0))
+        self.assertEqual(self.fmt.targetSize, self.fmt.size)
 
         self.fmt.teardown()


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/97a6af4eb407702885fee30b94c96e5900bb0f8f


More information about the anaconda-patches mailing list