Project

General

Profile

Actions

action #91758

closed

coordination #71242: [epic] Unify validation in the installed system

Validate raid partitioning layout using test data instead of regex

Added by JERiveraMoya over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
SUSE QA (private) - SLE 15 SP3
Start date:
2021-04-26
Due date:
% Done:

0%

Estimated time:

Description

In tests/console/validate_raid.pm we use utilities lsblk and mdadm to validate our raid scenarios via regex.
lblsk has options to export to json which we can parse applying use Mojo::JSON 'decode_json' and compare easily against test data for each scenario.
mdamd can be parsed with some smart regex having pairs of values afir, but requires some investigation, there are some options available:

mdadm --examine -E
mdadm --detail
mdadm --examine --brief

With --export output is easy to extract and looks like:

MD_LEVEL=raid5
MD_DEVICES=4
MD_METADATA=1.2

With --examine also with regext we can get those pairs:

/dev/sda:
          Magic : Intel Raid ISM Cfg Sig.
        Version : 1.0.00

In the same way we introduce some mapping (some hash in Perl) for the input data, we might need something similar here in some cases (i.e.: msdos->MSDOS) depending of the output of the command.
We have available every single output for each architecture, check for example here but we might need to run those command with different parameters, so it is better to check most of the output first as there are variations.
Another suggestion is to not try to examine more than one drive with a command so it simplifies the logic.

Ideas:

  1. Consider https://metacpan.org/pod/Config::IniFiles to check the output in favor of not using regex;
  2. Implementation of 'mdadm' should be done in scope of this ticket. For 'lsblk' part please see https://progress.opensuse.org/issues/91755.

Related issues 1 (0 open1 closed)

Related to qe-yam - action #91755: Split functionality for validating partitioning in partitions_validator_utils into more reusable functionsClosedJERiveraMoya2021-04-26

Actions
Actions

Also available in: Atom PDF