open-nomad/client/fingerprint/storage_test.go
Chris Bednarski edea3700a4 Add storage fingerprinter
Breaking change: Added ID() to Fingerprint interface. This allows us to assign
each fingerprint implementation a unique ID, identify which fingerprinters have
been run, and also self-identify in log messages.

- Added storage fingerprinter for Windows and *nix
- Added storage tests under storage_test.go
- Added test helper functions under fingerprint/fingerprint_test.go
- Added ID() to existing finterprinters and drivers
- Added Fingerprint.ID() to log messages via log.SetPrefix()
2015-08-26 17:17:08 -07:00

20 lines
457 B
Go

package fingerprint
import (
"testing"
"github.com/hashicorp/nomad/nomad/structs"
)
func TestStorageFingerprint(t *testing.T) {
f := NewStorageFingerprint(testLogger())
node := &structs.Node{
Attributes: make(map[string]string),
}
assertFingerprintOK(t, f, node)
assertNodeAttributeContains(t, node, "storage.volume")
assertNodeAttributeContains(t, node, "storage.bytestotal")
assertNodeAttributeContains(t, node, "storage.bytesavailable")
}