Skip to content

Commit

Permalink
Merge pull request #400 from nak3/fingerprint-test
Browse files Browse the repository at this point in the history
Update fingerprint test codes
  • Loading branch information
dadgar committed Nov 11, 2015
2 parents fbabd12 + b66244b commit f28b9e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/fingerprint/cpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

}
3 changes: 3 additions & 0 deletions client/fingerprint/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

}
5 changes: 4 additions & 1 deletion client/fingerprint/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit f28b9e7

Please sign in to comment.