nova/nova/tests/unit/compute/provider_config_data/validate_provider_bad_confi...

72 lines
2.7 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This file contains ddt test data consumed by test_provider_config.py to test
# bad provider configurations through _validate_provider_config().
# Sample is required for each test and passed to _validate_provider_config().
# If exception is raised with expected message, the test passes.
one_invalid_additional_inventory:
sample:
providers:
- identification:
name: NAME
inventories:
additional:
- CUSTOM_RESOURCE_CLASS:
total: 1
- INVALID_RESOURCE_CLASS:
total: 1
expected_messages: ["An error occurred while processing a provider config
file: Invalid resource class, only custom resource
classes are allowed: INVALID_RESOURCE_CLASS"]
two_invalid_additional_inventory:
sample:
providers:
- identification:
name: NAME
inventories:
additional:
- CUSTOM_RESOURCE_CLASS:
total: 1
- INVALID_RESOURCE_CLASS:
total: 1
- INVALID_RESOURCE_CLASS2:
total: 1
expected_messages: ["An error occurred while processing a provider
config file: Invalid resource class, only custom
resource classes are allowed: INVALID_RESOURCE_CLASS,
INVALID_RESOURCE_CLASS2"]
one_invalid_additional_trait:
sample:
providers:
- identification:
name: NAME
traits:
additional:
- CUSTOM_TRAIT
- INVALID_TRAIT
expected_messages: ["An error occurred while processing a provider
config file: Invalid traits, only custom traits
are allowed: ['INVALID_TRAIT']"]
two_invalid_additional_trait:
sample:
providers:
- identification:
name: NAME
traits:
additional:
- CUSTOM_TRAIT
- INVALID_TRAIT
- INVALID_TRAIT2
expected_messages: ["An error occurred while processing a provider
config file: Invalid traits, only custom traits
are allowed: ['INVALID_TRAIT', 'INVALID_TRAIT2']"]