remote

package
v0.0.0-...-304bf78 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DefaultPort to use for SSH session
	DefaultPort = 22
	//DefaultUser to use for SSH session
	DefaultUser = "sles"
)

Variables

This section is empty.

Functions

func InitializeScenario

func InitializeScenario(ctx *godog.ScenarioContext)

InitializeScenario initialize feature object and steps

Types

type Client

type Client struct {
	Host    string
	Port    int64
	Config  *ssh.ClientConfig
	Cluster []byte
	Results []Result
}

Client is SSH client object

func NewClient

func NewClient() (*Client, error)

NewClient returns ClientConfig object

func (*Client) RunCmd

func (c *Client) RunCmd(cmd, host string) string

RunCmd create ssh session and run command on single host and return stdout

func (*Client) RunCmdBlockOnHosts

func (c *Client) RunCmdBlockOnHosts(hosts, description string, input *godog.DocString) error

RunCmdBlockOnHosts run commands on remote hosts and save outputs in Result object

func (*Client) UploadFile

func (c *Client) UploadFile(src, host, dst string) error

UploadFile copy file from local machine to single host

func (*Client) UploadFileToHosts

func (c *Client) UploadFileToHosts(file, hosts, dir string) error

UploadFileToHosts copy file from local machine to hosts

type Result

type Result struct {
	IP     string
	Stdout string
}

Result of SSH stdout object

Jump to

Keyboard shortcuts

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