f01d01
From aa4ce218fe9b4ee3571d872ff1575a499596181c Mon Sep 17 00:00:00 2001
f01d01
From: Vojtech Trefny <vtrefny@redhat.com>
f01d01
Date: Fri, 29 May 2020 12:14:30 +0200
f01d01
Subject: [PATCH 1/2] Do not limit swap to 128 GiB
f01d01
f01d01
The limit was part of change to limit suggested swap size in
f01d01
kickstart which doesn't use the SwapSpace._max_size so there is no
f01d01
reason to limit this for manual installations.
f01d01
16 TiB seems to be max usable swap size based on mkswap code.
f01d01
f01d01
Resolves: rhbz#1656485
f01d01
---
f01d01
 blivet/formats/swap.py | 3 +--
f01d01
 1 file changed, 1 insertion(+), 2 deletions(-)
f01d01
f01d01
diff --git a/blivet/formats/swap.py b/blivet/formats/swap.py
f01d01
index 4b8a7edf..3cc59138 100644
f01d01
--- a/blivet/formats/swap.py
f01d01
+++ b/blivet/formats/swap.py
f01d01
@@ -52,8 +52,7 @@ class SwapSpace(DeviceFormat):
f01d01
     _linux_native = True                # for clearpart
f01d01
     _plugin = availability.BLOCKDEV_SWAP_PLUGIN
f01d01
 
f01d01
-    # see rhbz#744129 for details
f01d01
-    _max_size = Size("128 GiB")
f01d01
+    _max_size = Size("16 TiB")
f01d01
 
f01d01
     config_actions_map = {"label": "write_label"}
f01d01
 
f01d01
-- 
f01d01
2.26.2
f01d01
f01d01
f01d01
From 93aa6ad87116f1c86616d73dbe561251c4a0c286 Mon Sep 17 00:00:00 2001
f01d01
From: Vojtech Trefny <vtrefny@redhat.com>
f01d01
Date: Thu, 11 Jun 2020 14:27:44 +0200
f01d01
Subject: [PATCH 2/2] Add test for SwapSpace max size
f01d01
f01d01
---
f01d01
 tests/formats_test/swap_test.py | 24 ++++++++++++++++++++++++
f01d01
 1 file changed, 24 insertions(+)
f01d01
 create mode 100644 tests/formats_test/swap_test.py
f01d01
f01d01
diff --git a/tests/formats_test/swap_test.py b/tests/formats_test/swap_test.py
f01d01
new file mode 100644
f01d01
index 00000000..56356144
f01d01
--- /dev/null
f01d01
+++ b/tests/formats_test/swap_test.py
f01d01
@@ -0,0 +1,24 @@
f01d01
+import test_compat  # pylint: disable=unused-import
f01d01
+
f01d01
+import six
f01d01
+import unittest
f01d01
+
f01d01
+from blivet.devices.storage import StorageDevice
f01d01
+from blivet.errors import DeviceError
f01d01
+from blivet.formats import get_format
f01d01
+
f01d01
+from blivet.size import Size
f01d01
+
f01d01
+
f01d01
+class SwapNodevTestCase(unittest.TestCase):
f01d01
+
f01d01
+    def test_swap_max_size(self):
f01d01
+        StorageDevice("dev", size=Size("129 GiB"),
f01d01
+                      fmt=get_format("swap"))
f01d01
+
f01d01
+        StorageDevice("dev", size=Size("15 TiB"),
f01d01
+                      fmt=get_format("swap"))
f01d01
+
f01d01
+        with six.assertRaisesRegex(self, DeviceError, "device is too large for new format"):
f01d01
+            StorageDevice("dev", size=Size("17 TiB"),
f01d01
+                          fmt=get_format("swap"))
f01d01
-- 
f01d01
2.26.2
f01d01