diff --git a/releasenotes/notes/network_feature_enabled_available_features-35f9ac5f253e2ca3.yaml b/releasenotes/notes/network_feature_enabled_available_features-35f9ac5f253e2ca3.yaml new file mode 100644 index 0000000000..1f2d6b9a9b --- /dev/null +++ b/releasenotes/notes/network_feature_enabled_available_features-35f9ac5f253e2ca3.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + New config option to ``network-feature-enabled``: ``available_features``. + This is a list which can contain features that are not discoverable + through Neutron API, or it can be the special entry ``all``. diff --git a/tempest/common/utils/__init__.py b/tempest/common/utils/__init__.py index 167bf5b5a8..914acf7906 100644 --- a/tempest/common/utils/__init__.py +++ b/tempest/common/utils/__init__.py @@ -128,3 +128,18 @@ def is_extension_enabled(extension_name, service): if extension_name in config_dict[service]: return True return False + + +def is_network_feature_enabled(feature_name): + """A function that will check the list of available network features + + """ + list_of_features = CONF.network_feature_enabled.available_features + + if not list_of_features: + return False + if list_of_features[0] == 'all': + return True + if feature_name in list_of_features: + return True + return False diff --git a/tempest/config.py b/tempest/config.py index 2f2c2e9a62..28a70c2ecf 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -790,6 +790,13 @@ NetworkFeaturesGroup = [ "entry all which indicates every extension is enabled. " "Empty list indicates all extensions are disabled. " "To get the list of extensions run: 'neutron ext-list'"), + cfg.ListOpt('available_features', + default=['all'], + help="A list of available network features with a special " + "entry all that indicates every feature is available. " + "Empty list indicates all features are disabled." + "This list can contain features that are not " + "discoverable through API."), cfg.BoolOpt('ipv6_subnet_attributes', default=False, help="Allow the execution of IPv6 subnet tests that use "