From 14e17d40afb7b6b7597cee9f11ea892ece6ecdeb Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Fri, 26 Apr 2024 12:07:09 +0000 Subject: [PATCH] kola: Use skip func to skip cl.misc.nvidia Signed-off-by: Jeremi Piotrowski --- kola/tests/misc/nvidia.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/kola/tests/misc/nvidia.go b/kola/tests/misc/nvidia.go index 7a6f24edf..49a1e6881 100644 --- a/kola/tests/misc/nvidia.go +++ b/kola/tests/misc/nvidia.go @@ -3,8 +3,10 @@ package misc import ( "bytes" "fmt" + "strings" "time" + "github.com/coreos/go-semver/semver" "github.com/coreos/pkg/capnslog" "github.com/flatcar/mantle/kola" "github.com/flatcar/mantle/kola/cluster" @@ -28,13 +30,19 @@ func init() { Platforms: []string{"azure"}, Architectures: []string{"amd64"}, Flags: []register.Flag{register.NoEnableSelinux}, + SkipFunc: skipOnNonGpu, }) } -func verifyNvidiaInstallation(c cluster.TestCluster) { - if kola.AzureOptions.Size != "Standard_NC6s_v3" { - c.Skip("skipping due to wrong instance size") +func skipOnNonGpu(version semver.Version, channel, arch, platform string) bool { + // N stands for GPU instance obviously :) + if platform == "azure" && strings.Contains(kola.AzureOptions.Size, "N") { + return false } + return true +} + +func verifyNvidiaInstallation(c cluster.TestCluster) { m := c.Machines()[0] nvidiaStatusRetry := func() error {