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

[1LP][RFR] Automating service bundle and vm retire test #10003

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions cfme/tests/services/test_dialog_element_in_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,36 +840,6 @@ def test_service_bundle_vms():
pass


@pytest.mark.meta(coverage=[1660637])
@pytest.mark.manual
@pytest.mark.tier(2)
def test_service_service_vms_retires_archived():
"""

Bugzilla:
1660637

Polarion:
assignee: nansari
startsin: 5.10
casecomponent: Services
initialEstimate: 1/6h
testSteps:
1. Create service which will provision a VM
2. Navigate to order page of service
3. Order the Service bundle.
4. Navigate to My service page
5. Retire the service
expectedResults:
1.
2.
3.
4.
5. Service should retire the VMs as well and Vm should archive
"""
pass


@pytest.mark.meta(automates=[1558926])
@pytest.mark.tier(2)
@pytest.mark.parametrize(
Expand Down
83 changes: 83 additions & 0 deletions cfme/tests/services/test_myservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,86 @@ def test_load_service_with_button(request, appliance, generic_service, import_di
custom_button_group = Dropdown(view, button_gp.text)
assert custom_button_group.is_displayed
custom_button_group.item_select(button.text)


@pytest.mark.meta(automate=[1660637])
@pytest.mark.customer_scenario
def test_retire_service_bundle_and_vms(appliance, provider, catalog_item, request):
"""
Bugzilla:
1660637

Polarion:
assignee: nansari
startsin: 5.10
casecomponent: Services
initialEstimate: 1/6h
testSteps:
1. Create service catalog item
2. Create bundle with above catalog item
3. Order the Service bundle
4. Navigate to my service
5. Retire the service
expectedResults:
1.
2.
3.
4.
5. the service should be retired and VM should be retired and archived
"""
collection = provider.appliance.provider_based_collection(provider)
vm_name = "{}0001".format(catalog_item.prov_data["catalog"]["vm_name"])
Copy link
Member

Choose a reason for hiding this comment

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

Please consider using f-strings consistently for future contributions - there's a mix here, but we're not enforcing its use at this time, so I'm not going to block the merge.

vm = collection.instantiate("{}".format(vm_name), provider)

bundle_name = fauxfactory.gen_alphanumeric(12, start="bundle_")
catalog_bundle = appliance.collections.catalog_bundles.create(
bundle_name,
description="catalog_bundle",
display_in=True,
catalog=catalog_item.catalog,
dialog=catalog_item.dialog,
catalog_items=[catalog_item.name]
)
request.addfinalizer(catalog_bundle.delete_if_exists)

# Ordering service catalog bundle
service_catalogs = ServiceCatalogs(
appliance, catalog_bundle.catalog, catalog_bundle.name
)
service_catalogs.order()

request_description = (
f'Provisioning Service [{catalog_bundle.name}] from [{catalog_bundle.name}]'
)
provision_request = appliance.collections.requests.instantiate(request_description)
provision_request.wait_for_request(method='ui')
provision_request.is_succeeded(method="ui")
service = MyService(appliance, catalog_item.dialog.label)

@request.addfinalizer
def _clear_request_service():
if provision_request.exists():
provision_request.remove_request(method="rest")
if service.exists:
service.delete()

assert service.exists

# Retire service
retire_request = service.retire()
assert retire_request.exists()

@request.addfinalizer
def _clear_retire_request():
if retire_request.exists():
retire_request.remove_request()

wait_for(
lambda: service.is_retired,
delay=5, num_sec=120,
fail_func=service.browser.refresh,
message="waiting for service retire"
)

# Vm should be archived
assert vm.wait_for_vm_state_change(from_any_provider=True, desired_state='archived')
18 changes: 0 additions & 18 deletions cfme/tests/services/test_service_catalog_dialog_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@ def test_email_should_be_sent_when_service_approval_is_set_to_manual():
pass


@pytest.mark.manual
@pytest.mark.tier(2)
def test_role_configured_with_the_option_only_user_or_group_owned_should_allow_to_access_to_se():
""" Role configured with the option "only user or group owned
should allow to access to service catalogs and items
Polarion:
assignee: nansari
casecomponent: Services
testtype: functional
initialEstimate: 1/4h
startsin: 5.9
tags: service
Bugzilla:
1554775
"""
pass


@pytest.mark.manual
@pytest.mark.tier(2)
def test_notification_banner_vm_provisioning_notification_and_service_request_should_be_in_syn():
Expand Down