From 8fd9ad1c3c421895307226bd4e525264100c77bb Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Thu, 30 Nov 2023 17:21:41 +0200 Subject: [PATCH] checkup, executor: Try to log in to vmi under test Signed-off-by: Ram Lavi --- pkg/internal/checkup/executor/executor.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/internal/checkup/executor/executor.go b/pkg/internal/checkup/executor/executor.go index b494dc0c..d0ea2198 100644 --- a/pkg/internal/checkup/executor/executor.go +++ b/pkg/internal/checkup/executor/executor.go @@ -21,10 +21,13 @@ package executor import ( "context" + "fmt" + "log" "time" "kubevirt.io/client-go/kubecli" + "github.com/kiagnose/kubevirt-realtime-checkup/pkg/internal/checkup/executor/console" "github.com/kiagnose/kubevirt-realtime-checkup/pkg/internal/config" "github.com/kiagnose/kubevirt-realtime-checkup/pkg/internal/status" ) @@ -50,5 +53,11 @@ func New(client vmiSerialConsoleClient, namespace string) Executor { } func (e Executor) Execute(ctx context.Context, vmiUnderTestName string) (status.Results, error) { + log.Printf("Login to VMI under test...") + vmiUnderTestConsoleExpecter := console.NewExpecter(e.vmiSerialClient, e.namespace, vmiUnderTestName) + if err := vmiUnderTestConsoleExpecter.LoginToCentOS(e.vmiUsername, e.vmiPassword); err != nil { + return status.Results{}, fmt.Errorf("failed to login to VMI \"%s/%s\": %w", e.namespace, vmiUnderTestName, err) + } + return status.Results{}, nil }