testframework

package
v4.2.16+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDefaultIP = errors.New("no suitable IP address")

ErrNoDefaultIP is returned when no suitable non-loopback address can be found.

Functions

func ConfigFromFile

func ConfigFromFile(filename string) (*rest.Config, error)

func CreateProject

func CreateProject(t *testing.T, clientConfig *rest.Config, namespace string, adminUser string) *projectapiv1.Project

func DefaultLocalIP4

func DefaultLocalIP4() (net.IP, error)

DefaultLocalIP4 returns an IPv4 address that this host can be reached on. Will return ErrNoDefaultIP if no suitable address can be found.

github.com/openshift/origin/pkg/cmd/util.DefaultLocalIP4

func DeleteProject

func DeleteProject(t *testing.T, clientConfig *rest.Config, name string)

func FindFreeLocalPort

func FindFreeLocalPort() (int, error)

FindFreeLocalPort returns the number of an available port number on the loopback interface. Useful for determining the port to launch a server on. Error handling required - there is a non-zero chance that the returned port number will be bound by another process after this function returns.

k8s.io/kubernetes/test/integration/framework.FindFreeLocalPort

func GetClientForUser

func GetClientForUser(clusterAdminConfig *restclient.Config, username string) (kclientset.Interface, *restclient.Config, error)

func ServeImage

func ServeImage(w http.ResponseWriter, r *http.Request, image string, data Schema2ImageData, tags []string) bool

func ServeV2

func ServeV2(w http.ResponseWriter, r *http.Request) bool

func UserClientConfig

func UserClientConfig(clientConfig *rest.Config, token string) *rest.Config

func WaitHTTP

func WaitHTTP(rt http.RoundTripper, url string) error

func WaitTCP

func WaitTCP(addr string) error

Types

type CloseFunc

type CloseFunc func() error

func StartTestRegistry

func StartTestRegistry(t *testing.T, kubeConfigPath string, options ...RegistryOption) (net.Listener, CloseFunc)

type DisableMirroring

type DisableMirroring struct{}

func (DisableMirroring) Apply

func (o DisableMirroring) Apply(dockerConfig *configuration.Configuration, extraConfig *registryconfig.Configuration)

type EnableMetrics

type EnableMetrics struct {
	Secret string
}

func (EnableMetrics) Apply

func (o EnableMetrics) Apply(dockerConfig *configuration.Configuration, extraConfig *registryconfig.Configuration)

type HTTPServer

type HTTPServer struct {
	Listener net.Listener
	URL      *url.URL
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(t *testing.T, handler http.Handler) *HTTPServer

func (*HTTPServer) Close

func (hs *HTTPServer) Close()

type Master

type Master struct {
	// contains filtered or unexported fields
}

func NewMaster

func NewMaster(t *testing.T) *Master

func (*Master) AdminKubeConfig

func (m *Master) AdminKubeConfig() *rest.Config

func (*Master) Close

func (m *Master) Close()

func (*Master) CreateProject

func (m *Master) CreateProject(namespace, user string) *projectapiv1.Project

func (*Master) CreateUser

func (m *Master) CreateUser(username string, password string) *User

func (*Master) GrantPrunerRole

func (m *Master) GrantPrunerRole(user *User)

func (*Master) StartRegistry

func (m *Master) StartRegistry(t *testing.T, options ...RegistryOption) *Registry

func (*Master) WaitForRoles

func (m *Master) WaitForRoles() error

type MasterContainer

type MasterContainer struct {
	ID              string
	Port            int
	NetworkSettings struct {
		IPAddress string
	}

	KubeConfigPath string
}

func (*MasterContainer) AdminKubeConfigPath

func (m *MasterContainer) AdminKubeConfigPath() string

func (*MasterContainer) Stop

func (c *MasterContainer) Stop() error

func (*MasterContainer) WaitHealthz

func (c *MasterContainer) WaitHealthz(configDir string) error

func (*MasterContainer) WriteConfigs

func (c *MasterContainer) WriteConfigs(configDir string) error

type MasterInterface

type MasterInterface interface {
	Stop() error
	WaitHealthz(configDir string) error
	AdminKubeConfigPath() string
}

func StartMasterContainer

func StartMasterContainer(configDir string) (MasterInterface, error)

func StartMasterProcess

func StartMasterProcess(kubeconfig string) (MasterInterface, error)

type MasterProcess

type MasterProcess struct {
	// contains filtered or unexported fields
}

func (*MasterProcess) AdminKubeConfigPath

func (p *MasterProcess) AdminKubeConfigPath() string

func (*MasterProcess) Stop

func (p *MasterProcess) Stop() error

func (*MasterProcess) WaitHealthz

func (p *MasterProcess) WaitHealthz(configDir string) error

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func (*Registry) Addr

func (r *Registry) Addr() string

func (*Registry) BaseURL

func (r *Registry) BaseURL() string

func (*Registry) Close

func (r *Registry) Close()

func (*Registry) Repository

func (r *Registry) Repository(namespace string, imagestream string, user *User) *Repository

type RegistryOption

type RegistryOption interface {
	Apply(dockerConfig *configuration.Configuration, extraConfig *registryconfig.Configuration)
}

type Repository

type Repository struct {
	distribution.Repository
	// contains filtered or unexported fields
}

func (*Repository) BaseURL

func (r *Repository) BaseURL() string

func (*Repository) RepoName

func (r *Repository) RepoName() string

func (*Repository) Transport

func (r *Repository) Transport() http.RoundTripper

type Schema2ImageData

type Schema2ImageData struct {
	ConfigMediaType   string
	Config            []byte
	ConfigDigest      digest.Digest
	LayerMediaType    string
	Layer             []byte
	LayerDigest       digest.Digest
	ManifestMediaType string
	Manifest          []byte
	ManifestDigest    digest.Digest
}

func NewSchema2ImageData

func NewSchema2ImageData() (Schema2ImageData, error)

type User

type User struct {
	Name  string
	Token string
	// contains filtered or unexported fields
}

func (*User) KubeConfig

func (u *User) KubeConfig() *rest.Config

Jump to

Keyboard shortcuts

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