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

Commit

Permalink
Adding automation for BZ1644770
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedar Vijay Kulkarni committed Feb 7, 2020
1 parent 3250c91 commit 933c6ab
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions cfme/tests/infrastructure/test_vmware_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.blockers import BZ
from cfme.utils.log import logger
from cfme.utils.wait import TimedOutError


filter_fields = [['provisioning', 'template'],
Expand Down Expand Up @@ -558,3 +559,65 @@ def test_vm_notes_ui(appliance, provider):
# to check it against what's displayed in the UI.
assert view.basic_information.read()['Notes'] != '', ("VM notes field is empty in CFME or"
"VM does not have any notes")


@pytest.mark.meta(automates=[1644770])
@pytest.mark.parametrize('create_vm', ['small_template'], indirect=True)
def test_delete_vm_archive(appliance, provider, create_vm):
"""
Bugzilla:
1644770
Polarion:
assignee: kkulkarn
casecomponent: Infra
caseimportance: medium
initialEstimate: 1/2h
testtype: functional
testSteps:
1.Add VMware provider to CFME
2.Create a new Vm
3.Remove it from vmware using delete operation and check status of that vm in CFME -
should be archived
expectedResults:
1.VMware provider added successfully.
2.New VM visible in CFME
3.VM is Archived in CFME
"""
create_vm.mgmt.delete()
try:
create_vm.wait_for_vm_state_change(from_any_provider=True, desired_state='archived')
except TimedOutError:
pytest.fail("VM did not reach desired state - Archived.")
quadicon = create_vm.find_quadicon(from_any_provider=True)
assert quadicon.data['power_state' if appliance.version > '5.11' else 'state'] == 'archived'


@pytest.mark.meta(automates=[1644770])
@pytest.mark.parametrize('create_vm', ['small_template'], indirect=True)
def test_vm_remove_from_inventory_orphan(appliance, provider, create_vm):
"""
Bugzilla:
1644770
Polarion:
assignee: kkulkarn
casecomponent: Infra
caseimportance: medium
initialEstimate: 1/2h
testtype: functional
testSteps:
1.Add VMware provider to CFME
2.Create a new Vm
3.Remove it from vmware using unregister(remove from inventory) operation and
check status of that vm in CFME- should be orphaned
expectedResults:
1.VMware provider added successfully.
2.New VM visible in CFME
3.VM is Orphaned in CFME
"""
create_vm.mgmt.unregister()
try:
create_vm.wait_for_vm_state_change(from_any_provider=True, desired_state='orphaned')
except TimedOutError:
pytest.fail("VM did not reach desired state - Orphaned.")
quadicon = create_vm.find_quadicon(from_any_provider=True)
assert quadicon.data['power_state' if appliance.version > '5.11' else 'state'] == 'orphaned'
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.2
widgetsnbextension==3.4.2
wrapanapi==3.5.4
wrapanapi== 3.5.6
wrapt==1.11.1
xmltodict==0.12.0
yaycl==0.3.0
Expand Down

0 comments on commit 933c6ab

Please sign in to comment.