Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

[WIP]Implemented automated test for add_provider_with_instance_without_name #9826

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions cfme/tests/cloud/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ def ec2_provider_with_sts_creds(appliance):
prov.delete()


@pytest.fixture
def instance_without_name(provider):
template_id = provider.mgmt.get_template(
provider.data.templates.get('small_template').name).uuid
instance = provider.mgmt.create_vm(template_id)
wait_for(lambda: instance.state == VmState.RUNNING, delay=15, timeout=900)
Comment on lines +212 to +216
Copy link
Contributor

@john-dupuy john-dupuy Jan 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Can you use the create_vm fixture?

@pytest.fixture(scope="function")
def create_vm(setup_provider, request, provider):
if request.param:
template_type = request.param
else:
pytest.error('Any appropriate Template was not passed to the fixture.')
vm_name = _get_vm_name(request)
return _create_vm(request, template_type, provider, vm_name)

Or just the _create_vm method? That way you can specify the template and name.


yield instance
instance.cleanup()


@pytest.mark.tier(3)
@test_requirements.discovery
def test_add_cancelled_validation_cloud(request, appliance):
Expand Down Expand Up @@ -1296,8 +1307,9 @@ def test_ec2_deploy_instance_with_ssh_addition_template():


@test_requirements.ec2
@pytest.mark.manual
def test_add_ec2_provider_with_instance_without_name():
@pytest.mark.provider([EC2Provider], scope="function", override=True, selector=ONE)
@pytest.mark.usefixtures('has_no_cloud_providers')
def test_add_provider_with_instance_without_name(provider, request, instance_without_name):
"""
Polarion:
assignee: mmojzis
Expand All @@ -1311,7 +1323,9 @@ def test_add_ec2_provider_with_instance_without_name():
1.
2. Refresh should complete without errors
"""
pass
provider.create()
request.addfinalizer(provider.delete_if_exists)
provider.validate_stats(ui=True)


@test_requirements.ec2
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Werkzeug==0.16.0
widgetastic.core==0.51
widgetastic.patternfly==1.2.0
widgetsnbextension==3.4.2
wrapanapi==3.5.2
wrapanapi==3.5.4
wrapt==1.11.1
xmltodict==0.12.0
yaycl==0.3.0
Expand Down