Managers to handle Tempest tenants and their resources
Each Tempest test expects 3 tenants - Admin, Primary, Alt. These either exist in pre-run and are logged in tempest.conf or created for each class by isolated_creds module.
Suggestion: Create a tenant-manager responsible for creation and management of these tenants and resources.
Each test can requested these tenant_resources from the tenant_manager instead of creating and managing them by itself, thus sharing both code and resources between tests.
Further development can have the tenant object create primary and alt tenants even in default mode (and not isolated_creds) thus eliminating the need to create these before tempest can be configured and executed
Resources include (but aren't limited to):
1. credentials
2. network (net, router, subnet)
3. security groups ("default" at the very least)
4. optional: clients with matching credentials
Optional
Have tests list the resources they require (possibly by decorator, or by creating resources lazily), to avoid creating unnecessary resources
Optional: make this manager generic enough to be used for tenant creation by any and all tests (except API of course), making it easier for tests that need to create and use more that 2 tenants
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Not
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Superseded
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Matthew Treinish
Related branches
Related bugs
Sprints
Whiteboard
YF: "Each test can requested these tenant_resources from the tenant_manager instead of creating and managing them by itself, thus sharing both code and resources between tests."
Actually, the purpose of the tenant isolation is specifically NOT to share resources between tests, due to the need to parallelize test operations.
I agree that having the base test classes manage test user/tenant/role creation is not pretty, though. I proposed solving this issue using the fixtures library a while back:
https:/
Feel free to look in there for some ideas :)
Best,
-jay
JP: "the purpose of the tenant isolation is specifically NOT to share resources between tests"
I meant that resources (network, VM) can be shared, or at least - accessed, between testcases in the same module, since they don't run in parallel
-yfried