diff --git a/cfme/infrastructure/datastore.py b/cfme/infrastructure/datastore.py index e418442eeb..f6a4fe53fd 100644 --- a/cfme/infrastructure/datastore.py +++ b/cfme/infrastructure/datastore.py @@ -17,6 +17,7 @@ from cfme.exceptions import displayed_not_implemented from cfme.exceptions import ItemNotFound from cfme.exceptions import MenuItemNotFound +from cfme.infrastructure.virtual_machines import VmsTemplatesAllView from cfme.modeling.base import BaseCollection from cfme.modeling.base import BaseEntity from cfme.utils import ParamClassName @@ -128,6 +129,19 @@ def is_displayed(self): ) +class DatastoreManagedVMsView(VmsTemplatesAllView): + """ + This view represents All VMs and Templates page for datastores + """ + + @property + def is_displayed(self): + return ( + self.logged_in_as_current_user and + self.entities.title.text == f'{self.context["object"].name} (All VMs and Instances)' + ) + + class DatastoreDetailsView(BaseLoggedInPage): """ represents Datastore Details page @@ -448,3 +462,12 @@ class Utilization(CFMENavigateStep): def step(self, *args, **kwargs): self.prerequisite_view.toolbar.monitoring.item_select("Utilization") + + +@navigator.register(Datastore) +class ManagedVMs(CFMENavigateStep): + VIEW = DatastoreManagedVMsView + prerequisite = NavigateToSibling("Details") + + def step(self, *args, **kwargs): + self.prerequisite_view.entities.relationships.click_at('Managed VMs') diff --git a/cfme/tests/automate/test_automate_manual.py b/cfme/tests/automate/test_automate_manual.py index 11f83e5d5b..cbc9c94b37 100644 --- a/cfme/tests/automate/test_automate_manual.py +++ b/cfme/tests/automate/test_automate_manual.py @@ -277,27 +277,6 @@ def test_vm_naming_number_padding(): pass -@pytest.mark.tier(1) -@pytest.mark.ignore_stream("5.10") -def test_vm_name_automate_method(): - """This test case will check redesign of vm_name automated method - - Polarion: - assignee: ghubale - initialEstimate: 1/8h - caseimportance: high - caseposneg: positive - testtype: functional - startsin: 5.11 - casecomponent: Automate - tags: automate - - Bugzilla: - 1677573 - """ - pass - - @pytest.mark.tier(1) def test_git_refresh_with_renamed_yaml(): """ diff --git a/cfme/tests/cloud_infra_common/test_power_control_manual.py b/cfme/tests/cloud_infra_common/test_power_control_manual.py index 4b7874853b..ae46083616 100644 --- a/cfme/tests/cloud_infra_common/test_power_control_manual.py +++ b/cfme/tests/cloud_infra_common/test_power_control_manual.py @@ -290,32 +290,6 @@ def test_check_compliance_policy_option_on_vm_summery_page(): pass -@pytest.mark.tier(2) -@pytest.mark.ignore_stream("5.10") -def test_power_states_with_respective_provider(): - """ - Polarion: - assignee: ghubale - initialEstimate: 1/12h - caseimportance: medium - caseposneg: positive - testtype: functional - startsin: 5.11 - casecomponent: Control - tags: power - testSteps: - 1. Provision Azure Instance - 2. In Instance detail page, select Resume from Lifecycle menu - expectedResults: - 1. - 2. Should not have Resume button there or disable button upon provider - - Bugzilla: - 1541447 - """ - pass - - @pytest.mark.tier(2) @pytest.mark.meta(coverage=[1740285]) def test_power_operations_on_paused_provider(): diff --git a/cfme/tests/cloud_infra_common/test_relationships.py b/cfme/tests/cloud_infra_common/test_relationships.py index d7a53c94f3..db635da06a 100644 --- a/cfme/tests/cloud_infra_common/test_relationships.py +++ b/cfme/tests/cloud_infra_common/test_relationships.py @@ -23,6 +23,7 @@ from cfme.infrastructure.datastore import HostAllDatastoresView from cfme.infrastructure.datastore import ProviderAllDatastoresView from cfme.infrastructure.provider import InfraProvider +from cfme.infrastructure.provider.rhevm import RHEVMProvider from cfme.infrastructure.provider.virtualcenter import VMwareProvider from cfme.infrastructure.virtual_machines import HostTemplatesOnlyAllView from cfme.infrastructure.virtual_machines import ProviderTemplatesOnlyAllView @@ -34,8 +35,11 @@ from cfme.storage.manager import ProviderStorageManagerAllView from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.blockers import BZ +from cfme.utils.generators import random_vm_name +from cfme.utils.log import logger from cfme.utils.log_validator import LogValidator + HOST_RELATIONSHIPS = [ ("Infrastructure Provider", InfraProviderDetailsView), ("Cluster", ClusterDetailsView), @@ -402,12 +406,28 @@ def test_change_network_security_groups_per_page_items(): pass +@pytest.fixture(scope="function") +def testing_vm(appliance, provider): + """Fixture to provision vm""" + vm_name = random_vm_name('pwr-c') + vm = appliance.collections.infra_vms.instantiate(vm_name, provider) + + if not provider.mgmt.does_vm_exist(vm.name): + logger.info("deploying %s on provider %s", vm.name, provider.key) + vm.create_on_provider(allow_skip="default", find_in_cfme=True) + yield vm + vm.cleanup_on_provider() + + @test_requirements.relationships -@pytest.mark.manual @pytest.mark.tier(1) -@pytest.mark.meta(coverage=[1729953]) -def test_datastore_relationships(): +@pytest.mark.meta(automates=[1729953], blockers=[BZ(1729953)]) +@pytest.mark.provider([RHEVMProvider], selector=ONE) +def test_datastore_relationships(setup_provider, testing_vm): """ + Bugzilla: + 1729953 + Polarion: assignee: ghubale casecomponent: Infra @@ -428,11 +448,26 @@ def test_datastore_relationships(): 1. 2. 3. Operations should be performed successfully. It should not give unexpected error. - - Bugzilla: - 1729953 """ - pass + view = navigate_to(testing_vm.datastore, "ManagedVMs") + view.entities.get_entity(name=testing_vm.name).check() + + view.toolbar.configuration.item_select("Refresh Relationships and Power States", + handle_alert=True) + view.flash.assert_success_message( + "Refresh Provider initiated for 1 VM and Instance from the CFME Database" + ) + view.flash.dismiss() + + view.toolbar.configuration.item_select('Perform SmartState Analysis', + handle_alert=True) + view.flash.assert_success_message( + "Analysis initiated for 1 VM and Instance from the CFME Database" + ) + view.flash.dismiss() + + view.toolbar.configuration.item_select('Extract Running Processes', handle_alert=True) + view.flash.assert_no_error() @test_requirements.relationships