-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:oscp/openshift-monitoring
- Loading branch information
Showing
2 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package checks | ||
|
||
import ( | ||
"io/ioutil" | ||
"log" | ||
"testing" | ||
) | ||
|
||
func init() { | ||
// Omit standard log output when running tests to allow one to focus on | ||
// actual test results. | ||
log.SetOutput(ioutil.Discard) | ||
} | ||
|
||
func TestIsVgSizeOk(t *testing.T) { | ||
tests := []struct { | ||
line string | ||
okSize int | ||
want bool | ||
}{ | ||
{"invalid input", 99, false}, | ||
{"5.37 26.84 vg_slow", 5, true}, | ||
{"5.37 26.84 vg_slow", 25, false}, | ||
{" 0 511.03 fedora", 10, false}, | ||
{"\t25\t250 test", 10, true}, | ||
} | ||
for _, tt := range tests { | ||
if got := isVgSizeOk(tt.line, tt.okSize); got != tt.want { | ||
t.Errorf("isVgSizeOk(%q, %v) = %v, want %v", tt.line, tt.okSize, got, tt.want) | ||
} | ||
} | ||
} |