action #91758

Updated by JERiveraMoya about 3 years ago

In [tests/console/]( 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: 
 With --examine also with regext we can get those pairs: 
           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.