open-nomad/client/fingerprint/arch_test.go

26 lines
618 B
Go
Raw Normal View History

2015-08-20 23:29:19 +00:00
package fingerprint
import (
"testing"
"github.com/hashicorp/nomad/client/config"
cstructs "github.com/hashicorp/nomad/client/structs"
2015-08-20 23:29:19 +00:00
"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)
2015-08-20 23:29:19 +00:00
if err != nil {
t.Fatalf("err: %v", err)
}
assertNodeAttributeContains(t, response.GetAttributes(), "cpu.arch")
2015-08-20 23:29:19 +00:00
}