open-nomad/client/fingerprint/memory_test.go
2015-08-27 15:19:19 -05:00

28 lines
515 B
Go

package fingerprint
import (
"testing"
"github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/nomad/structs"
)
func TestMemoryFingerprint(t *testing.T) {
f := NewMemoryFingerprint(testLogger())
node := &structs.Node{
Attributes: make(map[string]string),
}
ok, err := f.Fingerprint(&config.Config{}, node)
if err != nil {
t.Fatalf("err: %v", err)
}
if !ok {
t.Fatalf("should apply")
}
if node.Attributes["memory.totalbytes"] == "" {
t.Fatalf("Missing memory.totalbyes")
}
}