Documentation ¶
Overview ¶
Package v2 contains common functions for creating identity-based resources for use in acceptance tests. See the `*_test.go` files for example usages.
Index ¶
- func AddUserRole(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant, ...) error
- func CreateUser(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant) (*users.User, error)
- func DeleteUser(t *testing.T, client *gophercloud.ServiceClient, user *users.User)
- func DeleteUserRole(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant, ...)
- func FindRole(t *testing.T, client *gophercloud.ServiceClient) (*roles.Role, error)
- func FindTenant(t *testing.T, client *gophercloud.ServiceClient) (*tenants.Tenant, error)
- func PrintCatalogEntry(t *testing.T, catalogEntry *tokens.CatalogEntry)
- func PrintRole(t *testing.T, role *roles.Role)
- func PrintTenant(t *testing.T, tenant *tenants.Tenant)
- func PrintToken(t *testing.T, token *tokens.Token)
- func PrintTokenUser(t *testing.T, user *tokens.User)
- func PrintUser(t *testing.T, user *users.User)
- func PrintUserRole(t *testing.T, role *users.Role)
- func UpdateUser(t *testing.T, client *gophercloud.ServiceClient, user *users.User) (*users.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUserRole ¶
func AddUserRole(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant, user *users.User, role *roles.Role) error
AddUserRole will grant a role to a user in a tenant. An error will be returned if the grant was unsuccessful.
func CreateUser ¶
func CreateUser(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant) (*users.User, error)
CreateUser will create a user with a random name and adds them to the given tenant. An error will be returned if the user was unable to be created.
func DeleteUser ¶
func DeleteUser(t *testing.T, client *gophercloud.ServiceClient, user *users.User)
DeleteUser will delete a user. A fatal error will occur if the delete was unsuccessful. This works best when used as a deferred function.
func DeleteUserRole ¶
func DeleteUserRole(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant, user *users.User, role *roles.Role)
DeleteUserRole will revoke a role of a user in a tenant. A fatal error will occur if the revoke was unsuccessful. This works best when used as a deferred function.
func FindRole ¶
func FindRole(t *testing.T, client *gophercloud.ServiceClient) (*roles.Role, error)
FindRole finds all roles that the current authenticated client has access to and returns the first one found. An error will be returned if the lookup was unsuccessful.
func FindTenant ¶
func FindTenant(t *testing.T, client *gophercloud.ServiceClient) (*tenants.Tenant, error)
FindTenant finds all tenants that the current authenticated client has access to and returns the first one found. An error will be returned if the lookup was unsuccessful.
func PrintCatalogEntry ¶
func PrintCatalogEntry(t *testing.T, catalogEntry *tokens.CatalogEntry)
PrintCatalogEntry will print a catalog entry and all of its attributes.
func PrintTenant ¶
PrintTenant will print a tenant and all of its attributes.
func PrintToken ¶
PrintToken will print a token and all of its attributes.
func PrintTokenUser ¶
PrintTokenUser will print the user information of a token and all attributes.
func PrintUserRole ¶
PrintUserRole will print the roles that a user has been granted.
func UpdateUser ¶
func UpdateUser(t *testing.T, client *gophercloud.ServiceClient, user *users.User) (*users.User, error)
UpdateUser will update an existing user with a new randomly generated name. An error will be returned if the update was unsuccessful.
Types ¶
This section is empty.