Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Write and automate test cases for creating + reading cloud accounts #13

Closed
5 tasks
kdelee opened this issue May 14, 2018 · 2 comments
Closed
5 tasks

Write and automate test cases for creating + reading cloud accounts #13

kdelee opened this issue May 14, 2018 · 2 comments
Assignees
Labels
api Related to API test cases test case

Comments

@kdelee
Copy link
Contributor

kdelee commented May 14, 2018

We need to write all the test cases for the api/v1/account/ endpoint.

These are the "cloud accounts" associated with the account logged in for regular users, or ALL accounts for all accounts for superusers.

These include:

Happy path -- regular user

See comment by cloudigrade/cloudigrade#237 (comment)
Set up: Create a regular user + get token and configure client to authenticate with regular user's token

  • Verify that as the user (using their token), I can create an account by sending POST to api/v1/account/ with resourcetype (only valid value is AwsAccount) and account_arn
    • ARN must be from valid role that permits the cloudigrade server account access)
  • Verify that as the user, I can request a list of my accounts, and that it only includes my accounts
    • should create mutliple users and create accounts for all accounts for this test
      As the user, I can update the name of my accounts (dependent on API to set custom display name for account cloudigrade#267)
      As the user, I can update the account_arn (?) check with devs. Seems necessary because what if user borks the creation -- and we are not allowing deletion!?
      ~~ As the user, I can update the resourcetype (? not really critical right now because we only have one resourcetype but will be important if future types come into play.~~

Happy path -- super user

  • Verify that I can do all the above, except I can also read other users accounts as well as my own.

Negative/edge cases -- regular user

  • Verify that I cannot create cloud accounts missing resourcetype and/or account_arn
    Make accounts with a one account and attempt to update them with another by account id
  • Verify that I cannot delete cloud accounts by sending DELETE to the account URI
    Attempt to create new account with identical ARN (?) need to research if there is any requirement of uniqueness. Would usage not get double counted because of downstream processing? duplicates not allowed globally

Negative/edge cases -- super user

  • same except super user can update any account (?)
@kdelee kdelee changed the title Stub out test cases for "CRU"ing accounts Stub out test cases for "CRU"ing cloud accounts May 15, 2018
@kdelee kdelee changed the title Stub out test cases for "CRU"ing cloud accounts Write and automate test cases for "CRU"ing cloud accounts May 15, 2018
@kdelee
Copy link
Contributor Author

kdelee commented May 15, 2018

@cloudigrade/engineering Can someone look at this issue and provide some feedback on a few points we have questions on? They have (?) next to them in the issue.

@infinitewarp infinitewarp added this to the sprint 2018-05-16 milestone May 16, 2018
@noahl noahl self-assigned this May 22, 2018
@elyezer elyezer assigned elyezer and unassigned noahl May 31, 2018
@elyezer elyezer added the api Related to API test cases label May 31, 2018
@kdelee kdelee assigned kdelee and unassigned elyezer Jun 4, 2018
@kdelee kdelee changed the title Write and automate test cases for "CRU"ing cloud accounts Write and automate test cases for creating + reading cloud accounts Jun 7, 2018
@kdelee
Copy link
Contributor Author

kdelee commented Jun 7, 2018

I updated this issue to extract items blocked by features that don't exist yet. Those items are now in #27

@kdelee kdelee closed this as completed Jun 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api Related to API test cases test case
Projects
None yet
Development

No branches or pull requests

4 participants