edea3700a4
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()
20 lines
457 B
Go
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")
|
|
}
|