Documentation ¶
Index ¶
- func GCECreateImage(api *compute.Service, proj, name, source string) error
- func GCECreateVM(api *compute.Service, opts *GCEOptions, userdata string) (*gceMachine, error)
- func GCEDestroyVM(api *compute.Service, proj, zone, name string) error
- func GCEForceCreateImage(api *compute.Service, proj, name, source string) error
- func GCEListImages(client *http.Client, proj, prefix string) ([]string, error)
- func InstallFile(in io.Reader, m Machine, to string) error
- func Manhole(m Machine) error
- func ReadFile(m Machine, path string) (io.ReadCloser, error)
- func Reboot(m Machine) error
- func StreamJournal(m Machine) error
- func TransferFile(src Machine, srcPath string, dst Machine, dstPath string) error
- type AWSOptions
- type Cluster
- type Conf
- type GCEOptions
- type Machine
- type Options
- type QEMUCluster
- func (qc *QEMUCluster) Destroy() error
- func (qc *QEMUCluster) GetDiscoveryURL(size int) (string, error)
- func (bc QEMUCluster) Machines() []Machine
- func (qc *QEMUCluster) NewMachine(cfg string) (Machine, error)
- func (bc QEMUCluster) PasswordSSHClient(ip string, user string, password string) (*ssh.Client, error)
- func (bc QEMUCluster) SSH(m Machine, cmd string) ([]byte, error)
- func (bc QEMUCluster) SSHClient(ip string) (*ssh.Client, error)
- type QEMUOptions
- type TestCluster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GCECreateImage ¶
Create image on GCE and and wait for completion. Will not overwrite existing image.
func GCECreateVM ¶
func GCECreateVM(api *compute.Service, opts *GCEOptions, userdata string) (*gceMachine, error)
func GCEDestroyVM ¶
func GCEForceCreateImage ¶
Delete image on GCE and then recreate it.
func InstallFile ¶
InstallFile copies data from in to the path to on m.
func Manhole ¶
Manhole connects os.Stdin, os.Stdout, and os.Stderr to an interactive shell session on the Machine m. Manhole blocks until the shell session has ended. If os.Stdin does not refer to a TTY, Manhole returns immediately with a nil error.
func ReadFile ¶ added in v0.0.10
func ReadFile(m Machine, path string) (io.ReadCloser, error)
ReadFile returns a io.ReadCloser that streams the requested file. The caller should close the reader when finished.
func Reboot ¶
Reboots a machine and blocks until the system to be accessible by SSH again. It will return an error if the machine is not accessible after a timeout.
func StreamJournal ¶
StreamJournal streams the remote system's journal to stdout.
Types ¶
type AWSOptions ¶
AWSOptions contains AWS-specific instance options.
type Cluster ¶
type Cluster interface { // NewMachine creates a new CoreOS machine. NewMachine(config string) (Machine, error) // Machines returns a slice of the active machines in the Cluster. Machines() []Machine // GetDiscoveryURL returns a new etcd discovery URL. GetDiscoveryURL(size int) (string, error) // Destroy terminates each machine in the cluster and frees any other // associated resources. Destroy() error }
Cluster represents a cluster of CoreOS machines within a single platform.
func NewAWSCluster ¶
func NewAWSCluster(conf AWSOptions) (Cluster, error)
NewAWSCluster creates an instance of a Cluster suitable for spawning instances on Amazon Web Services' Elastic Compute platform.
NewAWSCluster will consume the environment variables $AWS_REGION, $AWS_ACCESS_KEY_ID, and $AWS_SECRET_ACCESS_KEY to determine the region to spawn instances in and the credentials to use to authenticate.
func NewGCECluster ¶
func NewGCECluster(conf GCEOptions) (Cluster, error)
func NewQemuCluster ¶
func NewQemuCluster(conf QEMUOptions) (Cluster, error)
NewQemuCluster creates a Cluster instance, suitable for running virtual machines in QEMU.
type Conf ¶
type Conf struct {
// contains filtered or unexported fields
}
Conf is a configuration for a CoreOS machine. It may be either a coreos-cloudconfig or an ignition configuration.
func NewConf ¶
NewConf parses userdata and returns a new Conf. It returns an error if the userdata can't be parsed as a coreos-cloudinit or ignition configuration.
type GCEOptions ¶
type Machine ¶
type Machine interface { // ID returns the plaform-specific machine identifier. ID() string // IP returns the machine's public IP. IP() string // PrivateIP returns the machine's private IP. PrivateIP() string // SSHClient establishes a new SSH connection to the machine. SSHClient() (*ssh.Client, error) // PasswordSSHClient establishes a new SSH connection using the provided credentials. PasswordSSHClient(user string, password string) (*ssh.Client, error) // SSH runs a single command over a new SSH connection. SSH(cmd string) ([]byte, error) // Destroy terminates the machine and frees associated resources. Destroy() error }
Machine represents a CoreOS instance.
func GCEListVMs ¶
func GCEListVMs(api *compute.Service, opts *GCEOptions, prefix string) ([]Machine, error)
type Options ¶ added in v0.1.4
type Options struct {
BaseName string
}
Options contains the base options for all clusters.
type QEMUCluster ¶
type QEMUCluster struct { *local.LocalCluster // contains filtered or unexported fields }
QEMUCluster is a local cluster of QEMU-based virtual machines.
XXX: must be exported so that certain QEMU tests can access struct members through type assertions.
func (*QEMUCluster) Destroy ¶
func (qc *QEMUCluster) Destroy() error
func (*QEMUCluster) GetDiscoveryURL ¶
func (qc *QEMUCluster) GetDiscoveryURL(size int) (string, error)
overrides baseCluster.GetDiscoveryURL
func (*QEMUCluster) NewMachine ¶
func (qc *QEMUCluster) NewMachine(cfg string) (Machine, error)
func (QEMUCluster) PasswordSSHClient ¶ added in v0.1.4
type QEMUOptions ¶
type QEMUOptions struct { // DiskImage is the full path to the disk image to boot in QEMU. DiskImage string Board string // BIOSImage is name of the BIOS file to pass to QEMU. // It can be a plain name, or a full path. BIOSImage string *Options }
QEMUOptions contains QEMU-specific options for the cluster.
type TestCluster ¶
TestCluster embedds a Cluster to provide platform independant helper methods.
func (*TestCluster) DropFile ¶
func (t *TestCluster) DropFile(localPath string) error
DropFile places file from localPath to ~/ on every machine in cluster
func (*TestCluster) ListNativeFunctions ¶
func (t *TestCluster) ListNativeFunctions() []string
ListNativeFunctions returns a slice of function names that can be executed directly on machines in the cluster.