api.v1.test_instances_report¶
Tests for instances reports.
caseautomation: | automated |
---|---|
casecomponent: | api |
caseimportance: | high |
caselevel: | integration |
requirement: | Cloud Meter |
testtype: | functional |
upstream: | yes |
-
integrade.tests.api.v1.test_instances_report.
hour2sec
(h)¶ Convert hours to seconds.
-
integrade.tests.api.v1.test_instances_report.
instances_report_data
()¶ Create instance usage data for the instance report tests.
Create two cloud accounts and create some instance data for each of them.
-
integrade.tests.api.v1.test_instances_report.
test_another_users_instances_report
(instances_report_data)¶ Test that a regular can’t retrieve another regular user’s instances report.
Id: abc19456-327d-4707-b8d6-7a99a6151c1e
Description: Test that a regular user can’t retrieve a regular user’s instances report.
Steps: - Create two regular users
- Add a cloud account for each user.
- Add some instance usage data for one of the regular users, using the following images: blank, RHEL, OpenShift and RHEL + OpenShift
- As the regular user that does not have the usage data, generate its instances report and ensure it is blank.
- As the regular user that does not have the usage data, try to impersonate the other regular user and generate an instances report.
- Ensure that a regular user can’t impersonate another regular user and retrieve their instances report. And its own instances report will be returned.
Expectedresults: An instances report cannot be generated by a regular impersonating another regular user. A regular user will always retrieve its own instances report, even when trying to impersonate another regular user.
-
integrade.tests.api.v1.test_instances_report.
test_instances_report
(instances_report_data)¶ Test that instances report provides expected results.
Id: 7dd5ac11-7429-4030-9996-dbf3684f39e1
Description: Test that regular users can retrieve their own instances report.
Steps: - Add a cloud account for a regular user
- Add some instance usage data for the following images: blank, RHEL, OpenShift and RHEL + OpenShift
- Generate an instances report for a given period.
- Ensure the report only shows information about the usage on the given period.
Expectedresults: An instances report can be generated and the information provided is accurate.
-
integrade.tests.api.v1.test_instances_report.
test_superuser_instances_report
(instances_report_data)¶ Test that a superuser can retrieves a regular user’s instances report.
Id: d222617b-9304-4081-9b95-f1a193412b6e
Description: Test that a superuser can retrieve a regular user’s instances report.
Steps: - Add a cloud account for a regular user
- Add some instance usage data for the following images: blank, RHEL, OpenShift and RHEL + OpenShift
- As a superuser, generate an instances report for a given period providing a regular user ID.
- Ensure the report only shows information about the usage on the given period.
Expectedresults: An instances report can be generated by a superuser impersonating a regular user and the information provided is accurate.