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

Commit

Permalink
[1LP][RFR] Add bz metadata for timelines tests (#9285)
Browse files Browse the repository at this point in the history
* Add bz metadata for timelines tests

* Also add elif for delete event test
  • Loading branch information
john-dupuy authored and jawatts committed Aug 30, 2019
1 parent d8e7b2d commit 8158796
Showing 1 changed file with 38 additions and 32 deletions.
70 changes: 38 additions & 32 deletions cfme/tests/infrastructure/test_timelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,22 +304,27 @@ def catch_in_timelines(self, soft_assert, targets, policy_events=False):
raise ValueError('Targets must not be empty')


@pytest.mark.meta(automates=[1747132])
def test_infra_timeline_create_event(new_vm, soft_assert):
"""Test that the event create is visible on the management event timeline of the Vm,
Vm's cluster, VM's host, VM's provider.
Metadata:
test_flag: events, provision, timelines
Bugzilla:
1670550
1747132
Polarion:
assignee: jdupuy
initialEstimate: 1/4h
casecomponent: Events
"""
event = 'create'
vm_event = VMEvent(new_vm, event)
if BZ(1670550).blocks:
targets = (new_vm, )
if BZ(1747132).blocks:
targets = (new_vm, new_vm.cluster, new_vm.provider)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
Expand All @@ -335,17 +340,17 @@ def test_infra_timeline_policy_event(new_vm, control_policy, soft_assert):
Metadata:
test_flag: events, provision, timelines
Bugzilla:
1670550
Polarion:
assignee: jdupuy
initialEstimate: 1/4h
casecomponent: Events
"""

event = 'policy'
if BZ(1670550).blocks:
targets = (new_vm,)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
vm_event = VMEvent(new_vm, event)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
wait_for(vm_event.emit, timeout='7m', message='Event {} did timeout'.format(event))
Expand All @@ -359,16 +364,16 @@ def test_infra_timeline_stop_event(new_vm, soft_assert):
Metadata:
test_flag: events, provision, timelines
Bugzilla:
1670550
Polarion:
assignee: jdupuy
initialEstimate: 1/4h
casecomponent: Events
"""
event = 'stop'
if BZ(1670550).blocks:
targets = (new_vm,)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
vm_event = VMEvent(new_vm, event)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
wait_for(vm_event.emit, timeout='7m', message='Event {} failed'.format(event))
Expand All @@ -382,16 +387,16 @@ def test_infra_timeline_start_event(new_vm, soft_assert):
Metadata:
test_flag: events, provision, timelines
Bugzilla:
1670550
Polarion:
assignee: jdupuy
initialEstimate: 1/4h
casecomponent: Events
"""
event = 'start'
if BZ(1670550).blocks:
targets = (new_vm,)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
vm_event = VMEvent(new_vm, event)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
wait_for(vm_event.emit, timeout='7m', message='Event {} failed'.format(event))
Expand All @@ -405,16 +410,16 @@ def test_infra_timeline_suspend_event(new_vm, soft_assert):
Metadata:
test_flag: events, provision, timelines
Bugzilla:
1670550
Polarion:
assignee: jdupuy
initialEstimate: 1/4h
casecomponent: Events
"""
event = 'suspend'
if BZ(1670550).blocks:
targets = (new_vm,)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
vm_event = VMEvent(new_vm, event)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
wait_for(vm_event.emit, timeout='7m', message='Event {} failed'.format(event))
Expand Down Expand Up @@ -451,6 +456,7 @@ def test_infra_timeline_clone_event(new_vm, soft_assert):
Bugzilla:
1622952
1670550
Polarion:
assignee: jdupuy
Expand All @@ -459,10 +465,7 @@ def test_infra_timeline_clone_event(new_vm, soft_assert):
"""
event = 'clone'
vm_event = VMEvent(new_vm, event)
if BZ(1670550).blocks:
targets = (new_vm,)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
wait_for(vm_event.emit, timeout='7m', message='Event {evt} failed'.format(evt=event))
vm_event.catch_in_timelines(soft_assert, targets)
Expand All @@ -475,17 +478,17 @@ def test_infra_timeline_migrate_event(new_vm, soft_assert):
Metadata:
test_flag: events, provision, timelines
Bugzilla:
1670550
Polarion:
assignee: jdupuy
initialEstimate: 1/4h
casecomponent: Events
"""
event = 'migrate'
vm_event = VMEvent(new_vm, event)
if BZ(1670550).blocks:
targets = (new_vm,)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
wait_for(vm_event.emit, timeout='7m', message='Event {evt} failed'.format(evt=event))
vm_event.catch_in_timelines(soft_assert, targets)
Expand All @@ -500,22 +503,23 @@ def test_infra_timeline_rename_event(new_vm, soft_assert):
Metadata:
test_flag: events, provision, timelines
Bugzilla:
1670550
Polarion:
assignee: jdupuy
initialEstimate: 1/4h
casecomponent: Events
"""
event = 'rename'
vm_event = VMEvent(new_vm, event)
if BZ(1670550).blocks:
targets = (new_vm,)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
wait_for(vm_event.emit, timeout='7m', message='Event {evt} failed'.format(evt=event))
vm_event.catch_in_timelines(soft_assert, targets)


@pytest.mark.meta(automates=[1747132])
def test_infra_timeline_delete_event(new_vm, soft_assert):
"""Test that the event delete is visible on the management event timeline of the Vm,
Vm's cluster, VM's host, VM's provider.
Expand All @@ -525,6 +529,8 @@ def test_infra_timeline_delete_event(new_vm, soft_assert):
Bugzilla:
1550488
1670550
1747132
Polarion:
assignee: jdupuy
Expand All @@ -533,8 +539,8 @@ def test_infra_timeline_delete_event(new_vm, soft_assert):
"""
event = 'delete'
vm_event = VMEvent(new_vm, event)
if BZ(1670550).blocks:
targets = (new_vm,)
if BZ(1747132).blocks:
targets = (new_vm, new_vm.cluster, new_vm.provider)
else:
targets = (new_vm, new_vm.cluster, new_vm.host, new_vm.provider)
logger.info('Will generate event %r on machine %r', event, new_vm.name)
Expand Down

0 comments on commit 8158796

Please sign in to comment.