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 on 2020-09-24

block_meta: add metadata parameter to ci tests

3ca8137... by Freddie Rice <email address hidden> on 2020-09-24

block_meta: add metadata to raid

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
2index dee73b1..424f3d3 100644
3--- a/curtin/commands/block_meta.py
4+++ b/curtin/commands/block_meta.py
5@@ -1518,7 +1518,8 @@ def raid_handler(info, storage_config):
6 if create_raid:
7 mdadm.mdadm_create(md_devname, raidlevel,
8 device_paths, spare_device_paths,
9- info.get('mdname', ''))
10+ info.get('mdname', ''),
11+ metadata=info.get('metadata'))
12
13 wipe_mode = info.get('wipe')
14 if wipe_mode:
15diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
16index d954296..c9a340b 100644
17--- a/tests/unittests/test_commands_block_meta.py
18+++ b/tests/unittests/test_commands_block_meta.py
19@@ -1892,7 +1892,7 @@ class TestRaidHandler(CiTestCase):
20 self.m_getpath.side_effect = iter(devices)
21 block_meta.raid_handler(self.storage_config['mddevice'],
22 self.storage_config)
23- self.assertEqual([call(md_devname, 5, devices, [], '')],
24+ self.assertEqual([call(md_devname, 5, devices, [], '', metadata=None)],
25 self.m_mdadm.mdadm_create.call_args_list)
26
27 @patch('curtin.commands.block_meta.raid_verify')

Subscribers

People subscribed via source and target branches