diff --git a/pytest_plugins/metadata_markers.py b/pytest_plugins/metadata_markers.py index e141d45a1ad..364c250a84e 100644 --- a/pytest_plugins/metadata_markers.py +++ b/pytest_plugins/metadata_markers.py @@ -152,6 +152,9 @@ def pytest_collection_modifyitems(items, config): sat_version = settings.server.version.get('release') snap_version = settings.server.version.get('snap', '') + # Satellite Network Type on which tests are running on + satellite_network_type = 'ipv6' if settings.server.is_ipv6 else 'ipv4' + # split the option string and handle no option, single option, multiple # config.getoption(default) doesn't work like you think it does, hence or '' importance = [i.lower() for i in (config.getoption('importance') or '').split(',') if i != ''] @@ -224,6 +227,9 @@ def pytest_collection_modifyitems(items, config): item.user_properties.append(("SatelliteVersion", sat_version)) item.user_properties.append(("SnapVersion", snap_version)) + # Network Type user property + item.user_properties.append(("SatelliteNetworkType", satellite_network_type)) + # exit early if no filters were passed if importance or component or team: # Filter test collection based on CLI options for filtering