From 15fe2ade18c0ecf7f18cc5b656e6ccb0b351421e Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 21 Mar 2023 13:55:32 -0700 Subject: [PATCH] Windows fixes for e2e tests (#16592) * e2e: skip task api test when windows too old * e2e: don't run proxy on windows --- e2e/ui/input/proxy.nomad | 5 +++++ e2e/workload_id/taskapi_test.go | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/e2e/ui/input/proxy.nomad b/e2e/ui/input/proxy.nomad index a9e7c7764..8ad9dd01c 100644 --- a/e2e/ui/input/proxy.nomad +++ b/e2e/ui/input/proxy.nomad @@ -2,6 +2,11 @@ job "nomad-proxy" { datacenters = ["dc1", "dc2"] namespace = "proxy" + constraint { + attribute = "${attr.kernel.name}" + value = "linux" + } + group "proxy" { network { diff --git a/e2e/workload_id/taskapi_test.go b/e2e/workload_id/taskapi_test.go index d28a104cb..daad675f5 100644 --- a/e2e/workload_id/taskapi_test.go +++ b/e2e/workload_id/taskapi_test.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "net/http" + "strings" "testing" "github.com/hashicorp/nomad/e2e/e2eutil" @@ -87,6 +88,22 @@ func testTaskAPIWindows(t *testing.T) { t.Skip("no Windows clients") } + found := false + for _, nodeID := range winNodes { + node, _, err := nomad.Nodes().Info(nodeID, nil) + must.NoError(t, err) + if name := node.Attributes["os.name"]; strings.Contains(name, "2016") { + t.Logf("Node %s is too old to support unix sockets: %s", nodeID, name) + continue + } + + found = true + break + } + if !found { + t.Skip("no Windows clients with unix socket support") + } + jobID := "api-win-" + uuid.Short() jobIDs := []string{jobID} t.Cleanup(e2eutil.CleanupJobsAndGC(t, &jobIDs))