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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/upgrades/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def test_capsule_post_upgrade_skipped(pre_upgrade_data):
from box import Box
import pytest

from robottelo.config import settings
from robottelo.logging import logger
from robottelo.utils.decorators.func_locker import lock_function

Expand Down Expand Up @@ -260,11 +261,13 @@ def test_something_post_upgrade(pre_upgrade_data):
start_index = test_node_id.find('[') + 1
end_index = test_node_id.find(']')
extracted_value = test_node_id[start_index:end_index]
upgrade_data[extracted_value] = _read_test_data(test_node_id)
if request.param in extracted_value:
upgrade_data[extracted_value] = _read_test_data(test_node_id)
if len(upgrade_data) == 1:
param_value = next(iter(upgrade_data.values()))
else:
param_value = upgrade_data.get(request.param)
network_type = 'ipv6' if settings.server.is_ipv6 else 'ipv4'
param_value = upgrade_data.get(f'{request.param}-{network_type}')
if param_value is None:
pytest.fail(f"Invalid test parameter: {request.param}. Test data not found.")
return Box(param_value)
Expand Down
Loading