Merge pull request #1983 from dbungert/lp-2063252-cryptsetup-warns
filesystem: swap options
This commit is contained in:
commit
a73d997b5d
|
@ -180,11 +180,19 @@ class FilesystemManipulator:
|
|||
|
||||
delete_lvm_partition = delete_logical_volume
|
||||
|
||||
cryptoswap_options = [
|
||||
"cipher=aes-cbc-essiv:sha256",
|
||||
"initramfs",
|
||||
"plain",
|
||||
"size=256",
|
||||
"swap",
|
||||
]
|
||||
|
||||
def create_cryptoswap(self, device):
|
||||
dmc = self.model.add_dm_crypt(
|
||||
device,
|
||||
keyfile="/dev/urandom",
|
||||
options=["swap", "initramfs"],
|
||||
options=self.cryptoswap_options,
|
||||
)
|
||||
self.create_filesystem(dmc, dict(fstype="swap"))
|
||||
return dmc
|
||||
|
|
|
@ -466,6 +466,7 @@ class TestGuided(IsolatedAsyncioTestCase):
|
|||
self.controller = FilesystemController(self.app)
|
||||
self.controller.supports_resilient_boot = True
|
||||
self.controller._examine_systems_task.start_sync()
|
||||
self.controller.cryptoswap_options = ["a", "b"]
|
||||
self.app.dr_cfg = DRConfig()
|
||||
self.app.base_model.source.current.type = "fsimage"
|
||||
self.app.base_model.source.current.variations = {
|
||||
|
@ -657,7 +658,7 @@ class TestGuided(IsolatedAsyncioTestCase):
|
|||
self.assertIsNone(swap.fs())
|
||||
[dmc] = self.model.all_dm_crypts()
|
||||
self.assertEqual("/dev/urandom", dmc.keyfile)
|
||||
self.assertEqual(["swap", "initramfs"], dmc.options)
|
||||
self.assertEqual(["a", "b"], dmc.options)
|
||||
self.assertEqual("swap", dmc.fs().fstype)
|
||||
[rpool] = self.model._all(type="zpool", pool="rpool")
|
||||
self.assertIsNone(rpool.path)
|
||||
|
|
Loading…
Reference in New Issue