f81d0a592f
Provder name can be found in provider config, so first argument of get_provider is not necessary. Now provider can be created by calling ProviderFactory.get_provider(provider_config) instead of ProviderFactory.get_provider(provider_name, provider_config) Change-Id: Idc579ef6c362b4180fa4f24201363bc0b8d3ac33
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
# Copyright 2013: Mirantis Inc.
|
|
# All Rights Reserved.
|
|
#
|
|
# 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.
|
|
|
|
from rally import serverprovider
|
|
from rally import test
|
|
|
|
|
|
ProviderFactory = serverprovider.ProviderFactory
|
|
|
|
|
|
class DummyProviderTestCase(test.NoDBTestCase):
|
|
|
|
def test_create_vms(self):
|
|
config = {'name': 'DummyProvider',
|
|
'credentials': ['user@host1', 'user@host2']}
|
|
provider = serverprovider.ProviderFactory.get_provider(config)
|
|
credentials = provider.create_vms()
|
|
self.assertEqual(['host1', 'host2'], [s.ip for s in credentials])
|
|
self.assertEqual(['user', 'user'], [s.user for s in credentials])
|