api.v1.test_images_report¶
Test account report summary API.
caseautomation: | automated |
---|---|
casecomponent: | api |
caseimportance: | high |
caselevel: | integration |
requirement: | Cloud Meter |
testtype: | functional |
upstream: | yes |
-
integrade.tests.api.v1.test_images_report.
test_flagged_account_numbers
()¶ Test the number of flagged images in accounts.
Id: BBD687F5-0B78-4E86-8368-C5C8EEBD9263 Description: Test that the number of images reported as flagged matches the flagged/challenged images in accounts.
Steps: - Add a cloud account
- Insert RHEL and RHOCP image
- Check number of challenged/flagged RHEL/RHOCP images
- Challenge images
- Check number of challenged/flagged RHEL/RHOCP images
Expectedresults: - Challenged RHEL images = 0 when none are challenged
- Challenged RHEL images > 0 when one or more are challenged
- Challenged RHOCP images = 0 when none are challenged
- Challenged RHOCP images > 0 when one or more are challenged
-
integrade.tests.api.v1.test_images_report.
test_image_report_empty
()¶ Test accounts without any instance or image report has empty summary.
Id: 2a152ef6-fcd8-491c-b3cc-bda81699453a
Description: Test that an account without any instances or images shows up in the results with 0 counts.
Steps: - Add a cloud account
- GET from the image report endpoint
Expectedresults: - An empty list is returned
-
integrade.tests.api.v1.test_images_report.
test_image_tagging
(conf)¶ Test instance events generate image usage results with correct tags.
Id: f3c84697-a40c-40d9-846d-117e2647e9d3
Description: Test combinations of image tags, start/end events, and the resulting counts from the summary report API.
Steps: - Add a cloud account
- Insert instance, image, and event data
- GET from the image report endpoint
Expectedresults: - The images have correct tags and usage amounts
-
integrade.tests.api.v1.test_images_report.
test_list_images_while_impersonating
(impersonate)¶ Test account data fetched via impersonating a user as a superuser.
Id: 5f99c7ec-a4d3-4040-868f-9340015e4c9c
Description: Test that the same assertions can be made for fetching data as a regular user and fetching data impersonating that same user
Steps: - Add a cloud account
- Insert instance, image, and event data
3) GET from the image report endpoint as regular user 3) GET from the image report endpoint as super user impersonating
Expectedresults: - The images are returned for the user and a super user, but
- no one else.
-
integrade.tests.api.v1.test_images_report.
test_past_without_instances
()¶ Test accounts with instances only after the filter period.
Id: 72aaa6e2-2c60-4e71-bb47-3644bd6beb71
Description: Test that an account with instances that were created prior to the current report end date.
Steps: - Add a cloud account
- Inject instance data for today
- GET from the account report endpoint for 30 days ago
Expectedresults: - The account is in the response and matches the created account
- Instances, images, RHEL, and Openshift all have None counts
-
integrade.tests.api.v1.test_images_report.
test_runtime_requests_from_future
()¶ Test future start and end times for empty set result.
Id: 133A04EE-55C3-4948-B2F9-D89A6A84C9FC
Description: Test events that start/end in the future ensuring that results are empty [].
Steps: - Add a cloud account
- Insert past instance, image, and event data
- Insert future instance, image, and event data
- GET from the image report endpoint
Expectedresults: - When start/end times are in the future OR when start>end
- expect runtine_seconds to be empty.