Project

General

Profile

action #91755

Updated by JERiveraMoya over 3 years ago

We have created a package [lib/partitions_validator_utils](https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/partitions_validator_utils.pm) which group some functionality for validating partitioning, but we haven't thought much how this functions could be reused in others tests, for example: 
 - validate_partition_table should contain more clear the argument to be passed. 
 - Avoid conditional statements. 
 - Libraries should give us the information that we need running the commands, assertion should be done on the test itself. 
 - Wrap blkid/lsblk parsers with some parametrized function so it can be reused easily. lsblk has an option to be exported to json. 
 - subvolume validation might be move to a different library for btrfs actions. 
 - We could think to rename it to something like /lib/validators/partitioning.pm so package name will be validators::partitioning. 
 - Think about other partitioning commands (filesystem cmds to check the partitioning, the basic ones, not raid or similar, we can address that later) that we are running existing test that could be included here. 

 For example, we have this [block of code](https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/6ba09a19716cc1675d9f24182f366aadfd80b179/tests/console/validate_ext4_fs.pm#L51) with no relation with `sub validate_unpartitioned_space` in lib/partitions_validator_utils.pm 

 In general we should split the functionality in this library to have more fine grain and document it with perlpod. 


Back