Windows fixes for e2e tests (#16592)

* e2e: skip task api test when windows too old

* e2e: don't run proxy on windows
This commit is contained in:
Michael Schurter 2023-03-21 13:55:32 -07:00 committed by GitHub
parent b3d2ec7634
commit 15fe2ade18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -2,6 +2,11 @@ job "nomad-proxy" {
datacenters = ["dc1", "dc2"]
namespace = "proxy"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "proxy" {
network {

View file

@ -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))