Documentation
¶
Index ¶
- Constants
- func GetDefaultVMConfig(appName, cloudConfig string, portPub []string) openevec.PodConfig
- func GetRandomAppName(prefix string) string
- func NewTestContextFromConfig(cfg *openevec.EdenSetupArgs) (*testcontext.TestContext, error)
- type AppOption
- type EveNode
- func (node *EveNode) AppGetState(appName string) (string, error)
- func (node *EveNode) AppSCPCopy(appName, localFile, remoteFile string) error
- func (node *EveNode) AppSSHExec(appName, command string) (string, error)
- func (node *EveNode) AppStopAndRemove(appName string) error
- func (node *EveNode) AppWaitForRunningState(appName string, timeoutSeconds uint) error
- func (node *EveNode) AppWaitForSSH(appName string, timeoutSeconds uint) error
- func (node *EveNode) CopyTestScripts(appName, basetPath string, scripts *[]TestScript) error
- func (node *EveNode) EveDeleteFile(fileName string) error
- func (node *EveNode) EveDeployApp(appLink string, destructiveUse bool, pc openevec.PodConfig, ...) error
- func (node *EveNode) EveDeployUbuntu(version, name string, destructiveUse bool) (string, error)
- func (node *EveNode) EveFileExists(fileName string) (bool, error)
- func (node *EveNode) EveIsTpmEnabled() bool
- func (node *EveNode) EveReadFile(fileName string) ([]byte, error)
- func (node *EveNode) EveRebootAndWait(timeoutSeconds uint) error
- func (node *EveNode) EveRebootNode() error
- func (node *EveNode) EveRunCommand(command string) ([]byte, error)
- func (node *EveNode) GetAppNames() []string
- func (node *EveNode) GetCopiedScriptPath(scriptName string) string
- func (node *EveNode) LogTimeFatalf(format string, args ...interface{})
- func (node *EveNode) LogTimeInfof(format string, args ...interface{})
- type TestOption
- type TestScript
Constants ¶
const ( // AppDefaultSSHPass is a default ssh password for the VM running on the EVE node AppDefaultSSHPass = "passw0rd" // AppDefaultSSHUser is a default ssh user for the VM running on the EVE node AppDefaultSSHUser = "ubuntu" // AppDefaultCloudConfig is a default cloud-init configuration for the VM which just // enables ssh password authentication and sets the password to "passw0rd". AppDefaultCloudConfig = "#cloud-config\npassword: " + AppDefaultSSHPass + "\nchpasswd: { expire: False }\nssh_pwauth: True\n" )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultVMConfig ¶
GetDefaultVMConfig returns a default configuration for a VM
func GetRandomAppName ¶
GetRandomAppName generates a random app name
func NewTestContextFromConfig ¶
func NewTestContextFromConfig(cfg *openevec.EdenSetupArgs) (*testcontext.TestContext, error)
Types ¶
type AppOption ¶
AppOption is a function that sets the configuration for the app running on the EVE node
type EveNode ¶
type EveNode struct {
// contains filtered or unexported fields
}
EveNode is a struct that holds the information about the remote node
func InitializeTest ¶
func InitializeTest(projectName string, options ...TestOption) (*EveNode, error)
InitializeTest is used to provide setup and teardown for the rest of the tests. As part of setup we make sure that context has a slice of EVE instances that we can operate on. It grabs the first one in the slice for running tests.
func InitializeTestFromConfig ¶
func InitializeTestFromConfig(projectName string, cfg *openevec.EdenSetupArgs, options ...TestOption) (*EveNode, error)
func (*EveNode) AppGetState ¶
AppGetState gets the state of an app running on the EVE node
func (*EveNode) AppSCPCopy ¶
AppSCPCopy copies a file from the local machine to the app VM running on the EVE node.
func (*EveNode) AppSSHExec ¶
AppSSHExec executes a command on the app VM running on the EVE node.
func (*EveNode) AppStopAndRemove ¶
AppStopAndRemove stops and removes an app from the EVE node
func (*EveNode) AppWaitForRunningState ¶
AppWaitForRunningState waits for an app to start and become running on the EVE node
func (*EveNode) AppWaitForSSH ¶
AppWaitForSSH waits for the SSH connection to be established to the app VM that is running on the EVE node
func (*EveNode) CopyTestScripts ¶
func (node *EveNode) CopyTestScripts(appName, basetPath string, scripts *[]TestScript) error
CopyTestScripts copies the test scripts to the app VM running on the EVE node, makes them executable and sets the path to the copied script in the input.
func (*EveNode) EveDeleteFile ¶
EveDeleteFile deletes a file from EVE node
func (*EveNode) EveDeployApp ¶
func (node *EveNode) EveDeployApp(appLink string, destructiveUse bool, pc openevec.PodConfig, options ...AppOption) error
EveDeployApp deploys a VM/App on the EVE node
func (*EveNode) EveDeployUbuntu ¶
EveDeployUbuntu deploys an Ubuntu VM on the EVE node
func (*EveNode) EveFileExists ¶
EveFileExists checks if a file exists on EVE node
func (*EveNode) EveIsTpmEnabled ¶
EveIsTpmEnabled checks if EVE node is running with (SW)TPM enabled
func (*EveNode) EveReadFile ¶
EveReadFile reads a file from EVE node
func (*EveNode) EveRebootAndWait ¶
EveRebootAndWait reboots the EVE node and waits for it to come back.
func (*EveNode) EveRebootNode ¶
EveRebootNode reboots the EVE node.
func (*EveNode) EveRunCommand ¶
EveRunCommand runs a command on the EVE node
func (*EveNode) GetAppNames ¶
GetAppNames returns the names of the apps running on the EVE node
func (*EveNode) GetCopiedScriptPath ¶
GetCopiedScriptPath returns the path to the copied script on the app VM running on the EVE node.
func (*EveNode) LogTimeFatalf ¶
LogTimeFatalf logs a message with a timestamp, if it is called in the context of a test function it will call t.Fatal, otherwise it will call os.Exit(1)
func (*EveNode) LogTimeInfof ¶
LogTimeInfof logs a message with a timestamp, if it is called in the context of a test function it will call t.Logf, otherwise it will call fmt.Print
type TestOption ¶
type TestOption func()
TestOption is a function that sets the configuration for the test
func WithControllerVerbosity ¶
func WithControllerVerbosity(verbosity string) TestOption
WithControllerVerbosity sets the verbosity level of the controller, possible values are: panic, fatal, error, debug, info, trace, warn This is an option for InitializeTest.
func WithEdenConfigEnv ¶
func WithEdenConfigEnv(env string) TestOption
WithEdenConfigEnv sets the environment variable that holds the path to the eden configuration file. This is an option for InitializeTest.