Skip to content

Commit

Permalink
checkup: Add fail logic
Browse files Browse the repository at this point in the history
The checkup will now fail if the oslat Maximum latency measured exceeded
the oslatLatencyThreshold, and issue the appropriate failure reason.

Signed-off-by: Ram Lavi <[email protected]>
  • Loading branch information
RamLavi authored and orelmisan committed Dec 19, 2023
1 parent 1dacf85 commit 3a93d4e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/internal/checkup/checkup.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type Checkup struct {
vmi *kvcorev1.VirtualMachineInstance
results status.Results
executor testExecutor
cfg config.Config
}

const VMINamePrefix = "rt-vmi"
Expand All @@ -66,6 +67,7 @@ func New(client kubeVirtVMIClient, namespace string, checkupConfig config.Config
namespace: namespace,
vmi: newRealtimeVMI(checkupConfig),
executor: executor,
cfg: checkupConfig,
}
}

Expand Down Expand Up @@ -100,6 +102,10 @@ func (c *Checkup) Run(ctx context.Context) error {
}
c.results.VMUnderTestActualNodeName = c.vmi.Status.NodeName

if c.results.OslatMaxLatency > c.cfg.OslatLatencyThreshold {
return fmt.Errorf("oslat Max Latency measured %s exceeded the given threshold %s",
c.results.OslatMaxLatency.String(), c.cfg.OslatLatencyThreshold.String())
}
return nil
}

Expand Down

0 comments on commit 3a93d4e

Please sign in to comment.