v1

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v2 contains common functions for creating db resources for use in acceptance tests. See the `*_test.go` files for example usages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabase

func CreateDatabase(t *testing.T, client *gophercloud.ServiceClient, instanceID string) error

CreateDatabase will create a database with a randomly generated name. An error will be returned if the database was unable to be created.

func CreateInstance

func CreateInstance(t *testing.T, client *gophercloud.ServiceClient) (*instances.Instance, error)

CreateInstance will create an instance with a randomly generated name. The flavor of the instance will be the value of the OS_FLAVOR_ID environment variable. The Datastore will be pulled from the OS_DATASTORE_TYPE_ID environment variable. An error will be returned if the instance was unable to be created.

func CreateUser

func CreateUser(t *testing.T, client *gophercloud.ServiceClient, instanceID string) error

CreateUser will create a user with a randomly generated name. An error will be returned if the user was unable to be created.

func DeleteDatabase

func DeleteDatabase(t *testing.T, client *gophercloud.ServiceClient, instanceID, name string)

DeleteDatabase deletes a database. A fatal error will occur if the database failed to delete. This works best when used as a deferred function.

func DeleteInstance

func DeleteInstance(t *testing.T, client *gophercloud.ServiceClient, id string)

DeleteInstance deletes an instance. A fatal error will occur if the instance failed to delete. This works best when used as a deferred function.

func DeleteUser

func DeleteUser(t *testing.T, client *gophercloud.ServiceClient, instanceID, name string)

DeleteUser deletes a user. A fatal error will occur if the user failed to delete. This works best when used as a deferred function.

func WaitForInstanceStatus

func WaitForInstanceStatus(
	client *gophercloud.ServiceClient, instance *instances.Instance, status string) error

WaitForInstanceState will poll an instance's status until it either matches the specified status or the status becomes ERROR.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL