action #88606
closedMake counting of elements in "validate_autoyast_profile" function to be optional
0%
Description
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¶
- Update
validate_autoyast_profile
function and all the related ones (e.g.generate_expressions
) so that checking the amount of elements become optional; - 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.
Updated by JERiveraMoya about 3 years ago
It is documented that it is possible with a hash, but only when there is only one element, otherwise it only goes through one item ignoring the rest. Definitely needs some more love.
Updated by riafarov about 3 years ago
- Description updated (diff)
- Status changed from New to Workable
- Target version set to SLE 15 SP3
Updated by JERiveraMoya about 3 years ago
Check as well if different service can be validated, for example: https://openqa.suse.de/tests/5476579/file/clone-autoinst.xml
Updated by JERiveraMoya about 3 years ago
- Status changed from Workable to In Progress
Updated by JERiveraMoya about 3 years ago
- Status changed from In Progress to Feedback
Updated by JERiveraMoya about 3 years ago
- Status changed from Feedback to Closed