Add a docstring to mdraid.mdexamine (#1153096)

Related: rhbz#1153096

Signed-off-by: mulhern <amulhern@redhat.com>
Factor canonicalize_UUID() into separate method (#1153096)

Related: rhbz#1153096

Signed-off-by: mulhern <amulhern@redhat.com>
Be more robust in the face of possible changes to mdadm's UUIDs (#1153096)

Related: rhbz#1153096

Signed-off-by: mulhern <amulhern@redhat.com>
Extend mdadm() to capture output (#1153096)

Related: rhbz#1153096

Use it in mdexamine()

Signed-off-by: mulhern <amulhern@redhat.com>
Add a method to extract information about an mdraid array (#1153096)

Related: rhbz#1153096

mdadm --detail can give useful information about the number of spare devices
and other things that mdadm --examine can not. According to the man page
--examine applies to devices which are components of an array, while --detail
applies to a whole array which is currently active.

Signed-off-by: mulhern <amulhern@redhat.com>
Refactor mdraid tests (#1153096)

Related: rhbz#1153096

Also, add some mddetail test cases and extend tests for mdremove and mdadd.

Signed-off-by: mulhern <amulhern@redhat.com>
Split mdadd into separate functions (#1153096)

Related: rhbz#1153096

Incremental mode is really considerably different from add mode.

For one thing, it may cause the array to be started if it was not already,
based on the number of devices in the array and the number that ought
to be in the array.

Signed-off-by: mulhern <amulhern@redhat.com>
Break once metadata value is found (#1153096)

Related: rhbz#1153096

Signed-off-by: mulhern <amulhern@redhat.com>
Fix mdnominate error message (#1153096)

Related: rhbz#1153096

Signed-off-by: mulhern <amulhern@redhat.com>
Use long messages for unittest errors (#1153096)

Related: rhbz#1153096
Still attempt to destroy even if remove failed (#1153096)

Related: rhbz#1153096
Add a test for mddetail on containers (#1153096)

Related: rhbz#1153096

Signed-off-by: mulhern <amulhern@redhat.com>
Add a test for activation (#1153096)

Related: rhbz#1153096
Canonicalize MD_UUID* values in udev.py (#1153096)

Resolves: rhbz#1153096

Sometimes, MD_UUID* are obtained, not from mdraid methods, but
from udev methods. Since these did not pass through the mdraid methods,
they are not canonicalized, leading to uncanonicalized forms being used for
lookup. Now, they are canonicalized on lookup in blivet.util.py. Since
the canonicalize_UUID method is shared, it is moved up into blivet.utils.py.

Signed-off-by: mulhern <amulhern@redhat.com>