diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/base.py b/whitebox_neutron_tempest_plugin/tests/scenario/base.py index 1eadee0..3ccecfb 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/base.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/base.py @@ -394,17 +394,23 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase): else: service_prefix = "" cmd_prefix = "crudini --get" - for config_file in config_files: + # If we have config file with defaults and second one with overrides, + # the latter has the config that wins + for config_file in reversed(config_files): setting = "{} {} {}".format(config_file, section, param) cmd = "{} {} {} || true".format( service_prefix, cmd_prefix, setting) LOG.debug("Command = '{}'".format(cmd)) - result = host['client'].exec_command(cmd) + result = host['client'].exec_command(cmd).strip() LOG.debug("Result = '{}'".format(result)) - if value.lower() in result.lower(): - return True - else: - continue + # Since we are checking files in reverse order, + # if we've found a value than it's an override and we + # should ignore values in other files + if result: + if value.lower() in result.lower(): + return True + else: + break if skip_if_fails: raise cls.skipException(msg)