2015-08-20 23:29:19 +00:00
|
|
|
package fingerprint
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2015-08-25 23:21:29 +00:00
|
|
|
"github.com/hashicorp/nomad/client/config"
|
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),
|
|
|
|
}
|
2015-08-25 23:21:29 +00:00
|
|
|
ok, err := f.Fingerprint(&config.Config{}, node)
|
2015-08-20 23:29:19 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %v", err)
|
|
|
|
}
|
|
|
|
if !ok {
|
|
|
|
t.Fatalf("should apply")
|
|
|
|
}
|
2017-01-06 22:23:22 +00:00
|
|
|
if node.Attributes["cpu.arch"] == "" {
|
2015-08-20 23:29:19 +00:00
|
|
|
t.Fatalf("missing arch")
|
|
|
|
}
|
|
|
|
}
|