Project

General

Profile

Actions

action #88606

closed

Make counting of elements in "validate_autoyast_profile" function to be optional

Added by oorlov about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
SUSE QA - SLE 15 SP3
Start date:
2021-02-15
Due date:
% Done:

0%

Estimated time:

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

  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.
Actions #1

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.

Actions #2

Updated by riafarov about 3 years ago

  • Description updated (diff)
  • Status changed from New to Workable
  • Target version set to SLE 15 SP3
Actions #3

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

Actions #4

Updated by JERiveraMoya about 3 years ago

  • Status changed from Workable to In Progress
Actions #5

Updated by JERiveraMoya about 3 years ago

  • Assignee set to JERiveraMoya
Actions #6

Updated by JERiveraMoya about 3 years ago

  • Status changed from In Progress to Feedback
Actions #8

Updated by JERiveraMoya about 3 years ago

  • Status changed from Feedback to Closed
Actions #9

Updated by JERiveraMoya about 3 years ago

VR: osd | o3

Actions

Also available in: Atom PDF