Skip to content

Commit

Permalink
checkup, executor: Try to log in to vmi under test
Browse files Browse the repository at this point in the history
Signed-off-by: Ram Lavi <ralavi@redhat.com>
  • Loading branch information
RamLavi committed Dec 4, 2023
1 parent db06c5e commit 8fd9ad1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/internal/checkup/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}

0 comments on commit 8fd9ad1

Please sign in to comment.