SatelliteQE / robottelo

Robottelo is a test suite that exercises The Foreman.
GNU General Public License v3.0
61 stars 115 forks source link

Rely on dynaconf to render the config based on is_ipv6 setting #16886

Closed ogajduse closed 2 weeks ago

ogajduse commented 3 weeks ago

Problem Statement

The REPOS section of the config contains -ipv4 hostnames despite the is_ipv6 setting being set to True. This happens because we are looping through the non-templatized/non-formatted configuration loaded by the dynaconf YAML loader: https://github.com/SatelliteQE/robottelo/blob/a79da44f45e7ebfa53c49d9d8a20cfd538a51e82/robottelo/utils/url.py#L46

Since the REPOS config section contains several templates, either @format or @jinja, injecting a string containing -ipv4, and since our algorithm uses the raw config file value loaded by the YAML loader, we are not able to detect this case and change these URLs and hostnames to -ipv6.

Solution

The proposed solution is to shift to a different approach - from mutating settings by an algorithm in robottelo to creating a self-contained configuration structure and including IPv4 and IPv6 URLs and hostnames in the config. Based on the IS_IPV6 setting, templatize the value of the actual hostname/URL config field.

Related Issues

https://issues.redhat.com/browse/SAT-29304 satellite-jenkins!1545

ogajduse commented 2 weeks ago

Switching the PR to a ready state. However, it still needs some testing.

ogajduse commented 2 weeks ago

It was successfully tested in combination with satellite-jenkins!1545.