utils

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(t *testing.T, command string) (stdout, stderr string, err error)

func ExecContext

func ExecContext(t *testing.T, ctx context.Context, command string) (stdout, stderr string, err error)

func ExecContextVerbose

func ExecContextVerbose(t *testing.T, ctx context.Context, command string) (stdout, stderr string, err error)

func ExecVerbose

func ExecVerbose(t *testing.T, command string) (stdout, stderr string, err error)

func RequirePortAvailable

func RequirePortAvailable(t *testing.T, port string)

RequirePortAvailable checks if a port is available (not open) locally

func ServicePort

func ServicePort(serviceName string) string

servicePort looks up the service port by app name

func SnapBuild

func SnapBuild(t *testing.T, workDir string) error

func SnapConnect

func SnapConnect(t *testing.T, plug, slot string) error

func SnapConnectSecretstoreToken

func SnapConnectSecretstoreToken(t *testing.T, snap string) error

func SnapDisconnect

func SnapDisconnect(t *testing.T, plug, slot string)

func SnapDumpLogs

func SnapDumpLogs(t *testing.T, start time.Time, snapName string)

func SnapInstallFromFile

func SnapInstallFromFile(t *testing.T, path string) error

func SnapInstallFromStore

func SnapInstallFromStore(t *testing.T, name, channel string) error

func SnapInstalled

func SnapInstalled(t *testing.T, name string) bool

func SnapLogs

func SnapLogs(t *testing.T, start time.Time, name string) string

func SnapRefresh

func SnapRefresh(t *testing.T, name, channel string)

func SnapRemove

func SnapRemove(t *testing.T, names ...string)

func SnapRestart

func SnapRestart(t *testing.T, names ...string)

func SnapRevision

func SnapRevision(t *testing.T, name string) string

func SnapServicesActive

func SnapServicesActive(t *testing.T, name string) bool

func SnapServicesEnabled

func SnapServicesEnabled(t *testing.T, name string) bool

func SnapSet

func SnapSet(t *testing.T, name, key, value string)

func SnapStart

func SnapStart(t *testing.T, names ...string)

func SnapStop

func SnapStop(t *testing.T, names ...string)

func SnapUnset

func SnapUnset(t *testing.T, name string, keys ...string)

func SnapVersion

func SnapVersion(t *testing.T, name string) string

func TestAutoStart

func TestAutoStart(t *testing.T, snapName string, testAutoStart bool)

func TestAutostartGlobal

func TestAutostartGlobal(t *testing.T, snapName string)

func TestConfig

func TestConfig(t *testing.T, snapName string, conf Config)

func TestNet

func TestNet(t *testing.T, snapName string, conf Net)

func TestPackaging

func TestPackaging(t *testing.T, snapName string, conf Packaging)

func TestRefresh

func TestRefresh(t *testing.T, snapName string)

TestRefresh tests an EdgeX upgrade using snap refresh

func WaitForLogMessage

func WaitForLogMessage(t *testing.T, snap, expectedLog string, since time.Time)

func WaitServiceOnline

func WaitServiceOnline(t *testing.T, maxRetry int, ports ...string) error

WaitServiceOnline waits for a service to come online by dialing its port(s) up to a maximum number

func WriteLogFile

func WriteLogFile(t *testing.T, label string, content string) error

Types

type Config

type Config struct {
	TestAutoStart bool
}

type Net

type Net struct {
	StartSnap        bool // should be set to true if services aren't started by default
	TestOpenPorts    []string
	TestBindLoopback []string
}

type Packaging

type Packaging struct {
	TestSemanticSnapVersion bool
}

Jump to

Keyboard shortcuts

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