open-nomad/client/fingerprint/arch_test.go
Chelsea Holland Komlo b8e8064835 code review fixup
2018-01-31 18:34:03 -05:00

30 lines
691 B
Go

package fingerprint
import (
"testing"
"github.com/hashicorp/nomad/client/config"
cstructs "github.com/hashicorp/nomad/client/structs"
"github.com/hashicorp/nomad/nomad/structs"
)
func TestArchFingerprint(t *testing.T) {
f := NewArchFingerprint(testLogger())
node := &structs.Node{
Attributes: make(map[string]string),
}
request := &cstructs.FingerprintRequest{Config: &config.Config{}, Node: node}
var response cstructs.FingerprintResponse
err := f.Fingerprint(request, &response)
if err != nil {
t.Fatalf("err: %v", err)
}
if !response.Detected {
t.Fatalf("expected response to be applicable")
}
assertNodeAttributeContains(t, response.Attributes, "cpu.arch")
}