Project

General

Profile

action #91758

Updated by JERiveraMoya almost 3 years ago

In [tests/console/validate_raid.pm](https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/tests/console/validate_raid.pm) 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 and we can parse applying `use Mojo::JSON 'decode_json'` and compare easily against with 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](https://openqa.suse.de/tests/5899625#step/validate_raid/7) 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. investigation.

Back