From b2ce780e93dd5bd8e706a489042fa6187a969f5e Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Mon, 8 Jun 2020 15:25:15 -0400 Subject: [PATCH 1/9] Add comparison of OS data after revert to test_verify_revert_snapshot --- cfme/tests/infrastructure/test_snapshot.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cfme/tests/infrastructure/test_snapshot.py b/cfme/tests/infrastructure/test_snapshot.py index 8e7b8d70ed..b8a4feab68 100644 --- a/cfme/tests/infrastructure/test_snapshot.py +++ b/cfme/tests/infrastructure/test_snapshot.py @@ -248,7 +248,20 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event casecomponent: Infra initialEstimate: 1/4h """ - verify_revert_snapshot(create_vm, provider, soft_assert, register_event, request) + # 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) + # We could put this in the method above, but we just had a discussion about putting the + # validation in the test case? + # verify that the system info is displayed + view = navigate_to(create_vm, 'Details') + # we can check here that the OS in in the field. + os_text_final = view.entities.summary('Properties').get_text_of('Operating System') + assert os_text_final == os_text_initial + view.entities.summary('Properties').click_at('Operating System') + # now verify "Basic Information" table has row "OperatingSystem. And it contains value. + # ? should we be capturing this from the initial state before snapshot? @pytest.mark.parametrize('create_vm', ['full_template'], indirect=True) From a8c4a5b7e86f9c4ec24dce4de5fa12d7a418617c Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Tue, 16 Jun 2020 15:39:38 -0400 Subject: [PATCH 2/9] Added verify_revert_snapshot() back into test. Had been removed for testing --- cfme/tests/infrastructure/test_snapshot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cfme/tests/infrastructure/test_snapshot.py b/cfme/tests/infrastructure/test_snapshot.py index b8a4feab68..3d142ba4b2 100644 --- a/cfme/tests/infrastructure/test_snapshot.py +++ b/cfme/tests/infrastructure/test_snapshot.py @@ -248,11 +248,12 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event casecomponent: Infra initialEstimate: 1/4h """ + verify_revert_snapshot(create_vm, provider, soft_assert, register_event, request) + # Now verify OS data is displayed in Details View. # 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) - # We could put this in the method above, but we just had a discussion about putting the + # We could put this in verify_revert_snapshot, but we just had a discussion about putting the # validation in the test case? # verify that the system info is displayed view = navigate_to(create_vm, 'Details') From ff7391c7388428422d5ea9ab4b523e94bf317172 Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Tue, 16 Jun 2020 20:23:58 -0400 Subject: [PATCH 3/9] Add verification of OS data in OS view --- cfme/infrastructure/virtual_machines.py | 19 +++++++++++++++++++ cfme/tests/infrastructure/test_snapshot.py | 16 ++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/cfme/infrastructure/virtual_machines.py b/cfme/infrastructure/virtual_machines.py index dc85c041f1..7e67d780eb 100644 --- a/cfme/infrastructure/virtual_machines.py +++ b/cfme/infrastructure/virtual_machines.py @@ -333,6 +333,7 @@ class InfraVmContainerView(VMDetailsEntities): @property def is_displayed(self): return self.basic_information.is_displayed and self.device.is_displayed + # does above work?? There is no is_displayed for SummaryTable? class InfraVmDetailsView(InfraVmView): @@ -453,6 +454,24 @@ 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") + + ''' + This looks suspect. + @property + def is_displayed(self): + return self.basic_information.is_displayed + ''' + + @property + def is_displayed(self): + expected_title = '"OS Info" for Virtual Machine "{}"'.format(self.context['object'].name) + return self.in_infra_vms and self.title.text == expected_title + + class InfraVmSnapshotToolbar(View): """The toolbar on the snapshots page""" history = Dropdown('History') diff --git a/cfme/tests/infrastructure/test_snapshot.py b/cfme/tests/infrastructure/test_snapshot.py index 3d142ba4b2..1b7418b0bc 100644 --- a/cfme/tests/infrastructure/test_snapshot.py +++ b/cfme/tests/infrastructure/test_snapshot.py @@ -11,6 +11,7 @@ from cfme.infrastructure.provider.rhevm import RHEVMProvider from cfme.infrastructure.provider.virtualcenter import VMwareProvider from cfme.infrastructure.virtual_machines import InfraVm +from cfme.infrastructure.virtual_machines import InfraVmOsView from cfme.infrastructure.virtual_machines import InfraVmSnapshotAddView from cfme.infrastructure.virtual_machines import InfraVmSnapshotView from cfme.utils.appliance.implementations.ui import navigate_to @@ -248,21 +249,24 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event casecomponent: Infra initialEstimate: 1/4h """ - verify_revert_snapshot(create_vm, provider, soft_assert, register_event, request) - # Now verify OS data is displayed in Details View. # 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) # We could put this in verify_revert_snapshot, but we just had a discussion about putting the # validation in the test case? # verify that the system info is displayed view = navigate_to(create_vm, 'Details') # we can check here that the OS in in the field. - os_text_final = view.entities.summary('Properties').get_text_of('Operating System') - assert os_text_final == os_text_initial + os_text_compare = view.entities.summary('Properties').get_text_of('Operating System') + assert os_text_compare == os_text_initial + # !!! Create a navigate_to for Operating System view + view.entities.summary('Properties').click_at('Operating System') - # now verify "Basic Information" table has row "OperatingSystem. And it contains value. - # ? should we be capturing this from the initial state before snapshot? + os_view = create_vm.create_view(InfraVmOsView) + 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) From d8ab45a9f0b65de2cac8d9b3595baee996ae2f89 Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Tue, 16 Jun 2020 22:20:12 -0400 Subject: [PATCH 4/9] Create navigation to InfraVmOsView and add to test_verify_revert_snapshot --- cfme/infrastructure/virtual_machines.py | 9 +++++++++ cfme/tests/infrastructure/test_snapshot.py | 8 ++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cfme/infrastructure/virtual_machines.py b/cfme/infrastructure/virtual_machines.py index 7e67d780eb..6a90e427ef 100644 --- a/cfme/infrastructure/virtual_machines.py +++ b/cfme/infrastructure/virtual_machines.py @@ -1547,6 +1547,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): diff --git a/cfme/tests/infrastructure/test_snapshot.py b/cfme/tests/infrastructure/test_snapshot.py index 1b7418b0bc..ebe9d3b22d 100644 --- a/cfme/tests/infrastructure/test_snapshot.py +++ b/cfme/tests/infrastructure/test_snapshot.py @@ -11,7 +11,6 @@ from cfme.infrastructure.provider.rhevm import RHEVMProvider from cfme.infrastructure.provider.virtualcenter import VMwareProvider from cfme.infrastructure.virtual_machines import InfraVm -from cfme.infrastructure.virtual_machines import InfraVmOsView from cfme.infrastructure.virtual_machines import InfraVmSnapshotAddView from cfme.infrastructure.virtual_machines import InfraVmSnapshotView from cfme.utils.appliance.implementations.ui import navigate_to @@ -252,7 +251,7 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event # 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_revert_snapshot(create_vm, provider, soft_assert, register_event, request) # We could put this in verify_revert_snapshot, but we just had a discussion about putting the # validation in the test case? # verify that the system info is displayed @@ -260,10 +259,7 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event # we can check here that the OS in in the field. os_text_compare = view.entities.summary('Properties').get_text_of('Operating System') assert os_text_compare == os_text_initial - # !!! Create a navigate_to for Operating System view - - view.entities.summary('Properties').click_at('Operating System') - os_view = create_vm.create_view(InfraVmOsView) + os_view = navigate_to(create_vm, 'OS Info') 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 From 7946259afb3952f857f7a52b3d50c27638e971a4 Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Wed, 17 Jun 2020 20:14:39 -0400 Subject: [PATCH 5/9] Remove and update comments --- cfme/infrastructure/virtual_machines.py | 1 - cfme/tests/infrastructure/test_snapshot.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cfme/infrastructure/virtual_machines.py b/cfme/infrastructure/virtual_machines.py index 6a90e427ef..fea5723021 100644 --- a/cfme/infrastructure/virtual_machines.py +++ b/cfme/infrastructure/virtual_machines.py @@ -333,7 +333,6 @@ class InfraVmContainerView(VMDetailsEntities): @property def is_displayed(self): return self.basic_information.is_displayed and self.device.is_displayed - # does above work?? There is no is_displayed for SummaryTable? class InfraVmDetailsView(InfraVmView): diff --git a/cfme/tests/infrastructure/test_snapshot.py b/cfme/tests/infrastructure/test_snapshot.py index ebe9d3b22d..a8696c6893 100644 --- a/cfme/tests/infrastructure/test_snapshot.py +++ b/cfme/tests/infrastructure/test_snapshot.py @@ -252,14 +252,13 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event 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) - # We could put this in verify_revert_snapshot, but we just had a discussion about putting the - # validation in the test case? # verify that the system info is displayed view = navigate_to(create_vm, 'Details') - # we can check here that the OS in in the field. + # 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 From ab6dc858ad9663fb43c527e2fc6197fa6dfbed0d Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Thu, 18 Jun 2020 08:37:54 -0400 Subject: [PATCH 6/9] Remove more comments --- cfme/infrastructure/virtual_machines.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cfme/infrastructure/virtual_machines.py b/cfme/infrastructure/virtual_machines.py index fea5723021..a48b629423 100644 --- a/cfme/infrastructure/virtual_machines.py +++ b/cfme/infrastructure/virtual_machines.py @@ -458,13 +458,6 @@ class InfraVmOsView(InfraVmView): title = Text('#explorer_title_text') basic_information = SummaryTable(title="Basic Information") - ''' - This looks suspect. - @property - def is_displayed(self): - return self.basic_information.is_displayed - ''' - @property def is_displayed(self): expected_title = '"OS Info" for Virtual Machine "{}"'.format(self.context['object'].name) From b6f2bfe0bce91e12bc02acca277a3165a14cf8b9 Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Fri, 19 Jun 2020 13:24:13 -0400 Subject: [PATCH 7/9] Update format of expected_title --- cfme/infrastructure/virtual_machines.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cfme/infrastructure/virtual_machines.py b/cfme/infrastructure/virtual_machines.py index a48b629423..03a940f4f5 100644 --- a/cfme/infrastructure/virtual_machines.py +++ b/cfme/infrastructure/virtual_machines.py @@ -460,7 +460,8 @@ class InfraVmOsView(InfraVmView): @property def is_displayed(self): - expected_title = '"OS Info" for Virtual Machine "{}"'.format(self.context['object'].name) + 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 From e0fb658230724b2a3e7985d07d236dfde7927271 Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Fri, 19 Jun 2020 13:46:50 -0400 Subject: [PATCH 8/9] Remove blocker marker and add one to use only vsphere providers --- cfme/tests/infrastructure/test_snapshot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cfme/tests/infrastructure/test_snapshot.py b/cfme/tests/infrastructure/test_snapshot.py index a8696c6893..2ae2baa87a 100644 --- a/cfme/tests/infrastructure/test_snapshot.py +++ b/cfme/tests/infrastructure/test_snapshot.py @@ -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]) @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 @@ -241,7 +240,7 @@ def test_verify_revert_snapshot(create_vm, provider, soft_assert, register_event test_flag: snapshot, provision Bugzilla: - 1561618 + 1805803 Polarion: assignee: prichard From 35d751eb5f0d361a53468038ed3a90f37c0e322c Mon Sep 17 00:00:00 2001 From: PJ Richardson Date: Tue, 23 Jun 2020 12:12:54 -0400 Subject: [PATCH 9/9] Update marker for test_verify_revert_snapshot --- cfme/tests/infrastructure/test_snapshot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfme/tests/infrastructure/test_snapshot.py b/cfme/tests/infrastructure/test_snapshot.py index 2ae2baa87a..e32f89a69e 100644 --- a/cfme/tests/infrastructure/test_snapshot.py +++ b/cfme/tests/infrastructure/test_snapshot.py @@ -228,8 +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.rhv1 -@pytest.mark.provider([VMwareProvider]) +@pytest.mark.uncollectif(lambda provider: provider.one_of(RHEVMProvider), + reason="RHV providers blocked for BZ 1805803 marked WONTFIX") @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