diff --git a/pkg/internal/checkup/executor/console/console.go b/pkg/internal/checkup/executor/console/console.go index d6bf7bc7..4bc23514 100644 --- a/pkg/internal/checkup/executor/console/console.go +++ b/pkg/internal/checkup/executor/console/console.go @@ -101,6 +101,17 @@ func RetValue(retcode string) string { return "\n" + retcode + CRLF + ".*" + PromptExpression } +func (e Expecter) GetGuestKernelArgs() (string, error) { + const cmdLineCmd = "cat /proc/cmdline\n" + batch := []expect.Batcher{ + &expect.BSnd{S: cmdLineCmd}, + &expect.BExp{R: PromptExpression}, + } + const printKernelArgsTimeout = 30 * time.Second + resp, err := e.SafeExpectBatchWithResponse(batch, printKernelArgsTimeout) + return resp[0].Output, err +} + // SafeExpectBatchWithResponse runs the batch from `expected`, connecting to a VMI's console and // waiting for the batch to return with a response until timeout. // It validates that the commands arrive to the console. diff --git a/pkg/internal/checkup/executor/executor.go b/pkg/internal/checkup/executor/executor.go index 1ec75daf..564f9b8c 100644 --- a/pkg/internal/checkup/executor/executor.go +++ b/pkg/internal/checkup/executor/executor.go @@ -62,6 +62,9 @@ func (e Executor) Execute(ctx context.Context, vmiUnderTestName string) (status. return status.Results{}, fmt.Errorf("failed to login to VMI \"%s/%s\": %w", e.namespace, vmiUnderTestName, err) } + kernelArgs, _ := vmiUnderTestConsoleExpecter.GetGuestKernelArgs() + log.Printf("VMI under test guest kernel Args: %s", kernelArgs) + oslatClient := oslat.NewClient(vmiUnderTestConsoleExpecter, e.OslatDuration) log.Printf("Running Oslat test on VMI under test for %s...", e.OslatDuration.String()) maxLatency, err := oslatClient.Run(ctx)