1- import fauxfactory
21import pytest
3- from widgetastic_patternfly import DropdownItemNotFound
42
5- from cfme import test_requirements
63from cfme .fixtures .provider import setup_or_skip
74from cfme .infrastructure .provider import InfraProvider
8- from cfme .infrastructure .provider .virtualcenter import VMwareProvider
95from cfme .infrastructure .virtual_machines import InfraVmCollection
6+ from cfme .markers .env_markers .provider import ONE
107from cfme .markers .env_markers .provider import ONE_PER_TYPE
11- from cfme .markers .env_markers .provider import providers
128from cfme .utils .blockers import BZ
13- from cfme .utils .log import logger
14- from cfme .utils .providers import ProviderFilter
159
1610pytestmark = [
1711 pytest .mark .tier (3 ),
2014 selector = ONE_PER_TYPE ),
2115]
2216
23- '''
24- @pytest.fixture
25- def create_vm(appliance, provider, request):
26- """Fixture to provision vm to the provider being tested"""
27- vm_name = fauxfactory.gen_alphanumeric(15, start="test_clone_")
28- vm = appliance.collections.infra_vms.instantiate(vm_name, provider)
29- logger.info("provider_key: %s", provider.key)
30-
31- if not provider.mgmt.does_vm_exist(vm.name):
32- logger.info("deploying %s on provider %s", vm.name, provider.key)
33- vm.create_on_provider(allow_skip="default", find_in_cfme=True)
34- yield vm
35- vm.cleanup_on_provider()
36- '''
3717
3818@pytest .fixture
3919def setup_provider_min_vms (request , appliance , provider , min_vms ):
@@ -44,28 +24,23 @@ def setup_provider_min_vms(request, appliance, provider, min_vms):
4424 setup_or_skip (request , provider )
4525
4626
47- # @pytest.mark.provider([InfraProvider], selector=ONE, scope="function")
27+ @pytest .mark .provider ([InfraProvider ], selector = ONE , scope = "function" )
4828@pytest .mark .parametrize ("min_vms" , [2 , 4 ])
4929@pytest .mark .parametrize ("vm_collection" , ["provider" , "appliance" ])
5030@pytest .mark .meta (blockers = [BZ (1784180 , forced_streams = ["5.10" ])], automates = [1784180 ])
51- def test_compare_vms (appliance , setup_provider_min_vms , provider ,
52- min_vms , vm_collection ):
31+ def test_compare_vms (appliance , setup_provider_min_vms , provider , min_vms , vm_collection ):
5332 """
5433 Polarion:
55- assignee: prichard
34+ assignee: prichard ????????
5635 casecomponent: Infra
5736 caseimportance: high
5837 initialEstimate: 1/6h
59- Bugzilla:
60- 1746449
6138 """
6239 if vm_collection == 'provider' :
63- provider .collections .vms = InfraVmCollection (provider ,
64- filters = {'provider' : provider })
40+ provider .collections .vms = InfraVmCollection (provider , filters = {'provider' : provider })
6541 t_coll = provider .collections .vms .all ()[:min_vms ]
6642 provider .collections .vms .compare_entities_col (provider , entities_list = t_coll )
6743 elif vm_collection == 'appliance' :
68- # This is named a provider test, but I wanted to test with appliance.
6944 appliance .collections .vms = InfraVmCollection (appliance )
7045 t_coll = appliance .collections .templates .all ()[:min_vms ]
7146 appliance .collections .vms .compare_entities_col (provider , entities_list = t_coll )
0 commit comments