Merge ~freddierice/curtin:mdadm-metadata into curtin:master

Proposed by Freddie Rice
Status: Needs review
Proposed branch: ~freddierice/curtin:mdadm-metadata
Merge into: curtin:master
Diff against target: 27 lines (+3/-2)
2 files modified
curtin/commands/block_meta.py (+2/-1)
tests/unittests/test_commands_block_meta.py (+1/-1)
Reviewer Review Type Date Requested Status
curtin developers Pending
Review via email: mp+391296@code.launchpad.net

Commit message

block_meta: pass the metadata parameter into the mdadm_create function

Description of the change

Changing 'metadata' in raid right now is a nop because it is never passed into the mdadm_create function. This change aims to allow the metadata parameter to be passed into the mdadm call.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

which metadata formats, apart from default, do you intend to use here? Do we need more tests for extra metadata formats?

Revision history for this message
Ryan Harper (raharper) wrote :

This looks fine to me. I think we have sufficient testing around raid; AFAIK, we don't do anything that requires 1.2. I don't think we need to add any additional testing unless we know of a scenario where a specific metadata level is known to not work.

We don't have any tests on DDF or imsm (though this requires specific hardware that's not virtualizable IIUC). If this exposes a bug for a specific format; that would be good to know and we can fix/add testing then.

Unmerged commits

c08d2b7... by Freddie Rice

block_meta: add metadata parameter to ci tests

3ca8137... by Freddie Rice <email address hidden>

block_meta: add metadata to raid

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
index dee73b1..424f3d3 100644
--- a/curtin/commands/block_meta.py
+++ b/curtin/commands/block_meta.py
@@ -1518,7 +1518,8 @@ def raid_handler(info, storage_config):
1518 if create_raid:1518 if create_raid:
1519 mdadm.mdadm_create(md_devname, raidlevel,1519 mdadm.mdadm_create(md_devname, raidlevel,
1520 device_paths, spare_device_paths,1520 device_paths, spare_device_paths,
1521 info.get('mdname', ''))1521 info.get('mdname', ''),
1522 metadata=info.get('metadata'))
15221523
1523 wipe_mode = info.get('wipe')1524 wipe_mode = info.get('wipe')
1524 if wipe_mode:1525 if wipe_mode:
diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
index d954296..c9a340b 100644
--- a/tests/unittests/test_commands_block_meta.py
+++ b/tests/unittests/test_commands_block_meta.py
@@ -1892,7 +1892,7 @@ class TestRaidHandler(CiTestCase):
1892 self.m_getpath.side_effect = iter(devices)1892 self.m_getpath.side_effect = iter(devices)
1893 block_meta.raid_handler(self.storage_config['mddevice'],1893 block_meta.raid_handler(self.storage_config['mddevice'],
1894 self.storage_config)1894 self.storage_config)
1895 self.assertEqual([call(md_devname, 5, devices, [], '')],1895 self.assertEqual([call(md_devname, 5, devices, [], '', metadata=None)],
1896 self.m_mdadm.mdadm_create.call_args_list)1896 self.m_mdadm.mdadm_create.call_args_list)
18971897
1898 @patch('curtin.commands.block_meta.raid_verify')1898 @patch('curtin.commands.block_meta.raid_verify')

Subscribers

People subscribed via source and target branches