Project

General

Profile

action #88606

Updated by riafarov about 3 years ago

### Motivation 

 Currently, `validate_autoyast_profile` function in `autoyast.pm` also compares the amount of elements in the cloned autoinst.xml with the amount of elements in test data. 

 This is implemented in `autoyast.pm`: 

 ``` 
 # add expression to check expected list size 
 push @{$expressions}, "$exp" . "[count(ns:$list_name)=$list_size]" 
 ``` 

 But sometimes there is no need to validate the amount of elements. For example, while checking partitioning, a test may need to check only specific flags for the certain partitions and other partitions may be ignored at all. 

 We still need both options, to validate exact match (there are no other nodes, besides the ones defined) and validate partial match, when we want to validate that defined nodes do exist, but we don't care if there are other ones. 

 ### Task 
 1. Update `validate_autoyast_profile` function    and all the related ones (e.g. `generate_expressions`) so that checking the amount of elements become optional; 
 2. **Optional:** Think about separating the function to several ones, e.g. one function checks if all the values from the test data correspond to the ones in cloned `autoinst.xml`, another function counts the number of elements. That will allow to separate logic of the functions and make them more transparent. 

Back