clients

package
v0.0.0-...-cd80d89 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package clients contains functions for creating OpenStack service clients for use in acceptance tests. It also manages the required environment variables to run the tests.

Index

Constants

This section is empty.

Variables

View Source
var REDACT_HEADERS = []string{"x-auth-token", "x-auth-key", "x-service-token",
	"x-storage-token", "x-account-meta-temp-url-key", "x-account-meta-temp-url-key-2",
	"x-container-meta-temp-url-key", "x-container-meta-temp-url-key-2", "set-cookie",
	"x-subject-token"}

List of headers that need to be redacted

Functions

func NewBareMetalIntrospectionV1Client

func NewBareMetalIntrospectionV1Client() (*gophercloud.ServiceClient, error)

NewBareMetalIntrospectionV1Client returns a *ServiceClient for making calls to the OpenStack Bare Metal Introspection v1 API. An error will be returned if authentication or client creation was not possible.

func NewBareMetalV1Client

func NewBareMetalV1Client() (*gophercloud.ServiceClient, error)

NewBareMetalV1Client returns a *ServiceClient for making calls to the OpenStack Bare Metal v1 API. An error will be returned if authentication or client creation was not possible.

func NewBareMetalV1HTTPBasic

func NewBareMetalV1HTTPBasic() (*gophercloud.ServiceClient, error)

NewBareMetalV1HTTPBasic returns a *ServiceClient for making calls to the OpenStack Bare Metal v1 API. An error will be returned if authentication or client creation was not possible.

func NewBareMetalV1NoAuthClient

func NewBareMetalV1NoAuthClient() (*gophercloud.ServiceClient, error)

NewBareMetalV1NoAuthClient returns a *ServiceClient for making calls to the OpenStack Bare Metal v1 API. An error will be returned if authentication or client creation was not possible.

func NewBlockStorageV1Client

func NewBlockStorageV1Client() (*gophercloud.ServiceClient, error)

NewBlockStorageV1Client returns a *ServiceClient for making calls to the OpenStack Block Storage v1 API. An error will be returned if authentication or client creation was not possible.

func NewBlockStorageV2Client

func NewBlockStorageV2Client() (*gophercloud.ServiceClient, error)

NewBlockStorageV2Client returns a *ServiceClient for making calls to the OpenStack Block Storage v2 API. An error will be returned if authentication or client creation was not possible.

func NewBlockStorageV2NoAuthClient

func NewBlockStorageV2NoAuthClient() (*gophercloud.ServiceClient, error)

NewBlockStorageV2NoAuthClient returns a noauth *ServiceClient for making calls to the OpenStack Block Storage v2 API. An error will be returned if client creation was not possible.

func NewBlockStorageV3Client

func NewBlockStorageV3Client() (*gophercloud.ServiceClient, error)

NewBlockStorageV3Client returns a *ServiceClient for making calls to the OpenStack Block Storage v3 API. An error will be returned if authentication or client creation was not possible.

func NewBlockStorageV3NoAuthClient

func NewBlockStorageV3NoAuthClient() (*gophercloud.ServiceClient, error)

NewBlockStorageV3NoAuthClient returns a noauth *ServiceClient for making calls to the OpenStack Block Storage v2 API. An error will be returned if client creation was not possible.

func NewClusteringV1Client

func NewClusteringV1Client() (*gophercloud.ServiceClient, error)

NewClusteringV1Client returns a *ServiceClient for making calls to the OpenStack Clustering v1 API. An error will be returned if authentication or client creation was not possible.

func NewComputeV2Client

func NewComputeV2Client() (*gophercloud.ServiceClient, error)

NewComputeV2Client returns a *ServiceClient for making calls to the OpenStack Compute v2 API. An error will be returned if authentication or client creation was not possible.

func NewContainerInfraV1Client

func NewContainerInfraV1Client() (*gophercloud.ServiceClient, error)

NewContainerInfraV1Client returns a *ServiceClient for making calls to the OpenStack Container Infra Management v1 API. An error will be returned if authentication or client creation was not possible.

func NewContainerV1Client

func NewContainerV1Client() (*gophercloud.ServiceClient, error)

NewContainerV1Client returns a *ServiceClient for making calls to the OpenStack Container V1 API. An error will be returned if authentication or client creation was not possible.

func NewDBV1Client

func NewDBV1Client() (*gophercloud.ServiceClient, error)

NewDBV1Client returns a *ServiceClient for making calls to the OpenStack Database v1 API. An error will be returned if authentication or client creation was not possible.

func NewDNSV2Client

func NewDNSV2Client() (*gophercloud.ServiceClient, error)

NewDNSV2Client returns a *ServiceClient for making calls to the OpenStack Compute v2 API. An error will be returned if authentication or client creation was not possible.

func NewIdentityV2AdminClient

func NewIdentityV2AdminClient() (*gophercloud.ServiceClient, error)

NewIdentityV2AdminClient returns a *ServiceClient for making calls to the Admin Endpoint of the OpenStack Identity v2 API. An error will be returned if authentication or client creation was not possible.

func NewIdentityV2Client

func NewIdentityV2Client() (*gophercloud.ServiceClient, error)

NewIdentityV2Client returns a *ServiceClient for making calls to the OpenStack Identity v2 API. An error will be returned if authentication or client creation was not possible.

func NewIdentityV2UnauthenticatedClient

func NewIdentityV2UnauthenticatedClient() (*gophercloud.ServiceClient, error)

NewIdentityV2UnauthenticatedClient returns an unauthenticated *ServiceClient for the OpenStack Identity v2 API. An error will be returned if authentication or client creation was not possible.

func NewIdentityV3Client

func NewIdentityV3Client() (*gophercloud.ServiceClient, error)

NewIdentityV3Client returns a *ServiceClient for making calls to the OpenStack Identity v3 API. An error will be returned if authentication or client creation was not possible.

func NewIdentityV3UnauthenticatedClient

func NewIdentityV3UnauthenticatedClient() (*gophercloud.ServiceClient, error)

NewIdentityV3UnauthenticatedClient returns an unauthenticated *ServiceClient for the OpenStack Identity v3 API. An error will be returned if authentication or client creation was not possible.

func NewImageServiceV2Client

func NewImageServiceV2Client() (*gophercloud.ServiceClient, error)

NewImageServiceV2Client returns a *ServiceClient for making calls to the OpenStack Image v2 API. An error will be returned if authentication or client creation was not possible.

func NewKeyManagerV1Client

func NewKeyManagerV1Client() (*gophercloud.ServiceClient, error)

NewKeyManagerV1Client returns a *ServiceClient for making calls to the OpenStack Key Manager (Barbican) v1 API. An error will be returned if authentication or client creation was not possible.

func NewLoadBalancerV2Client

func NewLoadBalancerV2Client() (*gophercloud.ServiceClient, error)

NewLoadBalancerV2Client returns a *ServiceClient for making calls to the OpenStack Octavia v2 API. An error will be returned if authentication or client creation was not possible.

func NewMessagingV2Client

func NewMessagingV2Client(clientID string) (*gophercloud.ServiceClient, error)

NewMessagingV2Client returns a *ServiceClient for making calls to the OpenStack Messaging (Zaqar) v2 API. An error will be returned if authentication or client creation was not possible.

func NewNetworkV2Client

func NewNetworkV2Client() (*gophercloud.ServiceClient, error)

NewNetworkV2Client returns a *ServiceClient for making calls to the OpenStack Networking v2 API. An error will be returned if authentication or client creation was not possible.

func NewObjectStorageV1Client

func NewObjectStorageV1Client() (*gophercloud.ServiceClient, error)

NewObjectStorageV1Client returns a *ServiceClient for making calls to the OpenStack Object Storage v1 API. An error will be returned if authentication or client creation was not possible.

func NewOrchestrationV1Client

func NewOrchestrationV1Client() (*gophercloud.ServiceClient, error)

NewOrchestrationV1Client returns a *ServiceClient for making calls to the OpenStack Orchestration v1 API. An error will be returned if authentication or client creation was not possible.

func NewPlacementV1Client

func NewPlacementV1Client() (*gophercloud.ServiceClient, error)

NewPlacementV1Client returns a *ServiceClient for making calls to the OpenStack Placement API. An error will be returned if authentication or client creation was not possible.

func NewSharedFileSystemV2Client

func NewSharedFileSystemV2Client() (*gophercloud.ServiceClient, error)

NewSharedFileSystemV2Client returns a *ServiceClient for making calls to the OpenStack Shared File System v2 API. An error will be returned if authentication or client creation was not possible.

func NewWorkflowV2Client

func NewWorkflowV2Client() (*gophercloud.ServiceClient, error)

NewWorkflowV2Client returns a *ServiceClient for making calls to the OpenStack Workflow v2 API (Mistral). An error will be returned if authentication or client creation failed.

func RequireAdmin

func RequireAdmin(t *testing.T)

RequireAdmin will restrict a test to only be run by admin users.

func RequireDNS

func RequireDNS(t *testing.T)

RequireDNS will restrict a test to only be run in environments that support DNSaaS.

func RequireGuestAgent

func RequireGuestAgent(t *testing.T)

RequireGuestAgent will restrict a test to only be run in environments that support the QEMU guest agent.

func RequireIdentityV2

func RequireIdentityV2(t *testing.T)

RequireIdentityV2 will restrict a test to only be run in environments that support the Identity V2 API.

func RequireIronicHTTPBasic

func RequireIronicHTTPBasic(t *testing.T)

RequireIronicHTTPBasic will restric a test to be only run in environments that have Ironic using http_basic.

func RequireLiveMigration

func RequireLiveMigration(t *testing.T)

RequireLiveMigration will restrict a test to only be run in environments that support live migration.

func RequireLong

func RequireLong(t *testing.T)

RequireLong will ensure long-running tests can run.

func RequireNonAdmin

func RequireNonAdmin(t *testing.T)

RequireNonAdmin will restrict a test to only be run by non-admin users.

func RequireNovaNetwork

func RequireNovaNetwork(t *testing.T)

RequireNovaNetwork will restrict a test to only be run in environments that support nova-network.

func RequirePortForwarding

func RequirePortForwarding(t *testing.T)

RequirePortForwarding will restrict a test to only be run in environments that support port forwarding

func SkipRelease

func SkipRelease(t *testing.T, release string)

SkipRelease will have the test be skipped on a certain release. Releases are named such as 'stable/mitaka', master, etc.

func SkipReleasesAbove

func SkipReleasesAbove(t *testing.T, release string)

SkipReleasesAbove will have the test be skipped on releases above a certain one. The test is always skipped on master release. Releases are named such as 'stable/mitaka', master, etc.

func SkipReleasesBelow

func SkipReleasesBelow(t *testing.T, release string)

SkipReleasesBelow will have the test be skipped on releases below a certain one. Releases are named such as 'stable/mitaka', master, etc.

Types

type AcceptanceTestChoices

type AcceptanceTestChoices struct {
	// ImageID contains the ID of a valid image.
	ImageID string

	// FlavorID contains the ID of a valid flavor.
	FlavorID string

	// FlavorIDResize contains the ID of a different flavor available on the same OpenStack installation, that is distinct
	// from FlavorID.
	FlavorIDResize string

	// FloatingIPPool contains the name of the pool from where to obtain floating IPs.
	FloatingIPPoolName string

	// MagnumKeypair contains the ID of a valid key pair.
	MagnumKeypair string

	// MagnumImageID contains the ID of a valid magnum image.
	MagnumImageID string

	// NetworkName is the name of a network to launch the instance on.
	NetworkName string

	// NetworkID is the ID of a network to launch the instance on.
	NetworkID string

	// SubnetID is the ID of a subnet to launch the instance on.
	SubnetID string

	// ExternalNetworkID is the network ID of the external network.
	ExternalNetworkID string

	// DBDatastoreType is the datastore type for DB tests.
	DBDatastoreType string

	// DBDatastoreTypeID is the datastore type version for DB tests.
	DBDatastoreVersion string
}

AcceptanceTestChoices contains image and flavor selections for use by the acceptance tests.

func AcceptanceTestChoicesFromEnv

func AcceptanceTestChoicesFromEnv() (*AcceptanceTestChoices, error)

AcceptanceTestChoicesFromEnv populates a ComputeChoices struct from environment variables. If any required state is missing, an `error` will be returned that enumerates the missing properties.

type LogRoundTripper

type LogRoundTripper struct {
	Rt http.RoundTripper
}

LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper to allow logging.

func (*LogRoundTripper) RoundTrip

func (lrt *LogRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip performs a round-trip HTTP request and logs relevant information about it.

Jump to

Keyboard shortcuts

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