mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 11:25:41 +03:00
Merge pull request #400 from nak3/fingerprint-test
Update fingerprint test codes
This commit is contained in:
@@ -35,8 +35,8 @@ func TestCPUFingerprint(t *testing.T) {
|
||||
t.Fatalf("Missing CPU Total Compute")
|
||||
}
|
||||
|
||||
if node.Resources == nil {
|
||||
t.Fatalf("Expected resources on node, but got nil")
|
||||
if node.Resources == nil || node.Resources.CPU == 0 {
|
||||
t.Fatalf("Expected to find CPU Resources")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,5 +25,8 @@ func TestMemoryFingerprint(t *testing.T) {
|
||||
if node.Resources == nil {
|
||||
t.Fatalf("Node Resources was nil")
|
||||
}
|
||||
if node.Resources.MemoryMB == 0 {
|
||||
t.Errorf("Expected node.Resources.MemoryMB to be non-zero")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,9 +29,12 @@ func TestStorageFingerprint(t *testing.T) {
|
||||
}
|
||||
|
||||
if free > total {
|
||||
t.Errorf("storage.bytesfree %d is larger than storage.bytestotal %d", free, total)
|
||||
t.Fatalf("storage.bytesfree %d is larger than storage.bytestotal %d", free, total)
|
||||
}
|
||||
|
||||
if node.Resources == nil {
|
||||
t.Fatalf("Node Resources was nil")
|
||||
}
|
||||
if node.Resources.DiskMB == 0 {
|
||||
t.Errorf("Expected node.Resources.DiskMB to be non-zero")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user