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

[WIP] Adding test coverage #9085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
60 changes: 27 additions & 33 deletions cfme/tests/cloud/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,6 @@
from cfme.cloud.provider.openstack import OpenStackProvider


@pytest.mark.manual
@pytest.mark.provider([OpenStackProvider])
@test_requirements.snapshot
@pytest.mark.tier(1)
def test_osp_snapshot_buttons():
"""
Test new OSP snapshot button and make sure Snapshot link is removed from Instance Details
page.

Polarion:
assignee: apagac
casecomponent: Cloud
caseimportance: medium
initialEstimate: 1/4h
startsin: 5.10
setup:
1. Have OSP provider added and test instance created
testSteps:
1. Navigate to test instance
2. Make sure the snapshot button is displayed in the top menu
3. Try snapshot crud
4. Navigate to instance summary screen; Check if the original Snapshot link is present
expectedResults:
1. Test instance summary page displayed
2. Snapshot button displayed
3. Snapshot created; Snapshot deleted
4. Snapshot link is not displayed
Bugzilla:
1690954
"""
pass


@pytest.mark.manual
@pytest.mark.provider([OpenStackProvider])
@test_requirements.snapshot
Expand Down Expand Up @@ -165,3 +132,30 @@ def test_snapshot_cloud_tenant():
1685300
"""
pass


@pytest.mark.manual
@pytest.mark.provider([OpenStackProvider])
@test_requirements.snapshot
Copy link
Contributor

Choose a reason for hiding this comment

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

All tests in this module have the same requirement, so please put it for the whole module

pytestmark = [test_requirements.snapshot]

Copy link
Contributor

Choose a reason for hiding this comment

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

@lina-nikiforova some have rbac and auth

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh but they are different files, please ignore above 🤦‍♂️

@pytest.mark.tier(2)
def test_snapshot_description_mandatory():
"""
Test that when creating snapshots on Openstack provider the Description field is mandatory.

Polarion:
assignee: apagac
casecomponent: Cloud
caseimportance: high
initialEstimate: 1/4h
setup:
1. Have OSP provider added and test VM created
testSteps:
1. Try to create a snapshot with no description
2. Try to create a snapshot with description
expectedResults:
1. Snapshot not created; 'Required' displayed
2. Snapshot created successfully
Bugzilla:
1647916
Copy link
Contributor

Choose a reason for hiding this comment

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

@apagac since you are putting in the BZ metadata, can you also add it to the top of the file?
@pytest.mark.meta(coverage=[<bug_id>])

Copy link
Contributor

@lina-is-here lina-is-here Aug 30, 2019

Choose a reason for hiding this comment

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

and the same for other tests

"""
pass
139 changes: 139 additions & 0 deletions cfme/tests/configure/test_access_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -2674,3 +2674,142 @@ def test_tenant_template_visibility():
initialEstimate: 1/10h
"""
pass


@pytest.mark.manual
@test_requirements.rbac
Copy link
Contributor

Choose a reason for hiding this comment

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

same here for the requirements, I think it's better to define at the module level

@pytest.mark.tier(2)
def test_create_higher_permission_child_tenant():
"""
Test creating a group with higher permission that the user currently has on a new tenant.

Polarion:
assignee: apagac
casecomponent: Configuration
caseimportance: medium
initialEstimate: 1/4h
testSteps:
1. Create child tenant: "My tenant"
2. Create group with:
- "My Tenant admin group" with role: "EvmRole-tenant_administrator"
- Tenant: "My tenant"
3. Create tenant admin user "tenantadmin" with group "My Tenant admin group"
4. login as tenant admin
5. Try to create group with EvmRole-super_administrator
expectedResults:
1.
2.
3.
4.
5. EvmRole-super_administrator should not be available
Bugzilla:
1418297
"""
pass


@pytest.mark.manual
@test_requirements.rbac
@pytest.mark.tier(2)
def test_create_higher_permission():
"""
Test creating a group with higher permission that the user currently has.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it the correct description? I don't see group creation in the test steps...


Polarion:
assignee: apagac
casecomponent: Configuration
caseimportance: medium
initialEstimate: 1/4h
testSteps:
1. Create user with tenant_administrator role
2. Log in as that user
3. Go to Users
expectedResults:
1.
2.
3. Users without super-administator role and administator role visible
Bugzilla:
1447370
"""
pass


@pytest.mark.manual
@test_requirements.rbac
@pytest.mark.tier(2)
def test_multiple_notifications():
"""
Test that user that is a member of multiple groups receives only one notification.

Polarion:
assignee: apagac
casecomponent: Configuration
caseimportance: medium
initialEstimate: 1/4h
testSteps:
1. Create a user, assign him to multiple groups
2. As the user, provision a VM
expectedResults:
1.
2. Only one notification displayed upon successfull provision
Bugzilla:
1549898
"""
pass


@pytest.mark.manual
@test_requirements.rbac
@pytest.mark.tier(2)
def test_cluster_filters():
"""
Test that filters work even when deleting the item they were in place for.

Polarion:
assignee: apagac
casecomponent: Configuration
caseimportance: medium
initialEstimate: 1/4h
setup:
1. Have a provider with multiple Datastores and Clusters.
2. Assume you have Datastore1 with Cluster1 and Datastore2 with Cluster2
testSteps:
1. Create a role and group with the filters for only Cluster1
2. Create a user with this group
3. Login and verify that you can see only Cluster1
4. Delete Datastore1 (with Cluster1)
5. Verify the user now can't see any cluster
expectedResults:
1.
2.
3. User can see only Cluster1
4.
5. User can't see any Cluster
Bugzilla:
1693183
"""
pass


@pytest.mark.manual
@test_requirements.rbac
@pytest.mark.tier(2)
def test_delete_custom_super_admin():
"""
Test that custom user with super_administrator group can be deleted.

Polarion:
assignee: apagac
casecomponent: Configuration
caseimportance: medium
initialEstimate: 1/4h
testSteps:
1. Create a new user with group EvmGroup-super_administrator
2. Try to delete this user
expectedResults:
1.
2. User successfully deleted
Bugzilla:
1720273
"""
pass
69 changes: 69 additions & 0 deletions cfme/tests/integration/test_cfme_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,3 +1535,72 @@ def test_session_timeout():
title: Verify session timeout works fine for external auth.
"""
pass


@pytest.mark.manual
@test_requirements.auth
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for the requirements as above

@pytest.mark.tier(2)
def test_certmonger_service():
"""
Test that the certmonger service is running after SSL certs have been setup and appliance
rebooted.

Polarion:
assignee: apagac
casecomponent: Configuration
caseimportance: medium
initialEstimate: 1/4h
setup:
1. Have IDM (freeipa) server up and running
testSteps:
1. Configure appliance to use external auth via IDM server:
appliance_console_cli \
--ipaserver=<IPA_HOSTNAME> \
--ipaprincipal=<IPA_PRINCIPAL> \
--ipapassword=<IPA_PASSWD>
2. Setup SSL certs on the appliance:
appliance_console_cli \
--ca=ipa \
--http-cert
3. Reboot the appliance
4. View status of the certmonger service:
systemctl status certmonger
expectedResults:
1. Appliance configured.
2. Certs installed
3. Appliance rebooted
4. certmonger service running
Bugzilla:
1670604
"""
pass


@pytest.mark.manual
@test_requirements.auth
@pytest.mark.tier(2)
def test_group_lookup_oidc():
"""
Test that group lookup is disabled when using OpenID-Connect.

Polarion:
assignee: apagac
casecomponent: Configuration
caseimportance: medium
initialEstimate: 1/4h
testSteps:
1. Configure your appliance to use External auth:
Configuration -> Settings -> select Current Server -> Authentication -> Mode
-> set to External
2. On the same page, choose Provider Type: Enable OpenID-Connect
3. Navigate to Configuration -> Access Control -> Create a new Group
4. Ensure the "(Look up External Authentication Groups)" checkbox is not displayed
expectedResults:
1. Appliance configured
2. OIDC enabled
3.
4. Checkbox not displayed
Bugzilla:
1609321
"""
pass