Skip to content

Commit

Permalink
Fetch pre_upgrade data based on node properties
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik committed Sep 24, 2024
1 parent 757c708 commit edcb360
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/upgrades/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,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(
next(key for key in upgrade_data if key.startswith(request.param))
)
network_type = dict(request.keywords.node.user_properties).get('SatelliteNetworkType')
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

0 comments on commit edcb360

Please sign in to comment.