Project

General

Profile

action #91758

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

Validate raid partitioning layout using test data instead of regex

Added by JERiveraMoya 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
SUSE QA - 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

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

History

#1 Updated by JERiveraMoya 5 months ago

  • Description updated (diff)

#2 Updated by JERiveraMoya 5 months ago

  • Description updated (diff)

#3 Updated by oorlov 5 months ago

  • Related to action #91755: Split functionality for validating partitioning in partitions_validator_utils into more reusable functions added

#4 Updated by oorlov 5 months ago

  • Description updated (diff)
  • Status changed from New to Workable

#5 Updated by riafarov 5 months ago

  • Status changed from Workable to In Progress
  • Assignee set to riafarov

#6 Updated by riafarov 5 months ago

https://metacpan.org/pod/Config::Tiny is available and we can use it.

#7 Updated by riafarov 5 months ago

  • Status changed from In Progress to Feedback

#9 Updated by riafarov 5 months ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF