testing

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InfraSetupWait = time.Second * 11
)

Functions

func AddKeyToAgent added in v0.3.0

func AddKeyToAgent(keyPath string) error

func GenerateRSAKeyFiles added in v0.3.0

func GenerateRSAKeyFiles(directory, privFileName string) error

GenerateRSAKeyFiles generates a public/private key pair and stores it in the directory passed as the input.

func NextPortValue added in v0.3.0

func NextPortValue() string

NextPortValue returns a pseudo-rando test [2200 .. 2290]

func NextResourceName added in v0.3.0

func NextResourceName() string

NextResourceName returns crashd-test-XXXX name

func RemoveKeyFromAgent added in v0.3.0

func RemoveKeyFromAgent(keyPath string) error

func Username added in v0.3.0

func Username() (string, error)

Username returns current username

Types

type KindCluster

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

func NewKindCluster

func NewKindCluster(config, name string) *KindCluster

func (*KindCluster) Create

func (k *KindCluster) Create() error

func (*KindCluster) Destroy

func (k *KindCluster) Destroy() error

func (*KindCluster) GetKubeConfig

func (k *KindCluster) GetKubeConfig() (io.Reader, error)

func (*KindCluster) GetKubeCtlContext

func (k *KindCluster) GetKubeCtlContext() string

func (*KindCluster) MakeKubeConfigFile

func (k *KindCluster) MakeKubeConfigFile(path string) error

type SSHServer

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

func NewSSHServer

func NewSSHServer(serverName, username, port, sshMountDir string) (*SSHServer, error)

func (*SSHServer) MountedDir added in v0.3.0

func (s *SSHServer) MountedDir() string

func (*SSHServer) PrivateKey added in v0.3.0

func (s *SSHServer) PrivateKey() string

func (*SSHServer) Start

func (s *SSHServer) Start() error

StartSSHServer starts starts sshd process using image linuxserver/openssh-server.DockerRunSSH The server opnes up port 2222 with the following command

docker create \
  --name=test-sshd \
  -e PUBLIC_KEY_FILE=$HOME/.ssh/id_rsa.pub \
  -e USER_NAME=$USER \
  -e SUDO_ACCESS=true \
  -p 2222:2222 \
  -v ./testing/server-name:/config
  linuxserver/openssh-server

func (*SSHServer) Stop

func (s *SSHServer) Stop() error

type TestSupport added in v0.3.0

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

func Init

func Init() (*TestSupport, error)

Init initializes and returns TestSupport instance

func (*TestSupport) CurrentUsername added in v0.3.0

func (t *TestSupport) CurrentUsername() string

CurrentUsername returns the current username or error

func (*TestSupport) KindKubeConfigFile added in v0.3.0

func (t *TestSupport) KindKubeConfigFile() string

func (*TestSupport) MaxConnectionRetries added in v0.3.0

func (t *TestSupport) MaxConnectionRetries() int

func (*TestSupport) PortValue added in v0.3.0

func (t *TestSupport) PortValue() string

PortValue returns a string with a random value that can be used as port

func (*TestSupport) PrivateKeyPath added in v0.3.0

func (t *TestSupport) PrivateKeyPath() string

func (*TestSupport) ResourceName added in v0.3.0

func (t *TestSupport) ResourceName() string

ResourceName resturns string that can be used to name resource

func (*TestSupport) SetupKindCluster added in v0.3.0

func (t *TestSupport) SetupKindCluster() error

func (*TestSupport) SetupKindKubeConfig added in v0.3.0

func (t *TestSupport) SetupKindKubeConfig() (string, error)

func (*TestSupport) SetupSSHServer added in v0.3.0

func (t *TestSupport) SetupSSHServer() error

func (*TestSupport) TearDown added in v0.3.0

func (t *TestSupport) TearDown() error

func (*TestSupport) TmpDirRoot added in v0.3.0

func (t *TestSupport) TmpDirRoot() string

func (*TestSupport) WorkDirRoot added in v0.3.0

func (t *TestSupport) WorkDirRoot() string

Jump to

Keyboard shortcuts

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