Documentation ¶
Index ¶
- func CopyFileToNode(in *Input, node string, file File)
- func CopyFilesToNode(in *Input, node string)
- func CreateNetworks(in *Input)
- func CreateNode(in *Input, i int) string
- func CreateNodes(in *Input) []string
- func CreateProfile(in *Input)
- func NodeHasInternet(in *Input, node string)
- func PullImage(in *Input)
- func Run(ctx context.Context, t *testing.T, cmd Command) error
- type Command
- type File
- type Input
- type Output
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileToNode ¶
CopyFileToNode copies a single file to a node.
func CopyFilesToNode ¶
CopyFilesToNode copies the files needed for the cluster to the node. Copies the provided ssh key, the embedded-cluster binary and also all scripts from the scripts directory (they are all placed under /usr/local/bin inside the node).
func CreateNetworks ¶
func CreateNetworks(in *Input)
CreateNetworks create two networks, one of type bridge and inside of it another one of type ovn, the latter is completely isolated from the host network and from the other networks on the same server.
func CreateNode ¶
CreateNode creates a single node. The i here is used to create a unique name for the node. Node is named as "node-<cluster id>-<i>". The node name is returned.
func CreateNodes ¶
CreateNodes creats the nodes for the cluster. The amount of nodes is specified in the input.
func CreateProfile ¶
func CreateProfile(in *Input)
CreateProfile that restricts the hardware and provides privileged access to the containers.
func NodeHasInternet ¶
NodeHasInternet checks if the node has internet access. It does this by pinging google.com.
Types ¶
type Command ¶
type Command struct { Node string Line []string Stdout io.WriteCloser Stderr io.WriteCloser }
Command is a command to be run in a node.
type Input ¶
type Input struct { Nodes int SSHPublicKey string SSHPrivateKey string EmbeddedClusterPath string Image string T *testing.T // contains filtered or unexported fields }
Input are the options passed in to the cluster creation plus some data for internal consumption only.
type Output ¶
Output is returned when a cluster is created. Contain a list of all node names and the cluster id.
func NewTestCluster ¶
NewTestCluster creates a new cluster and returns an object of type Output that can be used to get the created nodes and destroy the cluster when it is no longer needed.