From 8a05029efcd6748febb4561853ddc3395421e5c8 Mon Sep 17 00:00:00 2001 From: Shahriyar Jalayeri Date: Thu, 10 Oct 2024 12:59:20 +0300 Subject: [PATCH] evetestkit : new utils - allow for delplying pre-conifged vms like Ubuntu - allow for vm reuse of test is not destructive - allow for copying multitude of test scripts at once Signed-off-by: Shahriyar Jalayeri --- pkg/evetestkit/utils.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pkg/evetestkit/utils.go b/pkg/evetestkit/utils.go index 66e84c64c..44956110b 100644 --- a/pkg/evetestkit/utils.go +++ b/pkg/evetestkit/utils.go @@ -102,7 +102,6 @@ type EveNode struct { ip string t *testing.T ts []TestScript - ts []TestScript } // AppOption is a function that sets the configuration for the app running on @@ -112,7 +111,7 @@ type AppOption func(n *EveNode, appName string) // TestOption is a function that sets the configuration for the test type TestOption func() -func dumpToTpm(name, content string) (string, error) { +func dumpToTemp(name, content string) (string, error) { path := path.Join("/tmp/", name) err := os.WriteFile(path, []byte(content), 0644) if err != nil { @@ -168,15 +167,6 @@ func (node *EveNode) GetAppNames() []string { return names } -// GetAppNames returns the names of the apps running on the EVE node -func (node *EveNode) GetAppNames() []string { - names := make([]string, len(node.apps)) - for i, app := range node.apps { - names[i] = app.name - } - return names -} - // EveRunCommand runs a command on the EVE node func (node *EveNode) EveRunCommand(command string) ([]byte, error) { realStdout := os.Stdout @@ -344,11 +334,9 @@ func (node *EveNode) AppSSHExec(appName, command string) (string, error) { return "", fmt.Errorf("app %s not found, make sure to deploy app/vm with WithSSH option", appName) } - host := fmt.Sprintf("%s:%s", node.ip, appConfig.internal.sshPort) host := fmt.Sprintf("%s:%s", node.ip, appConfig.internal.sshPort) config := &ssh.ClientConfig{ - User: appConfig.internal.sshUser, User: appConfig.internal.sshUser, Auth: []ssh.AuthMethod{ ssh.Password(appConfig.internal.sshPass),