Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch pre_upgrade data based on node properties #16423

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Sep 19, 2024

Problem Statement

During TFA I've seen several post_upgrade failures for "rhel_contenthost-parametrized" upgrade scenario tests where the pre-data could not be fetched from the scenario_entities file:

failed on setup with "Failed: Invalid test parameter: rhel7. Test data not found."

The reason is that the pre-upgrade test names are now suffixed with -ipv4 or -ipv6 so the scenario_entities hold items like this:

{"tests/upgrades/test_repository.py::TestSimpleContentAccessOnly::test_pre_simple_content_access_only[rhel7-ipv4]": {...}}

while this piece of code requires the exact param, which is just rhel7, rhel8, rhel9.

Solution(?)

There are probably more than one solution and I'm not sure which one would be the best.

Initially I thought we could go regardless the ipvX suffix since I supposed the pipelines were separated (first commit).
That's probably not a good solution when we start decorating tests with ['ipv4', 'ipv6'] explicitly, so I took the network type from the settings.

Please let me know if there is a better place where to get that information from in scope of the pre_upgrade_data fixture.

@vsedmik vsedmik added CherryPick PR needs CherryPick to previous branches 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Sep 19, 2024
@vsedmik vsedmik self-assigned this Sep 19, 2024
@vsedmik vsedmik changed the title Fetch pre_upgrade data regardless the ipvX suffix Fetch pre_upgrade data based on node properties Sep 24, 2024
if len(upgrade_data) == 1:
param_value = next(iter(upgrade_data.values()))
else:
param_value = upgrade_data.get(request.param)
network_type = dict(request.keywords.node.user_properties).get('SatelliteNetworkType')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The network type is not always SatelliteNetworkType, it is first checked in tests param and if not then only in SatelliteNetworkType

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is that extracted_value can be anything like rhel7, rhel7-ipv4, rhel7-ipv6 and other rhel variants.
Also request.param can be anything like that - with or without ipvX. When it is decorated with ipvX, only that single value is added to the upgrade_data list due to the if on line 263. On the other hand, when request.param is not decorated with ipvX (i.e. just plain rhel7) the upgrade_data gets filled with everything that contains rhel7, like ['rhel7-ipv4', 'rhel7-ipv6']. Only in that case we read the SatelliteNetworkType to resolve which one should be picked from upgrade_data.

@jyejare
Copy link
Member

jyejare commented Sep 26, 2024

@vsedmik We accept this as a half solution and we need to communicate to the team that, for now we are not supporting upgrade scenarios parametrization for network type.

@vsedmik vsedmik merged commit 65d7c33 into SatelliteQE:master Oct 2, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 2, 2024
* Fetch pre_upgrade data regardless the ipvX suffix

* Fetch pre_upgrade data based on node properties

* Fetch pre_upgrade data based on settings

(cherry picked from commit 65d7c33)
github-actions bot pushed a commit that referenced this pull request Oct 2, 2024
* Fetch pre_upgrade data regardless the ipvX suffix

* Fetch pre_upgrade data based on node properties

* Fetch pre_upgrade data based on settings

(cherry picked from commit 65d7c33)
vsedmik added a commit that referenced this pull request Oct 2, 2024
Fetch pre_upgrade data based on node properties (#16423)

* Fetch pre_upgrade data regardless the ipvX suffix

* Fetch pre_upgrade data based on node properties

* Fetch pre_upgrade data based on settings

(cherry picked from commit 65d7c33)

Co-authored-by: vsedmik <46570670+vsedmik@users.noreply.github.com>
vsedmik added a commit that referenced this pull request Oct 2, 2024
Fetch pre_upgrade data based on node properties (#16423)

* Fetch pre_upgrade data regardless the ipvX suffix

* Fetch pre_upgrade data based on node properties

* Fetch pre_upgrade data based on settings

(cherry picked from commit 65d7c33)

Co-authored-by: vsedmik <46570670+vsedmik@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants