testing

package
v0.9.4-test5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirToMap

func DirToMap(dir string) (map[string]interface{}, error)

DirToMap converts directory to a map where keys are filenames without full path and values are the contents of the files. Files with '.iso' extensions are unpacked using 7z and then converted to a map using DirToMap. Directories are handled recursively. If the directory doesn't exist, dirToMap returns nil

func EncodePEMCert

func EncodePEMCert(cert *x509.Certificate) string

func EncodePEMKey

func EncodePEMKey(key *rsa.PrivateKey) string

func GenerateCert

func GenerateCert(t *testing.T, isCA bool, host string, signer *x509.Certificate, key *rsa.PrivateKey) (*x509.Certificate, *rsa.PrivateKey)

func IsoToMap

func IsoToMap(isoPath string) (map[string]interface{}, error)

IsoToMap converts an iso image to a map where keys are filenames without full path and values are the contents of the files. It does so by unpacking the image into a temporary directory and processing it with DirToMap.

Types

type TestCommand

type TestCommand struct {
	Command *exec.Cmd
	// contains filtered or unexported fields
}

func RunProcess

func RunProcess(t *testing.T, command string, args []string, env []string) *TestCommand

RunProcess runs a background process with specified args and appending env to the current environment.

func (*TestCommand) Pid

func (tc *TestCommand) Pid() int

func (*TestCommand) Stop

func (tc *TestCommand) Stop()

Jump to

Keyboard shortcuts

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