From de0a9ec1bb2a096a75dc75f92d7cdb3e0d7fe88d Mon Sep 17 00:00:00 2001 From: Ganesh Hubale Date: Tue, 24 Sep 2019 15:26:35 +0530 Subject: [PATCH] Added test coverage --- cfme/tests/automate/test_automate_manual.py | 245 ++++++++++++++++++ cfme/tests/automate/test_service_automate.py | 50 ++++ .../test_power_control_manual.py | 57 ++++ 3 files changed, 352 insertions(+) diff --git a/cfme/tests/automate/test_automate_manual.py b/cfme/tests/automate/test_automate_manual.py index dd5ff2af41..a2651f31fc 100644 --- a/cfme/tests/automate/test_automate_manual.py +++ b/cfme/tests/automate/test_automate_manual.py @@ -767,3 +767,248 @@ def test_variable_pass_method_playbook(): 1678132 """ pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1753860]) +def test_overwrite_import_domain(): + """ + Bugzilla: + 1753860 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Create custom domain, namespace, class, instance, method. Do not delete this domain. + 2. Navigate to automation > automate > import/export and export all classes and + instances to a file + 3. Extract the file and update __domain__.yaml file of custom domain as below: + >> description: test_desc + >> enabled: false + 4. Compress this domain file and import it via UI. + expectedResults: + 1. + 2. + 3. + 4. Description and enabled status of existing domain should update. + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1753586]) +@pytest.mark.customer_scenario +def test_crud_imported_domains(): + """ + Bugzilla: + 1753586 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Export the appliance domain as a zip file + 2. Extracted the ManageIQ directory to a new dir on the local machine called + Domain_Test02 + 3. From within the new Domain_Test02 dir, edit the __domain__.yaml file so that the + 'name' attribute equals Domain_Test02 + NOTE: Do not change the 'source' attribute from 'system' to 'user' this time. + 4. Archived the new Domain_Test02 dir and upload to CloudForms Appliance + expectedResults: + 1. + 2. + 3. + 4. The imported domains should be Custom Domains or these imported domains should gets + deleted from db + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1753523]) +def test_attribute_value_message(): + """ + Bugzilla: + 1753523 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Create domain, namespace, class and instance pointing to method + 2. Navigate to automate > automation > simulation page + 3. Fill values for attribute/value pairs of namespace, class, instance and add message + attribute with any value and click on submit. + 4. See automation.log + expectedResults: + 1. + 2. + 3. + 4. Custom message attribute should be considered with instance in logs + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1752875]) +def test_existing_domain_child_override(): + """ + PR: + https://github.com/ManageIQ/manageiq-ui-classic/pull/4912 + + Bugzilla: + 1752875 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Create custom domain and copy class - "ManageIQ/System/Request" + 2. Lock this domain + 3. Navigate to Automation > automate > Import/export and click on "export all classes + and instances to file" + 4. Go to custom domain and unlock it. Remove instance - "ManageIQ/System/Request/" and + copy - "ManageIQ/System/Process/Request" (you can copy more classes or methods or + instances) to custom domain and again lock the domain. + 5. Go to import/export page and click on 'choose file'. Select exported file and click + on upload + 6. Select "Select domain you wish to import from:" - "custom_domain" and check Toggle + All/None + 7. Click on commit button. + 8. Then navigate to custom domain and unlock it + 9. Perform step 5, 6 and 7(In this case, domain will get imported) + 10. Go to custom domain + expectedResults: + 1. + 2. + 3. Datastores exported on local system in zip format + 4. + 5. + 6. + 7. You should see flash message: "Error: Selected domain is locked" + 8. + 9. Selected domain imported successfully + 10. You should see existing as well as imported namespace, class, instance or method + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1743227]) +def test_queue_up_schedule_run_now(): + """ + Bugzilla: + 1743227 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Navigate to configuration > Settings > Schedules > Select "Add a new schedule" + 2. Fill the name, description then select Action - "Automation task" + 3. Select time options + 4. Click on add button + 5. Click on created schedule and select option - "Queue up this schedule to run now" + 6. See automation logs + expectedResults: + 1. + 2. + 3. + 4. + 5. Schedule should run forcefully + 6. Task related automation logs should generate + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1741259]) +def test_copy_automate_method_without_edit(): + """ + Bugzilla: + 1741259 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Navigate to Automation > Automate > Explorer + 2. Select a method from the datastore + 3. Try to copy and paste some code from the method without entering the edit mode + expectedResults: + 1. + 2. + 3. You should be able to copy the highlighted text + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1747159]) +def test_retire_vm_automate(): + """ + Bugzilla: + 1747159 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + setup: + 1. Add infrastructure provider + 2. Provision VM + testSteps: + 1. Create custom domain, namespace, class, instance pointing to automate method + 2. Add vm retire ruby code to automate method + 3. Execute this method via simulation + expectedResults: + 1. + 2. + 3. VM should retire + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1672007]) +def test_invoke_custom_automation(): + """ + Bugzilla: + 1672007 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Navigate to Control > explorer > actions + 2. Select 'add a new action' from configuration dropdown + 3. Add description and select 'Action Type' - Invoke custom automation + 4. Fill attribute value pairs and click on save + 5. Edit the created action and add new attribute value pair + 6. Remove that newly added attribute value pair before clicking on save and then click + on save + expectedResults: + 1. + 2. + 3. + 4. + 5. Save button should enable + 6. Action should be saved successfully + """ + pass diff --git a/cfme/tests/automate/test_service_automate.py b/cfme/tests/automate/test_service_automate.py index 08f2fe7da6..874f707a95 100644 --- a/cfme/tests/automate/test_service_automate.py +++ b/cfme/tests/automate/test_service_automate.py @@ -348,3 +348,53 @@ def test_passing_value_between_catalog_items(request, appliance, catalog_item_se provision_request.wait_for_request(method='ui') request.addfinalizer(provision_request.remove_request) assert provision_request.is_succeeded(method="ui") + + +@pytest.mark.manual +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1748353]) +def test_service_retire_automate(): + """ + Bugzilla: + 1748353 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. Create email retirement method & add it to automate + 2. Provision service with a retirement date + 3. Reach retirement date + 4. See automation logs + expectedResults: + 1. + 2. + 3. + 4. The retirement should not run multiple times at the same time + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1740796]) +def test_import_dialog_file_without_selecting_file(): + """ + Bugzilla: + 1740796 + + Polarion: + assignee: nansari + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Automate + testSteps: + 1. "Automation-->Automate--> Customization-->Import/Export--> Click export without a + service dialog selected. + 2. Exit this screen and edit a service dialog and save + expectedResults: + 1. Flash message: "At least 1 item must be selected for export" + 2. Error flash message should not appear + """ + pass 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 cc1cfd6a85..0e69021b3c 100644 --- a/cfme/tests/cloud_infra_common/test_power_control_manual.py +++ b/cfme/tests/cloud_infra_common/test_power_control_manual.py @@ -374,3 +374,60 @@ def test_orphaned_instance_status(): 1701188 """ pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1740285]) +def test_power_operations_on_paused_provider(): + """ + Bugzilla: + 1740285 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Infra + setup: + 1. Add infrastructure provider - RHV + testSteps: + 1. Pause a provider (RHV) + 2. Navigate to its VMs and power one VM on + 3. Go to tasks: Task has been queued + 4. Resume the provider, wait for the refresh to finish + 5. Go to tasks again, it will be in "Queued" state forever. + expectedResults: + 1. + 2. + 3. + 4. + 5. Power operations to be disabled on paused provider in the first place. If it's + possible to queue them, then it should be resumed when provider is resumed. + """ + pass + + +@pytest.mark.tier(2) +@pytest.mark.meta(coverage=[1704221]) +def test_suspend_action_on_off_vm(): + """ + Bugzilla: + 1704221 + + Polarion: + assignee: ghubale + initialEstimate: 1/8h + caseposneg: positive + casecomponent: Services + testSteps: + 1. Have a service that provisions a VM. Shut it down so the VM enters Powered OFF state. + 2. In SSUI, check different ways to manipulate with VM power: + - from My Services page + - from service details page + - from VM details page - here is the Suspend action disabled, which is correct + expectedResults: + 1. + 2. Suspend action should be disabled for powered off VMs, as seen in VM details page in + SSUI + """ + pass