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

[1LP][RFR] Add comparison of OS data after revert to test_verify_revert_snapshot #10176

Merged
merged 9 commits into from
Jun 23, 2020
21 changes: 21 additions & 0 deletions cfme/infrastructure/virtual_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,18 @@ def is_displayed(self):
self.context['object'].name in [row.name.text for row in self.affected_vms.rows()])


class InfraVmOsView(InfraVmView):
"""The Operating System page"""
title = Text('#explorer_title_text')
basic_information = SummaryTable(title="Basic Information")

@property
def is_displayed(self):
name = self.context['object'].name
expected_title = f'"OS Info" for Virtual Machine "{name}"'
return self.in_infra_vms and self.title.text == expected_title


class InfraVmSnapshotToolbar(View):
"""The toolbar on the snapshots page"""
history = Dropdown('History')
Expand Down Expand Up @@ -1528,6 +1540,15 @@ def resetter(self, *args, **kwargs):
self.view.reset_page()


@navigator.register(InfraVm, 'OS Info')
class VmOsInfo(CFMENavigateStep):
VIEW = InfraVmOsView
prerequisite = NavigateToSibling('Details')

def step(self, *args, **kwargs):
self.prerequisite_view.entities.summary('Properties').click_at('Operating System')


@navigator.register(InfraTemplate, 'Details')
@navigator.register(InfraVm, 'Details')
class VmAllWithTemplatesDetails(CFMENavigateStep):
Expand Down
20 changes: 16 additions & 4 deletions cfme/tests/infrastructure/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ def verify_revert_snapshot(full_test_vm, provider, soft_assert, register_event,
assert ssh_client.run_command('test -e snapshot2.txt') == 1


@pytest.mark.meta(
blockers=[BZ(1805803, unblock=lambda provider: not provider.one_of(RHEVMProvider),
ignore_bugs={1745065})], automates=[1805803])
@pytest.mark.rhv1
@pytest.mark.provider([VMwareProvider])
Copy link
Member

Choose a reason for hiding this comment

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

I think if we're going to remove RHV from the parametrization here, we should include comments concerning the BZ's, the fact that they aren't getting fixed, etc.

The other option here is to use pytest.mark.uncollectif, evaluating the provider type and BZ blocking status to uncollect the test case instead of skipping it.

This will make it so the test case isn't collected and included in reports, when it will not get fixed, instead of just being skipped at runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uncollectif added.

@pytest.mark.parametrize('create_vm', ['full_template'], indirect=True)
def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event, request):
"""Tests revert snapshot
Expand All @@ -241,14 +240,27 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event
test_flag: snapshot, provision

Bugzilla:
1561618
1805803

Polarion:
assignee: prichard
casecomponent: Infra
initialEstimate: 1/4h
"""
# getting the initial value for OS details.
view = navigate_to(create_vm, 'Details')
os_text_initial = view.entities.summary('Properties').get_text_of('Operating System')
verify_revert_snapshot(create_vm, provider, soft_assert, register_event, request)
# verify that the system info is displayed
view = navigate_to(create_vm, 'Details')
# check that the OS is in the field.
os_text_compare = view.entities.summary('Properties').get_text_of('Operating System')
assert os_text_compare == os_text_initial
os_view = navigate_to(create_vm, 'OS Info')
# check that the OS Info view is displayed and contains OS data
assert os_view.is_displayed
os_text_compare = view.entities.summary('Basic Information').get_text_of('Operating System')
assert os_text_compare == os_text_initial


@pytest.mark.parametrize('create_vm', ['full_template'], indirect=True)
Expand Down