testhelper

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBeTrue

func CheckBeTrue(b bool)

func CheckEqual

func CheckEqual(obj1 interface{}, obj2 interface{})

func CheckErr

func CheckErr(err error)

func CheckExit0

func CheckExit0(sess *gexec.Session, waitTime time.Duration)

func CheckFuncBeTrue

func CheckFuncBeTrue(f func() bool, t time.Duration)

func CheckNotBeTrue

func CheckNotBeTrue(b bool)

func CheckNotEqual

func CheckNotEqual(obj1 interface{}, obj2 interface{})

func CheckNotExit0

func CheckNotExit0(sess *gexec.Session, waitTime time.Duration)

func CheckNotNil

func CheckNotNil(obj interface{})

func CreateTempFile

func CreateTempFile() string

func DeleteFileLocally

func DeleteFileLocally(filePath string)

DeleteFileLocally delete file for cloud apply

func GetLocalFileData added in v0.9.2

func GetLocalFileData(filePath string) string

GetLocalFileData get file data from local

func GetPwd

func GetPwd() string

func GetRemoteFileData added in v0.9.2

func GetRemoteFileData(sshClient *SSHClient, filePath string) []byte

GetRemoteFileData get file data from remote

func IsFileExist

func IsFileExist(filename string) bool

func MarshalYamlToFile

func MarshalYamlToFile(file string, obj interface{}) error

func NewSSHByCluster

func NewSSHByCluster(cluster *v1.Cluster) ssh.Interface

func PathExists added in v0.9.2

func PathExists(path string) (bool, error)

func RemoveTempFile

func RemoveTempFile(file string)

func RunCmdAndCheckResult

func RunCmdAndCheckResult(cmdLine string, expectedCode int) *gexec.Session

RunCmdAndCheckResult start cmd and check expectedCode

func Start

func Start(cmdLine string) (*gexec.Session, error)

Start sealer cmd and return *gexec.Session

func UnmarshalYamlFile

func UnmarshalYamlFile(file string, obj interface{}) error

func WriteFile

func WriteFile(fileName string, content []byte) error

Types

type SSHClient

type SSHClient struct {
	RemoteHostIP net.IP
	SSH          ssh.Interface
}

func NewSSHClientByCluster

func NewSSHClientByCluster(cluster *v1.Cluster) *SSHClient

Directories

Path Synopsis
client
k8s

Jump to

Keyboard shortcuts

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